anilibria-api-types 1.0.0rc1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anilibria_api_types-1.0.0rc1/LICENSE +24 -0
- anilibria_api_types-1.0.0rc1/PKG-INFO +68 -0
- anilibria_api_types-1.0.0rc1/README.md +49 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/enums/accounts.py +28 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/enums/ads.py +16 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/enums/anime.py +106 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/enums/media.py +6 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/errors/validation.py +7 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/methods/accounts.py +396 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/methods/anime.py +533 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/methods/app.py +34 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/methods/media.py +56 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/methods/teams.py +51 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/codegen/responses/models.py +708 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/config.py +13 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/enums/__init__.py +4 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/errors/__init__.py +1 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/main.py +22 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/methods/__init__.py +15 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/methods/base_method.py +10 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/responses/__init__.py +1 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/scripts/generate_enums.py +82 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/scripts/generate_errors.py +64 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/scripts/generate_methods.py +380 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/scripts/generate_responses.py +339 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/utils/__init__.py +6 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/utils/type_map.py +247 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/validate_schema/__init__.py +7 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/validate_schema/download_schema.py +18 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types/validate_schema/get_schema.py +17 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types.egg-info/PKG-INFO +68 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types.egg-info/SOURCES.txt +35 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types.egg-info/dependency_links.txt +1 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types.egg-info/requires.txt +7 -0
- anilibria_api_types-1.0.0rc1/anilibria_api_types.egg-info/top_level.txt +1 -0
- anilibria_api_types-1.0.0rc1/pyproject.toml +104 -0
- anilibria_api_types-1.0.0rc1/setup.cfg +4 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: anilibria-api-types
|
|
3
|
+
Version: 1.0.0rc1
|
|
4
|
+
Author-email: whynotix <semenbolotov414@gmail.com>
|
|
5
|
+
License: The Unlicense
|
|
6
|
+
Project-URL: Homepage, https://github.com/whynotix/anilibria-api-types
|
|
7
|
+
Project-URL: Issues, https://github.com/whynotix/anilibria-api-types/issues
|
|
8
|
+
Requires-Python: <4.0.0,>=3.13
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: aiohttp<4.0.0,>=3.14.3
|
|
12
|
+
Requires-Dist: aiofiles<26.0.0,>=24.1.0
|
|
13
|
+
Requires-Dist: jsonref<2.0.0,>=1.1.0
|
|
14
|
+
Requires-Dist: pydantic<3.0.0,>=2.13.3
|
|
15
|
+
Requires-Dist: python-dotenv<2.0.0,>=1.2.3
|
|
16
|
+
Requires-Dist: pydantic-settings<3.0.0,>=2.15.0
|
|
17
|
+
Requires-Dist: anilibria-api-client>=1.0.0rc1
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# anilibria-api-types
|
|
21
|
+
|
|
22
|
+
[RU](https://github.com/whynotix/anilibria-api-types/tree/main/.github/README.ru_RU.md) | EN
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/anilibria-api-types/) [](https://github.com/whynotix/anilibria-api-types/blob/main/LICENSE) [](https://pypi.org/project/anilibria-api-types/)
|
|
26
|
+
|
|
27
|
+
Typed Pydantic-style stubs for the **AniLibria API** — method, enum, response, and error classes generated from the [OpenAPI schema](https://aniliberty.top/storage/api/docs/v1?aniliberty-api-v1-docs.json). The committed files under `anilibria_api_types/codegen/` are the deliverable, so running codegen and committing the diff is the work.
|
|
28
|
+
|
|
29
|
+
## Setup
|
|
30
|
+
|
|
31
|
+
- Python `>=3.13` (via [Poetry](https://python-poetry.org/)).
|
|
32
|
+
- `.env` with `MAIN_FOLDER_NAME` (see `.env.example`); `anilibria_api_types/config.py` reads it and fails without it.
|
|
33
|
+
|
|
34
|
+
## Run codegen
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python -m anilibria_api_types.scripts.generate_methods
|
|
38
|
+
python -m anilibria_api_types.scripts.generate_enums
|
|
39
|
+
python -m anilibria_api_types.scripts.generate_errors
|
|
40
|
+
python -m anilibria_api_types.scripts.generate_responses
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
On Windows with the Poetry venv, prefix with `.venv\Scripts\python.exe`. The package is a PEP 420 namespace package, so run with `-m` from the repo root.
|
|
44
|
+
|
|
45
|
+
Run the whole pipeline (downloads the schema, then all four generators — requires network):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python -m anilibria_api_types.main
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Each generator writes to `anilibria_api_types/codegen/{methods,enums,errors,responses}/`. The schema is cached at `anilibria_api_types/temp/schema.json` (gitignored); re-download it via `validate_schema/download_schema.py`.
|
|
52
|
+
|
|
53
|
+
## How it works
|
|
54
|
+
|
|
55
|
+
- Each generator is an independent entrypoint in `anilibria_api_types/scripts/`.
|
|
56
|
+
- Type mapping is centralized in `anilibria_api_types/utils/type_map.py:get_type_map`.
|
|
57
|
+
- Enum classes are named from the dotted schema path (e.g. `enums.anime.releases.release.ageRating` → `AnimeReleasesReleaseAgeRating`), grouped per category.
|
|
58
|
+
- Response models share a single file, `anilibria_api_types/codegen/responses/models.py`, because the schema's data graph has cycles.
|
|
59
|
+
- Generated method classes import a handwritten `BaseMethod` from `anilibria_api_types.methods.base_method`.
|
|
60
|
+
|
|
61
|
+
## CI
|
|
62
|
+
|
|
63
|
+
- `.github/workflows/codegen-refresh.yml` (weekly): regenerates codegen and opens a PR if the committed files change.
|
|
64
|
+
- `.github/workflows/python-publish.yml` (release): builds and publishes to PyPI.
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
Licensed under [The Unlicense](https://unlicense.org/).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# anilibria-api-types
|
|
2
|
+
|
|
3
|
+
[RU](https://github.com/whynotix/anilibria-api-types/tree/main/.github/README.ru_RU.md) | EN
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/anilibria-api-types/) [](https://github.com/whynotix/anilibria-api-types/blob/main/LICENSE) [](https://pypi.org/project/anilibria-api-types/)
|
|
7
|
+
|
|
8
|
+
Typed Pydantic-style stubs for the **AniLibria API** — method, enum, response, and error classes generated from the [OpenAPI schema](https://aniliberty.top/storage/api/docs/v1?aniliberty-api-v1-docs.json). The committed files under `anilibria_api_types/codegen/` are the deliverable, so running codegen and committing the diff is the work.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
- Python `>=3.13` (via [Poetry](https://python-poetry.org/)).
|
|
13
|
+
- `.env` with `MAIN_FOLDER_NAME` (see `.env.example`); `anilibria_api_types/config.py` reads it and fails without it.
|
|
14
|
+
|
|
15
|
+
## Run codegen
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m anilibria_api_types.scripts.generate_methods
|
|
19
|
+
python -m anilibria_api_types.scripts.generate_enums
|
|
20
|
+
python -m anilibria_api_types.scripts.generate_errors
|
|
21
|
+
python -m anilibria_api_types.scripts.generate_responses
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
On Windows with the Poetry venv, prefix with `.venv\Scripts\python.exe`. The package is a PEP 420 namespace package, so run with `-m` from the repo root.
|
|
25
|
+
|
|
26
|
+
Run the whole pipeline (downloads the schema, then all four generators — requires network):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python -m anilibria_api_types.main
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Each generator writes to `anilibria_api_types/codegen/{methods,enums,errors,responses}/`. The schema is cached at `anilibria_api_types/temp/schema.json` (gitignored); re-download it via `validate_schema/download_schema.py`.
|
|
33
|
+
|
|
34
|
+
## How it works
|
|
35
|
+
|
|
36
|
+
- Each generator is an independent entrypoint in `anilibria_api_types/scripts/`.
|
|
37
|
+
- Type mapping is centralized in `anilibria_api_types/utils/type_map.py:get_type_map`.
|
|
38
|
+
- Enum classes are named from the dotted schema path (e.g. `enums.anime.releases.release.ageRating` → `AnimeReleasesReleaseAgeRating`), grouped per category.
|
|
39
|
+
- Response models share a single file, `anilibria_api_types/codegen/responses/models.py`, because the schema's data graph has cycles.
|
|
40
|
+
- Generated method classes import a handwritten `BaseMethod` from `anilibria_api_types.methods.base_method`.
|
|
41
|
+
|
|
42
|
+
## CI
|
|
43
|
+
|
|
44
|
+
- `.github/workflows/codegen-refresh.yml` (weekly): regenerates codegen and opens a PR if the committed files change.
|
|
45
|
+
- `.github/workflows/python-publish.yml` (release): builds and publishes to PyPI.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
Licensed under [The Unlicense](https://unlicense.org/).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Auto-generated for enums in accounts category
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AccountsUsersUserSocialType(str, Enum):
|
|
6
|
+
VK = 'vk'
|
|
7
|
+
GOOGLE = 'google'
|
|
8
|
+
PATREON = 'patreon'
|
|
9
|
+
DISCORD = 'discord'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AccountsUsersUserCollectionType(str, Enum):
|
|
13
|
+
PLANNED = 'PLANNED'
|
|
14
|
+
WATCHED = 'WATCHED'
|
|
15
|
+
WATCHING = 'WATCHING'
|
|
16
|
+
POSTPONED = 'POSTPONED'
|
|
17
|
+
ABANDONED = 'ABANDONED'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AccountsUsersUserFavoriteFilterSorting(str, Enum):
|
|
21
|
+
CREATED_AT_DESC = 'CREATED_AT_DESC'
|
|
22
|
+
CREATED_AT_ASC = 'CREATED_AT_ASC'
|
|
23
|
+
FRESH_AT_DESC = 'FRESH_AT_DESC'
|
|
24
|
+
FRESH_AT_ASC = 'FRESH_AT_ASC'
|
|
25
|
+
RATING_DESC = 'RATING_DESC'
|
|
26
|
+
RATING_ASC = 'RATING_ASC'
|
|
27
|
+
YEAR_DESC = 'YEAR_DESC'
|
|
28
|
+
YEAR_ASC = 'YEAR_ASC'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Auto-generated for enums in ads category
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AdsBannerPlacement(str, Enum):
|
|
6
|
+
HOME_SUPPORT = 'HOME_SUPPORT'
|
|
7
|
+
RELEASE_SIDEBAR = 'RELEASE_SIDEBAR'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AdsStatisticsEventType(str, Enum):
|
|
11
|
+
AD_VAST_SHOW = 'AD_VAST_SHOW'
|
|
12
|
+
AD_VAST_REQUEST = 'AD_VAST_REQUEST'
|
|
13
|
+
AD_BANNER_VIEW = 'AD_BANNER_VIEW'
|
|
14
|
+
AD_BANNER_CLICK = 'AD_BANNER_CLICK'
|
|
15
|
+
MEDIA_PROMOTION_VIEW = 'MEDIA_PROMOTION_VIEW'
|
|
16
|
+
MEDIA_PROMOTION_CLICK = 'MEDIA_PROMOTION_CLICK'
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Auto-generated for enums in anime category
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AnimeCatalogFilterProductionStatus(str, Enum):
|
|
6
|
+
IS_IN_PRODUCTION = 'IS_IN_PRODUCTION'
|
|
7
|
+
IS_NOT_IN_PRODUCTION = 'IS_NOT_IN_PRODUCTION'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AnimeCatalogFilterPublishStatus(str, Enum):
|
|
11
|
+
IS_ONGOING = 'IS_ONGOING'
|
|
12
|
+
IS_NOT_ONGOING = 'IS_NOT_ONGOING'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AnimeCatalogFilterSorting(str, Enum):
|
|
16
|
+
FRESH_AT_DESC = 'FRESH_AT_DESC'
|
|
17
|
+
FRESH_AT_ASC = 'FRESH_AT_ASC'
|
|
18
|
+
RATING_DESC = 'RATING_DESC'
|
|
19
|
+
RATING_ASC = 'RATING_ASC'
|
|
20
|
+
YEAR_DESC = 'YEAR_DESC'
|
|
21
|
+
YEAR_ASC = 'YEAR_ASC'
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AnimeReleasesReleaseAgeRating(str, Enum):
|
|
25
|
+
R0_PLUS = 'R0_PLUS'
|
|
26
|
+
R6_PLUS = 'R6_PLUS'
|
|
27
|
+
R12_PLUS = 'R12_PLUS'
|
|
28
|
+
R16_PLUS = 'R16_PLUS'
|
|
29
|
+
R18_PLUS = 'R18_PLUS'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class AnimeReleasesReleasePublishDay(int, Enum):
|
|
33
|
+
VALUE_1 = 1
|
|
34
|
+
VALUE_2 = 2
|
|
35
|
+
VALUE_3 = 3
|
|
36
|
+
VALUE_4 = 4
|
|
37
|
+
VALUE_5 = 5
|
|
38
|
+
VALUE_6 = 6
|
|
39
|
+
VALUE_7 = 7
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class AnimeReleasesReleaseSeason(str, Enum):
|
|
43
|
+
WINTER = 'winter'
|
|
44
|
+
SPRING = 'spring'
|
|
45
|
+
SUMMER = 'summer'
|
|
46
|
+
AUTUMN = 'autumn'
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class AnimeReleasesReleaseType(str, Enum):
|
|
50
|
+
TV = 'TV'
|
|
51
|
+
ONA = 'ONA'
|
|
52
|
+
WEB = 'WEB'
|
|
53
|
+
OVA = 'OVA'
|
|
54
|
+
OAD = 'OAD'
|
|
55
|
+
MOVIE = 'MOVIE'
|
|
56
|
+
DORAMA = 'DORAMA'
|
|
57
|
+
SPECIAL = 'SPECIAL'
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class AnimeReleasesReleaseMemberRole(str, Enum):
|
|
61
|
+
POSTER = 'poster'
|
|
62
|
+
TIMING = 'timing'
|
|
63
|
+
VOICING = 'voicing'
|
|
64
|
+
EDITING = 'editing'
|
|
65
|
+
DECORATING = 'decorating'
|
|
66
|
+
TRANSLATING = 'translating'
|
|
67
|
+
HEVC = 'hevc'
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class AnimeTorrentsTorrentCodec(str, Enum):
|
|
71
|
+
AV1 = 'AV1'
|
|
72
|
+
X264_AVC = 'x264/AVC'
|
|
73
|
+
X265_HEVC = 'x265/HEVC'
|
|
74
|
+
X265HQ_HEVC_HQ = 'x265hq/HEVC-HQ'
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class AnimeTorrentsTorrentColor(str, Enum):
|
|
78
|
+
_8BIT = '8bit'
|
|
79
|
+
_10BIT = '10Bit'
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class AnimeTorrentsTorrentQuality(str, Enum):
|
|
83
|
+
_360P = '360p'
|
|
84
|
+
_480P = '480p'
|
|
85
|
+
_576P = '576p'
|
|
86
|
+
_720P = '720p'
|
|
87
|
+
_1080P = '1080p'
|
|
88
|
+
_2K = '2k'
|
|
89
|
+
_4K = '4k'
|
|
90
|
+
_8K = '8k'
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class AnimeTorrentsTorrentType(str, Enum):
|
|
94
|
+
BDRIP = 'BDRip'
|
|
95
|
+
HDRIP = 'HDRip'
|
|
96
|
+
TVRIP = 'TVRip'
|
|
97
|
+
WEBRIP = 'WEBRip'
|
|
98
|
+
DTVRIP = 'DTVRip'
|
|
99
|
+
DVDRIP = 'DVDRip'
|
|
100
|
+
HDTVRIP = 'HDTVRip'
|
|
101
|
+
WEB_DL = 'WEB-DL'
|
|
102
|
+
WEB_DLRIP = 'WEB-DLRip'
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class AnimeTorrentsTorrentMemberRole(str, Enum):
|
|
106
|
+
HEVC = 'HEVC'
|