Skip to main content

Python async API wrapper for AniLibria Swagger

Project description

Anilibria-Api-Client

pypi version licence python

[!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:

Generated artifacts are split from the hand-written client:

  • anilibria_api_client/types/schema/anilibria-v1.openapi.json - locally cached OpenAPI schema
  • anilibria_api_client/types/codegen/openapi_models.py - generated Pydantic v2 models and enums
  • anilibria_api_client/types/codegen/methods/ - generated low-level methods split by category
  • anilibria_api_client/types/models.py - public input/request models
  • anilibria_api_client/types/responses.py - public response models
  • anilibria_api_client/types/__init__.py - public enums

Compatibility shims remain at:

  • anilibria_api_client/models.py
  • anilibria_api_client/responses.py
  • anilibria_api_client/response_models.py

Do not edit these files manually:

  • anilibria_api_client/types/codegen/**
  • anilibria_api_client/types/models.py
  • anilibria_api_client/types/responses.py
  • anilibria_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 category
  • anilibria_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.json
  • anilibria_api_client/types/codegen/
  • anilibria_api_client/types/models.py
  • anilibria_api_client/types/responses.py
  • anilibria_api_client/types/__init__.py
  • anilibria_api_client/models.py
  • anilibria_api_client/responses.py
  • anilibria_api_client/response_models.py

CI

The repository includes a dedicated workflow:

  • on pull_request and push to main, 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 📃

Docs

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anilibria_api_client-0.2.3.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anilibria_api_client-0.2.3-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

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

Hashes for anilibria_api_client-0.2.3.tar.gz
Algorithm Hash digest
SHA256 cc11640c2a417514dac0cb9ffd4accf9876890db3075ec9f6e247bfd0efcca4d
MD5 9fa25afafa1e3f1a84e1d18f3dab84b8
BLAKE2b-256 21f7e616cfd3f8689fa5bf8e24027edc17cefd2c9da23fde1d8bc1815a0598a7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anilibria_api_client-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for anilibria_api_client-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d42fa644e28c0050fc4fd3c12a86d272105ccb2fd33d90fca43a92bd01aa611
MD5 a9669f4fe28b5258b35169aaba82b2cb
BLAKE2b-256 3ffc6da0ef70fa8763104ef1e40b214583bd9389f46578f051ced079d77becf2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page