tatsu-api


Nametatsu-api JSON
Version 1.0.0.post1 PyPI version JSON
download
home_page
SummaryAn unofficial, async-ready wrapper for the Tatsu API.
upload_time2023-11-10 21:21:01
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Thanos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python python-3 tatsu tatsu-api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tatsu API Wrapper
[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/tatsu-api.svg)](https://pypi.python.org/pypi/discord.py)
[![License: MIT](https://img.shields.io/github/license/Sachaa-Thanasius/tatsu-api.svg)](https://opensource.org/licenses/MIT)
[![Checked with pyright](https://img.shields.io/badge/pyright-checked-informational.svg)](https://github.com/microsoft/pyright/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)


A lightweight and asynchronous wrapper for [Tatsu v1 API](https://tatsu.gg), 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:

```shell
# 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](./examples/).

```python
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](https://github.com/Rapptz/discord.py) for being an inspiration and providing a strong example for implementation.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tatsu-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python,python-3,tatsu,tatsu-api",
    "author": "",
    "author_email": "Sachaa-Thanasius <111999343+Sachaa-Thanasius@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/87/9f/c31cdaee7c5b6b44d89537ea3baede4b0276e55e43c01c447e58b880afcc/tatsu_api-1.0.0.post1.tar.gz",
    "platform": null,
    "description": "# Tatsu API Wrapper\r\n[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/tatsu-api.svg)](https://pypi.python.org/pypi/discord.py)\r\n[![License: MIT](https://img.shields.io/github/license/Sachaa-Thanasius/tatsu-api.svg)](https://opensource.org/licenses/MIT)\r\n[![Checked with pyright](https://img.shields.io/badge/pyright-checked-informational.svg)](https://github.com/microsoft/pyright/)\r\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\r\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\r\n\r\n\r\nA lightweight and asynchronous wrapper for [Tatsu v1 API](https://tatsu.gg), written in Python. Supports every documented API endpoint.\r\n\r\nTo get an API key, use the command \"t!apikey\" on a Discord server with the Tatsu bot present.\r\n\r\n*Note: Modifying a user's scores/points isn't possible without certain Discord permissions. See the API docs for more info.*\r\n\r\n## Installing\r\n\r\n**tatsu-api currently requires Python 3.8 or higher.**\r\n\r\nTo install the library, run one of the following commands:\r\n\r\n```shell\r\n# Linux/macOS\r\npython3 -m pip install -U tatsu-api\r\n\r\n# Windows\r\npy -3 -m pip install -U tatsu-api\r\n```\r\n\r\n## Quick Example\r\nFor more examples, see the [examples folder](./examples/).\r\n\r\n```python\r\nimport asyncio\r\nimport tatsu_api as tatsu\r\n\r\nasync def main() -> None:\r\n    \"\"\"Example function.\"\"\"\r\n    \r\n    api_key = \"API_KEY\"\r\n    test_guild = 173184118492889089     # The Discord ID of the official Tatsu server.\r\n    test_user = 1234567891              # Random Discord user ID.\r\n    \r\n    # The client can be used as a context manager to handle closing of the\r\n    # internal HTTP session.\r\n    async with tatsu.Client(api_key) as client:\r\n        profile = await client.get_user(test_user)\r\n        print(f\"{profile.username} currently has {profile.credits} credits and {profile.reputation} reputation.\")\r\n        \r\n        username = profile.username\r\n        \r\n        ranking = await client.get_member_ranking(test_guild, test_user, \"all\")\r\n        print(f\"On the Tatsu server, {username} ranks at {ranking.rank} for all time.\")\r\n        \r\n        before_points = await client.get_member_points(test_guild, test_user)\r\n        print(f\"{username} - Points before update: {before_points.points}\")\r\n        \r\n        after_points = await client.update_member_points(test_guild, test_user, -10)\r\n        print(f\"{username} - Points after update: {after_points.points}\")\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n## Acknowledgements\r\nShoutout to [discord.py](https://github.com/Rapptz/discord.py) for being an inspiration and providing a strong example for implementation.\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Thanos  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "An unofficial, async-ready wrapper for the Tatsu API.",
    "version": "1.0.0.post1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Sachaa-Thanasius/tatsu-api/issues",
        "Homepage": "https://github.com/Sachaa-Thanasius/tatsu-api"
    },
    "split_keywords": [
        "python",
        "python-3",
        "tatsu",
        "tatsu-api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ce10e74ac2aea72589cf2178f0e56fb62d18969f8b1153ac64c6e89726b2ef0",
                "md5": "84e4ca3016af2cd21fdd9d3011883346",
                "sha256": "86c497147fb0de8aa0d3e5e6fb79ccee99c5f7c5cdd9ac60b9c7a67015b0bb6d"
            },
            "downloads": -1,
            "filename": "tatsu_api-1.0.0.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84e4ca3016af2cd21fdd9d3011883346",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12104,
            "upload_time": "2023-11-10T21:20:41",
            "upload_time_iso_8601": "2023-11-10T21:20:41.176320Z",
            "url": "https://files.pythonhosted.org/packages/8c/e1/0e74ac2aea72589cf2178f0e56fb62d18969f8b1153ac64c6e89726b2ef0/tatsu_api-1.0.0.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "879fc31cdaee7c5b6b44d89537ea3baede4b0276e55e43c01c447e58b880afcc",
                "md5": "b0dd93c755115823e35f5e615a312c0a",
                "sha256": "e9d65b1331ac62dc1857fd8aaec2ac9c170fb2b47f50115a40b1f28fe419d9cf"
            },
            "downloads": -1,
            "filename": "tatsu_api-1.0.0.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "b0dd93c755115823e35f5e615a312c0a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13589,
            "upload_time": "2023-11-10T21:21:01",
            "upload_time_iso_8601": "2023-11-10T21:21:01.973964Z",
            "url": "https://files.pythonhosted.org/packages/87/9f/c31cdaee7c5b6b44d89537ea3baede4b0276e55e43c01c447e58b880afcc/tatsu_api-1.0.0.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-10 21:21:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Sachaa-Thanasius",
    "github_project": "tatsu-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tatsu-api"
}
        
Elapsed time: 0.14033s