|
| 1 | +# Animu |
| 2 | +An async wrapper for Animu API in Python. |
| 3 | + |
| 4 | +<details> |
| 5 | + <summary>Introduction</summary> |
| 6 | + <p> |
| 7 | + |
| 8 | +# Animu |
| 9 | +An async wrapper for [Animu API](https://animu.ml/) written in Python. |
| 10 | + |
| 11 | +## Key Features |
| 12 | +- An async library. |
| 13 | +- Anime fact, waifu & more! |
| 14 | +- Especially made for discord bots. |
| 15 | +- Easy to use with an object oriented design. |
| 16 | + |
| 17 | + |
| 18 | +## Installing |
| 19 | + |
| 20 | +**Python 3.8 or higher is required** |
| 21 | + |
| 22 | +You can install it by following command: |
| 23 | + |
| 24 | +```cmd |
| 25 | +pip install animu |
| 26 | +``` |
| 27 | + </p> |
| 28 | +</details> |
| 29 | + |
| 30 | +<details> |
| 31 | + <summary>FAQ & Links </summary> |
| 32 | + <p> |
| 33 | + |
| 34 | +# FAQ |
| 35 | + |
| 36 | +## How do I get the Animu API token? |
| 37 | +To get the token, [join Discord server of Animu API](https://discord.gg/yyW389c). Move to `#bot-commands` channel. And do `-claim`. |
| 38 | + |
| 39 | +From there, further process should start in your DM. Good luck! |
| 40 | + |
| 41 | +## My Token is not working anymore. Why? |
| 42 | +Make sure that you've joined the support server, or else it won't work. If it's still not working, please ask for help in their official server. |
| 43 | + |
| 44 | +## Any examples? |
| 45 | +Check [examples](https://github.com/EitoZX/Animu/examples/) folder for examples. |
| 46 | + |
| 47 | +## Any ratelimit? |
| 48 | +Yes, 5 requests/second. |
| 49 | + |
| 50 | +## Related Links |
| 51 | + |
| 52 | +- [Official Animu API Discord Server](https://discord.gg/yyW389c) |
| 53 | + </p> |
| 54 | +</details> |
| 55 | + |
| 56 | +# Documentation |
| 57 | +<details> |
| 58 | + <summary>Client Object</summary> |
| 59 | + |
| 60 | +## animu.Client |
| 61 | +After installing [animu](https://pypi.org/project/animu), |
| 62 | +you can connect client like this: |
| 63 | + |
| 64 | +```python |
| 65 | +import animu |
| 66 | + |
| 67 | +TOKEN = "ANIMU API TOKEN" #Read FAQ to know about token |
| 68 | +client = animu.Client(TOKEN) |
| 69 | +``` |
| 70 | +From here onwards, whenever this documentation refers to 'client', it refers to what we've defined above. |
| 71 | + |
| 72 | +**All following listed methods in this section, must be invoked with `await`.** |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## client.fact |
| 77 | +**returns:** |
| 78 | +- Fact Object |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## client.password |
| 83 | +**returns:** |
| 84 | +- Password Object |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## client.quote |
| 89 | +**returns:** |
| 90 | +- Quote Object |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## client.roleplay(query:str) |
| 95 | +**parameter:** |
| 96 | +- query: the roleplay endpoint that you want to retrieve. |
| 97 | + |
| 98 | +**returns:** |
| 99 | +- Roleplay Object |
| 100 | +--- |
| 101 | + |
| 102 | +## client.waifu |
| 103 | +**returns:** |
| 104 | +- Waifu Object |
| 105 | + |
| 106 | +</details> |
| 107 | + |
| 108 | +<details> |
| 109 | + <summary>Data Model Object</summary> |
| 110 | + |
| 111 | +All the following objects, inherit the following `Base` class: |
| 112 | + |
| 113 | +```py |
| 114 | +class Base: |
| 115 | + def __init__(self, data): |
| 116 | + self._data = data |
| 117 | + |
| 118 | + def __getitem__(self, key): |
| 119 | + return self._data[key] |
| 120 | + |
| 121 | + def __str__(self): |
| 122 | + return str(self._data) |
| 123 | +``` |
| 124 | +they support thier own attributes as well as `key`(s) from api endpoints. |
| 125 | + |
| 126 | +## Fact Object |
| 127 | +**Attributes:** |
| 128 | +- **id** (`int`): ID of the fact |
| 129 | +- **fact** (`str`): Fact |
| 130 | +- **tags** (`list`): List of tags for that fact |
| 131 | + |
| 132 | +## Password Object |
| 133 | +**Attributes:** |
| 134 | +- **password** (`str`): Password |
| 135 | + |
| 136 | +## Quote Object |
| 137 | +**Attributes:** |
| 138 | +- **id** (`int`): ID of the quote |
| 139 | +- **quote** (`str`): Quote |
| 140 | +- **anime** (`str`): Name of the anime |
| 141 | +- **said** (`str`): Character who said that quote. |
| 142 | + |
| 143 | +## Roleplay Object |
| 144 | +**Attributes:** |
| 145 | +- **url** (`str`): URL of the gif/image for that specific roleplay query. |
| 146 | + |
| 147 | +## Waifu Object |
| 148 | +**Attributes:** |
| 149 | +- **id** (`int`): ID of the waifu |
| 150 | +- **images** (`list`): List of images of retrieved waifu. |
| 151 | +- **names** (`dict`): dictoinary of all names of retrieved waifu. |
| 152 | +- **en_name** (`str`): Name of the Waifu in english |
| 153 | +- **jp_name** (`str`): Name of the Waifu in Japanese |
| 154 | +- **alt_name** (`str`): Alternative name of the waifu. |
| 155 | +- **animeinfo** (`dict`): Dictionary with information about anime in reference to waifu attribute |
| 156 | +- **anime** (`str`): Name of the anime in reference to waifu attribute |
| 157 | +- **anime_type** (`str`): Anime type of anime attribute. |
| 158 | +- **statistics** (`dict`): statistics data in dictionary format |
| 159 | +- **fav** (`int`): favourite statistics data |
| 160 | +- **love** (`int`): Love statsitics data |
| 161 | +- **hate** (`int`): Hate statsitics data |
| 162 | +- **upvote** (`int`): Upvote statistics data |
| 163 | +- **downvote** (`int`): Downvote statistics data |
| 164 | + |
| 165 | +</details> |
| 166 | + |
| 167 | +<details> |
| 168 | + <summary>Examples</summary> |
| 169 | + |
| 170 | +[Check here](https://github.com/EitoZX/Animu/tree/master/examples) |
| 171 | +</details> |
| 172 | + |
| 173 | +Source Code: https://github.com/EitoZX/Animu |
| 174 | + |
| 175 | +On Pypi: https://pypi.org/project/animu |
0 commit comments