π Unofficial Python wrapper for working with the API of the Ukrainian service for donations Donatello
GitHub | PyPI | Discord server
Before you start, you need to take a couple of steps
- First you need to create a Donatello token and enable the API functionality, all this can be done in your account on the API page
- You need to install the library via
pip install donatello
If you need to get information about the user with which you authenticated through a token, then this can be done through the convenient get_me()
method
from donatello import Donatello
token = "<YOUR TOKEN HERE>"
client = Donatello(token)
me = client.get_me()
# Print your account nickname
print(me.nickname)
You may need to get a list of your donations, and there is a get_donates()
method specifically for this, which will return you a convenient list of them
from donatello import Donatello
token = "<YOUR TOKEN HERE>"
client = Donatello(token)
donates = client.get_donates(size = 5) # "size = 5" - Get 5 last donates
for donate in donates:
print(f"{donate.client_name}: {donate.message}")
You can get top donators using the get_clients()
method
from donatello import Donatello
token = "<YOUR TOKEN HERE>"
client = Donatello(token)
donators = client.get_clients()
for donator in donators:
print(f"{donator.client_name}: {donator.total_amount}")
- Add async API driver
- Add docs
- Longpolling / Events