🐍 Python API wrapper for Ukrainian donate service Donatello
Project description
Donatello.py
🐍 Unofficial Python wrapper for working with the API of the Ukrainian service for donations Donatello
GitHub | PyPI | Discord server
Quickstart
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
Get me as User
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)
Get donations
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}")
Get top donators
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}")
In future
- Add async API driver
- Add docs
- Longpolling / Events
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
donatello-1.0.7.tar.gz
(7.2 kB
view hashes)
Built Distribution
donatello-1.0.7-py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for donatello-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f92f3d806b881586afee1ff406eb0be4ff76027dd3405736dfe483d4e982590 |
|
MD5 | 78ebe14f8a87ad1caf0482105c5d0ec7 |
|
BLAKE2b-256 | a5583cd7115f637695817c6fc9ee17af24b409768df2b88ba6383751019da32c |