This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
929 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "shikithon" | ||
version = "0.3.0" | ||
version = "0.4.0" | ||
description = "Yet another Python wrapper for Shikimori API" | ||
authors = [ | ||
"SecondThundeR <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Contains package version and some magic for importing API object.""" | ||
from shikithon.api import API | ||
|
||
__version__ = '0.3.0' | ||
__version__ = '0.4.0' | ||
__all__ = ['API'] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
"""Enums for /api/mangas.""" | ||
from enum import Enum | ||
|
||
|
||
class MangaOrder(Enum): | ||
"""Contains constants related for list ordering query.""" | ||
ID = 'id' | ||
ID_DESC = 'id_desc' | ||
RANKED = 'ranked' | ||
KIND = 'kind' | ||
POPULARITY = 'popularity' | ||
NAME = 'name' | ||
AIRED_ON = 'aired_on' | ||
VOLUMES = 'volumes' | ||
CHAPTERS = 'chapters' | ||
CREATED_AT = 'created_at' | ||
CREATED_AT_DESC = 'created_at_desc' | ||
RANDOM = 'random' | ||
|
||
|
||
class MangaKind(Enum): | ||
"""Contains constants related for getting certain kind of manga.""" | ||
MANGA = 'manga' | ||
NOT_MANGA = '!manga' | ||
MANHWA = 'manhwa' | ||
NOT_MANHWA = '!manhwa' | ||
MANHUA = 'manhua' | ||
NOT_MANHUA = '!manhua' | ||
LIGHT_NOVEL = 'light_novel' | ||
NOT_LIGHT_NOVEL = '!light_novel' | ||
NOVEL = 'novel' | ||
NOT_NOVEL = '!novel' | ||
ONE_SHOT = 'one_shot' | ||
NOT_ONE_SHOT = '!one_shot' | ||
DOUJIN = 'doujin' | ||
NOT_DOUJIN = '!doujin' | ||
|
||
|
||
class MangaStatus(Enum): | ||
"""Contains constants related for getting certain status of manga.""" | ||
ANONS = 'anons' | ||
NOT_ANONS = '!anons' | ||
ONGOING = 'ongoing' | ||
NOT_ONGOING = '!ongoing' | ||
RELEASED = 'released' | ||
NOT_RELEASED = '!released' | ||
PAUSED = 'paused' | ||
NOT_PAUSED = '!paused' | ||
DISCONTINUED = 'discontinued' | ||
NOT_DISCONTINUED = '!discontinued' | ||
|
||
|
||
class MangaCensorship(Enum): | ||
"""Contains constants related for getting | ||
certain censorship status of manga. | ||
""" | ||
CENSORED = 'true' | ||
UNCENSORED = 'false' | ||
|
||
|
||
class MangaList(Enum): | ||
"""Contains constants related for getting | ||
certain user list status of manga. | ||
""" | ||
PLANNED = 'planned' | ||
NOT_PLANNED = '!planned' | ||
WATCHING = 'watching' | ||
NOT_WATCHING = '!watching' | ||
REWATCHING = 'rewatching' | ||
NOT_REWATCHING = '!rewatching' | ||
COMPLETED = 'completed' | ||
NOT_COMPLETED = '!completed' | ||
ON_HOLD = 'on_hold' | ||
NOT_ON_HOLD = '!on_hold' | ||
DROPPED = 'dropped' | ||
NOT_DROPPED = '!dropped' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
class ResponseCode(Enum): | ||
"""Contains response status codes.""" | ||
SUCCESS = 200 | ||
NO_CONTENT = 204 | ||
RETRY_LATER = 429 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Model for /api/people and submodel for creator.py""" | ||
from datetime import datetime | ||
from typing import List, Optional, Tuple | ||
|
||
from pydantic import BaseModel | ||
|
||
from shikithon.models.image import Image | ||
from shikithon.models.people_roles import PeopleRoles | ||
from shikithon.models.people_works import PeopleWorks | ||
|
||
|
||
class People(BaseModel): | ||
"""Represents person entity.""" | ||
id: int | ||
name: str | ||
russian: str | ||
image: Image | ||
url: str | ||
japanese: Optional[str] | ||
job_title: Optional[str] | ||
birthday: Optional[str] | ||
website: Optional[str] | ||
groupped_roles: Optional[List[Tuple[str, int]]] | ||
roles: Optional[List[PeopleRoles]] | ||
works: Optional[List[PeopleWorks]] | ||
thread_id: Optional[int] | ||
topic_id: Optional[int] | ||
person_favoured: Optional[bool] | ||
producer: Optional[bool] | ||
producer_favoured: Optional[bool] | ||
mangaka: Optional[bool] | ||
mangaka_favoured: Optional[bool] | ||
seyu: Optional[bool] | ||
seyu_favoured: Optional[bool] | ||
updated_at: Optional[datetime] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Submodel for people.py""" | ||
from typing import List, Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
from shikithon.models.anime import Anime | ||
from shikithon.models.character import Character | ||
|
||
|
||
class PeopleRoles(BaseModel): | ||
"""Represents roles entity of person.""" | ||
characters: Optional[List[Character]] | ||
anime: Optional[List[Anime]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Submodel for people.py""" | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
from shikithon.models.anime import Anime | ||
from shikithon.models.manga import Manga | ||
|
||
|
||
class PeopleWorks(BaseModel): | ||
"""Represents works entity of person.""" | ||
anime: Optional[Anime] | ||
manga: Optional[Manga] | ||
role: str |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.