✨ Features
- Full type hints
- Client info
- Get donates
- Get clients
- Long polling
- Async support
🔗 Installation
pip install donatello-py
For speedup:
pip install donatello-py[speed]
🧑🏭 Basic Usage
Get and activate your API key here.
⛓️ Sync
from donatello import Donatello
client = Donatello("YOUR_API_KEY")
# Get client info
print(client.get_me())
# Get donates
print(client.get_donates(page=0, per_page=00))
# Get clients
print(client.get_clients())
⛓️ Async
from donatello import AsyncDonatello
client = AsyncDonatello("YOUR_API_KEY")
async def main():
print(await client.get_me())
print(await client.get_donates(page=0, per_page=00))
print(await client.get_clients())
asyncio.run(main())
🥏 Long polling
For use long polling you need to create widget here and get widget id from url.
Example url:
https://donatello.to/widget/<WIDGET_ID>/token/<YOUR_API_KEY>
Code example
⛓️ Sync
from donatello import Donatello
from donatello.models import Donate, User
client = Donatello("YOUR_API_KEY", "WIDGET_ID")
@client.on_ready
def start(user: User):
print(f"Started with user {user.nickname}")
print(f"Donates Amount: {user.donates.total_amount}")
print(f"Donates count: {user.donates.total_count}")
@client.on_donate
def donate(donate: Donate):
print(donate)
client.start()
⛓️ Async
from donatello import AsyncDonatello
from donatello.models import Donate, User
client = AsyncDonatello("YOUR_API_KEY", "WIDGET_ID")
@client.on_donate
async def donate(donate):
print(f"Donator: {donate.nickname}")
print(f"Amount: {donate.amount} {donate.currency} / {donate.goal_amount} {donate.goal_currency}")
print(f"Message: {donate.message}")
@client.on_ready
async def ready(user):
print(user)
client.start()
📚 Docs
You can find docs here.
📝 Examples
You can find more examples here.
📄 License
📋 TODO
-
Add more examples
-
Add docs
-
Add tests
-
Websocket based long polling
-
Goal, Top, interactive widgets?Never
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Metadata
Release files for donatello-py 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| donatello_py-1.0.3.tar.gz | 11.1 kB | Without provenance | Details for donatello_py-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| donatello_py-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for donatello_py-1.0.3-py3-none-any.whl |
Total release size: 24.5 kB
Release files / donatello_py-1.0.3.tar.gz
| Download URL | donatello_py-1.0.3.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca0568a88d20ae02572949160403274494c3c33c739be3f097a31e3a42ccd7eb
|
|
BLAKE2b-256 checksum How to use checksums |
989c42d63d824e64f2752146a2cfae675fd942c708b090a85aad41d990d6769f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / donatello_py-1.0.3-py3-none-any.whl
| Download URL | donatello_py-1.0.3-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4081b92614d8dc4996cc6b9a1b00af7f8e00d071d6f887ed3ccec358669fa74
|
|
BLAKE2b-256 checksum How to use checksums |
22259adb4e88f73a7596ca4fd3d08a40dfe7f30a8efc01a747bb1c4e48355eca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for donatello-py 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.