Code Monkey home page Code Monkey logo

donatello's Introduction

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

donatello's People

Contributors

selfkilla666 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

donatelloz-1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.