Python async API wrapper for AniLibria Swagger
Project description
Anilibria-Api-Client
[!CAUTION]
It is not an official wrapper. Official AniLibria's Swagger
Anilibria-API-Client - this a async client to work with Anilibria API, use a aiohttp. Full writed at python
Installing
Developed and tested with Python 3.13. While it may work with other versions (oldest and newest), they are not officially supported.
pip
$ pip install anilibria-api-client
Usage
from anilibria_api_client.api_client import AsyncAnilibriaAPI # Client
from anilibria_api_client.exceptions import AnilibriaException, AnilibriaValidationException # Errors
from anilibria_api_client.types import * # Types for some methods
from anilibria_api_client.models import * # Input models for some methods
from anilibria_api_client.responses import * # Response models generated from OpenAPI
from anilibria_api_client.helper import * # Download anime, save torrents files and more
async def main():
async with AsyncAnilibriaAPI() as api:
await api.teams.users(include="nickname")
api = AsyncAnilibriaAPI() # like js support
await api.teams.users(include="nickname")
OpenAPI generation
AniLiberty schema source:
- docs: https://anilibria.top/api/docs/v1#/
- schema: https://anilibria.top/storage/api/docs/v1?aniliberty-api-v1-docs.json
Generated artifacts are split from the hand-written client:
anilibria_api_client/types/schema/anilibria-v1.openapi.json- locally cached OpenAPI schemaanilibria_api_client/types/codegen/openapi_models.py- generated Pydantic v2 models and enumsanilibria_api_client/types/codegen/methods/- generated low-level methods split by categoryanilibria_api_client/types/models.py- public input/request modelsanilibria_api_client/types/responses.py- public response modelsanilibria_api_client/types/__init__.py- public enums
Compatibility shims remain at:
anilibria_api_client/models.pyanilibria_api_client/responses.pyanilibria_api_client/response_models.py
Do not edit these files manually:
anilibria_api_client/types/codegen/**anilibria_api_client/types/models.pyanilibria_api_client/types/responses.pyanilibria_api_client/types/__init__.py
The async client now uses a two-layer method scheme:
anilibria_api_client/types/codegen/methods/*.py- generated low-level endpoint methods grouped by categoryanilibria_api_client/methods/*.py- manual compatibility/override layer on top of generated methods
Local update
Single command to refresh schema and generated files:
python scripts/update_openapi_models.py
Individual steps:
python scripts/fetch_openapi.py
python scripts/generate_models.py
Drift check
To verify that schema-backed artifacts are up to date:
python scripts/check_schema_drift.py
The check regenerates the schema-backed files and fails if git status shows changes in:
anilibria_api_client/types/schema/anilibria-v1.openapi.jsonanilibria_api_client/types/codegen/anilibria_api_client/types/models.pyanilibria_api_client/types/responses.pyanilibria_api_client/types/__init__.pyanilibria_api_client/models.pyanilibria_api_client/responses.pyanilibria_api_client/response_models.py
CI
The repository includes a dedicated workflow:
- on
pull_requestandpushtomain, it runs the drift check and smoke tests - on weekly schedule and manual dispatch, it refreshes the schema and generated files, runs smoke tests, and opens a PR when a diff is detected
Documentation 📃
Issues/Contributing
Issues
Report for any issues here
Contributing
We allow contributing! Read the CODE_OF_CONDUCT.md
License 📄
Anilibria-Api-Client is MIT licenced.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anilibria_api_client-0.2.3.tar.gz.
File metadata
- Download URL: anilibria_api_client-0.2.3.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc11640c2a417514dac0cb9ffd4accf9876890db3075ec9f6e247bfd0efcca4d
|
|
| MD5 |
9fa25afafa1e3f1a84e1d18f3dab84b8
|
|
| BLAKE2b-256 |
21f7e616cfd3f8689fa5bf8e24027edc17cefd2c9da23fde1d8bc1815a0598a7
|
Provenance
The following attestation bundles were made for anilibria_api_client-0.2.3.tar.gz:
Publisher:
python-publish.yml on whynotix/Anilibria-Api-Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anilibria_api_client-0.2.3.tar.gz -
Subject digest:
cc11640c2a417514dac0cb9ffd4accf9876890db3075ec9f6e247bfd0efcca4d - Sigstore transparency entry: 1350193883
- Sigstore integration time:
-
Permalink:
whynotix/Anilibria-Api-Client@0adaa5a2f083fcd8a95aac4ac651b5722b0d98c5 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/whynotix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0adaa5a2f083fcd8a95aac4ac651b5722b0d98c5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file anilibria_api_client-0.2.3-py3-none-any.whl.
File metadata
- Download URL: anilibria_api_client-0.2.3-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d42fa644e28c0050fc4fd3c12a86d272105ccb2fd33d90fca43a92bd01aa611
|
|
| MD5 |
a9669f4fe28b5258b35169aaba82b2cb
|
|
| BLAKE2b-256 |
3ffc6da0ef70fa8763104ef1e40b214583bd9389f46578f051ced079d77becf2
|
Provenance
The following attestation bundles were made for anilibria_api_client-0.2.3-py3-none-any.whl:
Publisher:
python-publish.yml on whynotix/Anilibria-Api-Client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anilibria_api_client-0.2.3-py3-none-any.whl -
Subject digest:
5d42fa644e28c0050fc4fd3c12a86d272105ccb2fd33d90fca43a92bd01aa611 - Sigstore transparency entry: 1350193994
- Sigstore integration time:
-
Permalink:
whynotix/Anilibria-Api-Client@0adaa5a2f083fcd8a95aac4ac651b5722b0d98c5 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/whynotix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0adaa5a2f083fcd8a95aac4ac651b5722b0d98c5 -
Trigger Event:
release
-
Statement type: