semvec/pypi-packages huggingface dataset:
si23si23 0.0.3
A small example package
Requires Python: >=3.8.0

# tatsupy
An async python api wrapper for the Tatsu's (discord bot) API.

## Installation
```
# Linux/macOS
python3 -m pip install -U tatsu-py

# Windows
py -3 -m pip install -U tatsu-py
```
To install the development version, do the following:
```
$ git clone https://github.com/si23/tatsu-py
```


## Quick Examples
#### Gets `member's points` & `member's score`
```py
import tatsu

client = tatsu.Client(key = "YOUR API KEY")

async def get_member_points() -> int:
	result = await client.get_member_points(guild_id = 1234, user_id = 5678)
	return result.points


async def get_member_score() -> int:
	result = await client.get_member_score(guild_id = 1234, user_id = 5678)
	return result.score
```



#### Edit `member's points` & `member's score`
- You must have the `Manage Guild` permission.

```py
import tatsu 
from tatsu import ActionType

client = tatsu.Client(key =  "YOUR API KEY")  

async def remove_member_score() -> int: 
	result = await client.edit_member_score(guild_id = 1234, user_id = 5678, action = ActionType.Remove, amount = 100)
	return result.score # New score (-100)
	

async def add_member_points() -> int: 
	result =  await client.edit_member_points(guild_id = 1234, user_id = 5678, action = ActionType.Add, amount = 100)
	return result.points # New points (+100)
```



####  Gets `member's raking` & `guild's rankings`
```py
import tatsu 

client = tatsu.Client(key =  "YOUR API KEY")  

async def get_member_ranking() -> int: 
	result = await client.get_member_ranking(guild_id = 1234, user_id = 5678)  
	return result.rank
	

async def get_guild_rankings() -> int: 
	result =  await client.get_guild_rankings(guild_id = 1234)
	return result.rankings
```
##### Using 'page' argument:
```py
async def get_guild_rankings() -> int: 
	result =  await client.get_guild_rankings(guild_id = 1234, page = 2)
	return result.rakings[0].rank  # return 101
```



## Links
- [Tatsu API](https://dev.tatsu.gg)