Skip to main content

🐍 Python API wrapper for Ukrainian donate service Donatello

Project description

Donatello.py

Made with Python MIT License Version: 1.0.7 PyPI - Downloads

🐍 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

  1. 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
  2. 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)

Uploaded Source

Built Distribution

donatello-1.0.7-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page