anibridge-library-base
anibridge-library-base provides base classes and utilities to implement and register media library providers for the AniBridge project.
Installation
pip install anibridge-library-base
# pip install git+https://github.com/anibridge/anibridge-library-base.git
API reference
The package exposes its public API from anibridge.library and the core definitions in anibridge.library.base.
To get more context, read the anibridge.library.base module docstrings.
-
LibraryProvider(base class)- Key methods and hooks:
__init__(*, logger: ProviderLogger, config: dict | None = None) -> None: Construct a provider with an injected logger and optional configuration.async initialize() -> None: Optional async initialization hook for I/O or authentication.async clear_cache() -> None: Clear any provider caches to free memory or refresh data.async close() -> None: Close the provider and release resources.async get_sections() -> Sequence[LibrarySection[LibraryProviderT]]: Return available library sections for the provider.async list_items(section: LibrarySection[LibraryProviderT], *, min_last_modified: datetime | None = None, require_watched: bool = False, keys: Sequence[str] | None = None) -> Sequence[LibraryEntry[LibraryProviderT]]: List entries within a section with optional filtering.async parse_webhook(request: litestar.connection.request.Request) -> tuple[bool, Sequence[str]]: Parse an incoming webhook and return whether it applies plus affected item keys.user() -> LibraryUser | None: Return the associated user object, if any.
- Key methods and hooks:
-
LibraryEntry(per-item user state)- Key methods and properties:
async history() -> Sequence[HistoryEntry]: Return user history events for the item (tz-aware timestamps).mapping_descriptors() -> Sequence[MappingDescriptor]: Return mapping descriptors for AniBridge matching.media() -> LibraryMedia[LibraryProviderT]: Return the associatedLibraryMediaobject.on_watching -> bool: Whether the item is currently being watched.on_watchlist -> bool: Whether the item is on the user's watchlist.review -> str | None: Optional user review text.section() -> LibrarySection[LibraryProviderT]: Return the parent library section for the item.user_rating -> int | None: Optional user rating on a 0-100 scale.view_count -> int: Total view count for the item (including children).
- Key methods and properties:
-
LibraryMedia(media metadata)- Key properties:
external_url -> str | None: URL to the provider's media item, if available.poster_image -> str | None: Poster or cover image URL, if available.
- Key properties:
-
LibraryShow,LibrarySeason,LibraryEpisode,LibraryMovieLibraryShowexposesepisodes()andseasons().LibrarySeasonexposesindex,episodes(), andshow().LibraryEpisodeexposesindex,season_index,season(), andshow().
-
HistoryEntrylibrary_key: str,viewed_at: datetimerecord a timezone-aware view event for an item.
-
MediaKind(StrEnum)- High-level media kinds:
MOVIE,SHOW,SEASON,EPISODE.
- High-level media kinds:
Examples
You can view the following built-in provider implementations as examples of how to implement the base classes:
Metadata
Release files for anibridge-library-base 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| anibridge_library_base-0.2.2.tar.gz | 6.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anibridge_library_base-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.8 kB
Release files / anibridge_library_base-0.2.2.tar.gz
| Download URL | anibridge_library_base-0.2.2.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e68edb1924daff0a8d2d624b2fe694b7b9351a09873d6b9ca5309a132a5ef291
|
|
BLAKE2b-256 checksum How to use checksums |
fc66839923a6490bc151e399ca779546c8646a080426e416c6eac161091a007a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / anibridge_library_base-0.2.2-py3-none-any.whl
| Download URL | anibridge_library_base-0.2.2-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f2d237211b97b66c58c096cfaa6013c8258b063390d1cc7b8798c87c686acf3
|
|
BLAKE2b-256 checksum How to use checksums |
d85054b4d3163d2b46747fee64847596d7172610889256ec1b7e8824c19c0b0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for anibridge-library-base 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.