services
Contains services that makes the actual requests to MAL api.
AnimeService
Bases: BaseService
Hanldes all the methods related to Anime.
Source code in aniwrap/services/anime.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
get_anime
async
Get details of anime by the anime id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int | str
|
The Id of the anime. |
required |
Returns:
Type | Description |
---|---|
ResultT[Anime]
|
|
Example
Source code in aniwrap/services/anime.py
get_anime_ranking
async
get_anime_ranking(
ranking_type: AnimeRankingType,
*,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[AnimeRanking]]
Get different types of anime rankings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ranking_type |
AnimeRankingType
|
The type of ranking. Check enum |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[list[AnimeRanking]]
|
|
Example
Source code in aniwrap/services/anime.py
get_seasonal_anime
async
get_seasonal_anime(
year: int,
season: AnimeSeason,
*,
sort_type: AnimeSortType = AnimeSortType.AnimeScore,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[Anime]]
Get anime by season and year.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
year |
int
|
The year. |
required |
season |
AnimeSeason
|
The anime season in the year. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
sort_type |
AnimeSortType
|
The optional sort_type based on which the anime results will be sorted.
Defaults to |
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[list[Anime]]
|
|
Example
Source code in aniwrap/services/anime.py
search_anime
async
search_anime(
anime_name: str,
*,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[Anime]]
Search for anime by title.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
anime_name |
str
|
Title or name of the anime. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[list[Anime]]
|
|
Example
Source code in aniwrap/services/anime.py
BaseService
Bases: ABC
The base service from which all the other services inherit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
http_service |
HttpService
|
The http service to use for requests. |
required |
Source code in aniwrap/services/base.py
ForumService
Bases: BaseService
Handles all forum related methods.
Source code in aniwrap/services/forum.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
get_forum_boards
async
Get list of all the fourm boards filtered by category.
Returns:
Type | Description |
---|---|
ResultT[list[Forum]]
|
|
Example
Source code in aniwrap/services/forum.py
get_forum_topic_details
async
get_forum_topic_details(
topic_id: int,
*,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[ForumTopicDetails]
Get topic details by topic id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic_id |
int
|
The Id of the topic |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[ForumTopicDetails]
|
|
Example
Source code in aniwrap/services/forum.py
get_forum_topics
async
get_forum_topics(
*,
query: str | None = None,
board_id: int | None = None,
subboard_id: int | None = None,
limit: int | None = 10,
offset: int | None = 0,
topic_user_name: str | None = None,
username: str | None = None
) -> ResultT[list[ForumTopic]]
Get topics by different parameters. At least one of the arguments must be specified.
Other Parameters:
Name | Type | Description |
---|---|---|
query |
str | None
|
The query parameter to search - usually matches the title of the topic
Defaults to |
board_id |
int | None
|
The Id of specific board
Defaults to |
subboard_id |
int | None
|
The Id of any specific sub board
Defaults to |
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
topic_user_name |
str | None
|
The username of the user that started the topic
Defaults to |
username |
str | None
|
The username of the users that participated in the topic
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[list[ForumTopic]]
|
|
Raises:
Type | Description |
---|---|
ValueError
|
When no arguments are given |
Example
Source code in aniwrap/services/forum.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
HttpService
The HTTP service that is used to make requests to MAL API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id |
str | None
|
X-MAL-CLIENT-ID. |
None
|
Source code in aniwrap/services/http.py
close
async
fetch
async
Makes a request to the given route.
Returns:
Type | Description |
---|---|
HttpErrorResponse | HttpSuccessResponse
|
The HTTP response [ |
Source code in aniwrap/services/http.py
MangaService
Bases: BaseService
Handles all methods related to Manga.
Source code in aniwrap/services/manga.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
get_manga
async
Get details of manga by the manga id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int | str
|
The Id of the manga. |
required |
Returns:
Type | Description |
---|---|
ResultT[Manga]
|
|
Example
Source code in aniwrap/services/manga.py
get_manga_ranking
async
get_manga_ranking(
ranking_type: MangaRankingType,
*,
limit: int | None = 10,
offset: int | None = 0
) -> Result[list[MangaRanking]]
Get different types of manga rankings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ranking_type |
MangaRankingType
|
The type of ranking. Check enum |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
Result[list[MangaRanking]]
|
|
Example
Source code in aniwrap/services/manga.py
search_manga
async
search_manga(
manga_name: str,
*,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[Manga]]
Search for Manga by title.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
manga_name |
str
|
Title or name of the manga. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
limit |
int | None
|
The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to |
offset |
int | None
|
The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to |
Returns:
Type | Description |
---|---|
ResultT[list[Manga]]
|
|
Example
Source code in aniwrap/services/manga.py
UserService
Bases: BaseService
Hanldes all the methods related to user Anime and Manga.
Source code in aniwrap/services/user.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
|
delete_anime_from_list
async
Delete an anime from user's list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
anime_id |
str
|
The Id of the anime to be deleted from the list. |
required |
Returns:
Type | Description |
---|---|
ResultT[str]
|
|
Example
Source code in aniwrap/services/user.py
delete_manga_from_list
async
Delete an manga from user's list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
manga_id |
str
|
The Id of the manga to be deleted from the list. |
required |
Returns:
Type | Description |
---|---|
ResultT[str]
|
|
Example
Source code in aniwrap/services/user.py
get_anime_list
async
get_anime_list(
username: str,
*,
status: AnimeWatchStatus | None = None,
sort: AnimeListSortType | None = None,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[AnimeList]]
Get anime list of a user by username.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str
|
The username of the user. |
required |
KeywordArgs
status: The optional status based on which the results will be filtered. If not specified, the result will contain anime with all the status.
Defaults to None
.
sort: The optional sort filter based on which the results will be sorted. If not specified, by default the results will be sorted in the descending order of last updated date.
Defaults to None
.
limit: The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to 10
offset: The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to 0
Returns:
Type | Description |
---|---|
ResultT[list[AnimeList]]
|
|
Example
Source code in aniwrap/services/user.py
get_manga_list
async
get_manga_list(
username: str,
*,
status: MangaReadStatus | None = None,
sort: MangaListSortType | None = None,
limit: int | None = 10,
offset: int | None = 0
) -> ResultT[list[MangaList]]
Get the manga list of a user by user name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str
|
The user name of the user. |
required |
KeywordArgs
status: The status with which the list need to be filtered. If specified, the result will only contain manga of this status.
Defaults to None
and result contains manga of all status'.
sort: The type of sorting on the manga list.
Defaults to None
.
limit: The optional limit to use with requests, which specifies the number of results in the response. Should be between 1 and 100.
Defaults to 10
offset: The optional offset to use with requests, which specifies the offset from the start when fetching response.
Defaults to 0
Returns:
Type | Description |
---|---|
ResultT[list[MangaList]]
|
|
Example
Source code in aniwrap/services/user.py
update_anime_list
async
update_anime_list(
anime_id: int,
*,
status: AnimeWatchStatus | None = None,
is_rewatching: bool | None = None,
score: int | None = None,
num_watched_episodes: int | None = None,
priority: ListPriority | None = None,
num_times_rewatched: int | None = None,
rewatch_value: AnimeRewatchValue | None = None,
tags: str | None = None,
comments: str | None = None
) -> ResultT[AnimeListUpdate]
Update anime details in user anime list. If the anime doesn't already exists, this will add the anime to the list. Only specify the params that need to be updated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
anime_id |
int
|
The id of the anime. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
status |
AnimeWatchStatus | None
|
The watch status of the anime. |
is_rewatching |
bool | None
|
The rewatching status of the anime. |
score |
int | None
|
The score of the anime. Score should be in between 0 and 10. |
num_watched_episodes |
int | None
|
The number of episodes watched. |
priority |
ListPriority | None
|
The priority of the anime in the user list. |
num_times_rewatched |
int | None
|
The number of times rewatched. |
rewatch_value |
AnimeRewatchValue | None
|
The rewatch value of the anime. |
tags |
str | None
|
The tags that need to be added. |
comments |
str | None
|
The user comments. |
Returns:
Type | Description |
---|---|
ResultT[AnimeListUpdate]
|
|
ResultT[AnimeListUpdate]
|
|
Example
Source code in aniwrap/services/user.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
update_manga_list
async
update_manga_list(
manga_id: str,
*,
status: MangaReadStatus | None = None,
is_rereading: bool | None = None,
score: int | None = None,
num_volumes_read: int | None = None,
num_chapters_read: int | None = None,
priority: ListPriority | None = None,
num_times_reread: int | None = None,
reread_value: MangaRereadValue | None = None,
tags: str | None = None,
comments: str | None = None
) -> ResultT[MangaListUpdate]
Update manga details in user manga list. If the manga doesn't already exists, this will add the manga to the list. Only specify the params that need to be updated/added.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
manga_id |
str
|
The id of the manga. |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
status |
MangaReadStatus | None
|
The Read status of the manga. |
is_rereading |
bool | None
|
The rereading status of the manga. |
score |
int | None
|
The score of the manga. Score should be in between 0 and 10. |
num_volumes_read |
int | None
|
The number of volumes read. |
num_chapters_read |
int | None
|
The number of chapters read. |
priority |
ListPriority | None
|
The priority of the manga in the user list. |
num_times_reread |
int | None
|
The number of times reread. |
reread_value |
MangaRereadValue | None
|
The reread value of the manga. |
tags |
str | None
|
The tags that need to be added. |
comments |
str | None
|
The user comments. |
Returns:
Type | Description |
---|---|
ResultT[MangaListUpdate]
|
|
ResultT[MangaListUpdate]
|
|
Example
Source code in aniwrap/services/user.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|