Tatsu API Wrapper
A lightweight and asynchronous wrapper for Tatsu v1 API, written in Python. Supports every documented API endpoint.
To get an API key, use the command "t!apikey" on a Discord server with the Tatsu bot present.
Note: Modifying a user's scores/points isn't possible without certain Discord permissions. See the API docs for more info.
Installing
tatsu-api currently requires Python 3.8 or higher.
To install the library, run one of the following commands:
# Linux/macOS
python3 -m pip install -U tatsu-api
# Windows
py -3 -m pip install -U tatsu-api
Quick Example
For more examples, see the examples folder.
import asyncio
import tatsu_api as tatsu
async def main() -> None:
"""Example function."""
api_key = "API_KEY"
test_guild = 173184118492889089 # The Discord ID of the official Tatsu server.
test_user = 1234567891 # Random Discord user ID.
# The client can be used as a context manager to handle closing of the
# internal HTTP session.
async with tatsu.Client(api_key) as client:
profile = await client.get_user(test_user)
print(f"{profile.username} currently has {profile.credits} credits and {profile.reputation} reputation.")
username = profile.username
ranking = await client.get_member_ranking(test_guild, test_user, "all")
print(f"On the Tatsu server, {username} ranks at {ranking.rank} for all time.")
before_points = await client.get_member_points(test_guild, test_user)
print(f"{username} - Points before update: {before_points.points}")
after_points = await client.update_member_points(test_guild, test_user, -10)
print(f"{username} - Points after update: {after_points.points}")
asyncio.run(main())
Acknowledgements
Shoutout to discord.py for being an inspiration and providing a strong example for implementation.
Metadata
Release files for tatsu-api 1.0.0.post1
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 |
|---|---|---|---|---|
| tatsu_api-1.0.0.post1.tar.gz | 13.6 kB | Without provenance | Details for tatsu_api-1.0.0.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tatsu_api-1.0.0.post1-py3-none-any.whl | Python 3 | none | any | Details for tatsu_api-1.0.0.post1-py3-none-any.whl |
Total release size: 25.7 kB
Release files / tatsu_api-1.0.0.post1.tar.gz
| Download URL | tatsu_api-1.0.0.post1.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9d65b1331ac62dc1857fd8aaec2ac9c170fb2b47f50115a40b1f28fe419d9cf
|
|
BLAKE2b-256 checksum How to use checksums |
879fc31cdaee7c5b6b44d89537ea3baede4b0276e55e43c01c447e58b880afcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / tatsu_api-1.0.0.post1-py3-none-any.whl
| Download URL | tatsu_api-1.0.0.post1-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86c497147fb0de8aa0d3e5e6fb79ccee99c5f7c5cdd9ac60b9c7a67015b0bb6d
|
|
BLAKE2b-256 checksum How to use checksums |
8ce10e74ac2aea72589cf2178f0e56fb62d18969f8b1153ac64c6e89726b2ef0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for tatsu-api 1.0.0.post1
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.