Skip to main content

anilibria-api-types

RU | EN

pypi license Python

Typed Pydantic-style stubs for the AniLibria API — method, enum, response, and error classes generated from the OpenAPI schema. The committed files under anilibria_api_types/codegen/ are the deliverable, so running codegen and committing the diff is the work.

Setup

  • Python >=3.13 (via Poetry).
  • .env with MAIN_FOLDER_NAME (see .env.example); anilibria_api_types/config.py reads it and fails without it.

Run codegen

python -m anilibria_api_types.scripts.generate_methods
python -m anilibria_api_types.scripts.generate_enums
python -m anilibria_api_types.scripts.generate_errors
python -m anilibria_api_types.scripts.generate_responses

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.

Run the whole pipeline (downloads the schema, then all four generators — requires network):

python -m anilibria_api_types.main

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.

How it works

  • Each generator is an independent entrypoint in anilibria_api_types/scripts/.
  • Type mapping is centralized in anilibria_api_types/utils/type_map.py:get_type_map.
  • Enum classes are named from the dotted schema path (e.g. enums.anime.releases.release.ageRating → AnimeReleasesReleaseAgeRating), grouped per category.
  • Response models share a single file, anilibria_api_types/codegen/responses/models.py, because the schema's data graph has cycles.
  • Generated method classes import a handwritten BaseMethod from anilibria_api_types.methods.base_method.

CI

  • .github/workflows/codegen-refresh.yml (weekly): regenerates codegen and opens a PR if the committed files change.
  • .github/workflows/python-publish.yml (release): builds and publishes to PyPI.

License

Licensed under The Unlicense.

Release files for anilibria-api-types 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anilibria-api-types 1.0.0
File Size Uploaded
anilibria_api_types-1.0.0.tar.gz 27.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anilibria-api-types 1.0.0
File Interpreter ABI Platform
anilibria_api_types-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.7 kB

Release files / anilibria_api_types-1.0.0.tar.gz

Download URL anilibria_api_types-1.0.0.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
abaf491e971c6133565273f86dedc7788c5c4b0e5bf0b66c5853dd1f5f7d8b7b
BLAKE2b-256 checksum
How to use checksums
d8b7e486585748008e8d01b95dda1cf5e210d1408a9ba07dc6e31b6a887d0fcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / anilibria_api_types-1.0.0-py3-none-any.whl

Download URL anilibria_api_types-1.0.0-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
519bb8ecd04f8377871f6b688eb8d7107f2d724b59b6ea15b16a8660a39e4a5c
BLAKE2b-256 checksum
How to use checksums
c79dc3c51e35ae392848f955d43b020ecbe66bffdeb6b4cb86ab8948a82da41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page