Skip to main content

A(Sync) Interface for internal Audible API written in pure Python.

Project description

Audible

image image image image image Travis CodeFactor image

Audible is a Python low-level interface to communicate with the non-publicly Audible API.

It enables Python developers to create their own Audible services. Asynchronous communication with the Audible API is supported.

For a basic command line interface take a look at my audible-cli package. This package supports:

  • downloading audiobooks (aax/aaxc), cover, PDF and chapter files
  • export library to csv files
  • get activation bytes
  • add own plugin commands

Requirements

Python >= 3.11

Installation

Standard Installation

pip install audible

Recommended: With Performance Optimizations

Available in audible >= 0.11.0

For significantly better performance (5-100x faster cryptographic operations), install with optional high-performance crypto backends.

Option 1: cryptography (recommended)

Modern, actively maintained, Rust-accelerated library:

pip install audible[cryptography]

Option 2: pycryptodome

Mature, C-based cryptographic library:

pip install audible[pycryptodome]

Option 3: Both (best for development/testing)

pip install audible[cryptography,pycryptodome]

Using uv:

# With cryptography
uv pip install audible[cryptography]

# With pycryptodome
uv pip install audible[pycryptodome]

# With both
uv pip install audible[cryptography,pycryptodome]

# Or run with extras (in project context)
uv run --extra cryptography your_script.py

The library automatically selects the best available provider:

  1. cryptography (preferred, Rust-accelerated)
  2. pycryptodome (C-based)
  3. legacy (pure Python fallback)

Performance improvements with optimized backends:

  • 5-10x faster AES encryption/decryption
  • 10-20x faster RSA operations
  • 3-5x faster key derivation (PBKDF2)
  • 5-10x faster hashing (SHA-256, SHA-1)

Provider Overrides (advanced)

Most applications do not need to interact with the crypto layer directly. Prefer configuring providers through high-level APIs such as Authenticator:

from audible import Authenticator
from audible.crypto_provider import CryptographyProvider, set_default_crypto_provider

# Force a specific provider for this authenticator instance
auth = Authenticator.from_file(
    "auth.json",
    password="secret",
    crypto_provider=CryptographyProvider,
)

# Optional: set a process-wide default provider, then reset to auto-detect
set_default_crypto_provider(CryptographyProvider)
...
set_default_crypto_provider()

get_crypto_providers() remains available for internal use, but it is not part of the supported public API.

Optional: High-Performance JSON Backends

Available in audible >= 0.11.0

For improved JSON serialization/deserialization performance (2-5x faster), install with optional high-performance JSON backends.

Option 1: json-full (recommended)

Complete coverage with best performance for all use cases:

pip install audible[json-full]

Includes:

  • orjson: 4-5x faster for compact JSON (API responses, metadata)
  • ujson: 2-3x faster with indent=4 support (auth files, library exports)

Option 2: json-fast

Optimized for compact JSON only:

pip install audible[json-fast]

Includes:

  • orjson: 4-5x faster for compact JSON

Option 3: Individual providers

# orjson (Rust-based, fastest for compact JSON)
pip install audible[orjson]

# ujson (C-based, excellent for pretty-printed output)
pip install audible[ujson]

# rapidjson (C++ based, alternative to ujson)
pip install audible[rapidjson]

Using uv:

# json-full (recommended)
uv pip install audible[json-full]

# json-fast
uv pip install audible[json-fast]

# Or run with extras (in project context)
uv run --extra json-full your_script.py

The library automatically selects the best available provider:

  1. orjson (Rust-based, 4-5x faster for compact JSON)
  2. ujson (C-based, 2-3x faster with indent support)
  3. rapidjson (C++ based, 2-3x faster)
  4. stdlib json (always available)

Performance improvements with optimized backends:

  • 4-5x faster compact JSON (orjson)
  • 2-3x faster pretty-printed JSON (ujson/rapidjson)
  • Smart fallback: orjson automatically uses ujson/rapidjson for indent=4

Provider Overrides (advanced)

Most applications do not need to interact with the JSON layer directly. The library automatically uses the best provider. However, you can override:

from audible.json_provider import OrjsonProvider, get_json_provider, set_default_json_provider

# Get auto-detected provider
provider = get_json_provider()
print(f"Using: {provider.provider_name}")

# Force a specific provider
data = {"key": "value"}
orjson = get_json_provider(OrjsonProvider)
json_str = orjson.dumps(data)

# Optional: set a process-wide default provider
set_default_json_provider(OrjsonProvider)

Read the Doc

The documentation can be found at Read the Docs

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the AGPL-3.0, Audible is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

Thanks a lot JetBrains for supporting me with a free license This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

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

audible-0.11.0.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

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

audible-0.11.0-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file audible-0.11.0.tar.gz.

File metadata

  • Download URL: audible-0.11.0.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for audible-0.11.0.tar.gz
Algorithm Hash digest
SHA256 0be158985c8c395ce9165e68ee85ade5907a4a98c947a9aae59faea50b7dc0a7
MD5 3638e60d4eabf3ac59916c77d9ca4851
BLAKE2b-256 03fbfab627ff8f73702aaa93904be0980bfbe3fcbe6bb0da21bac1f88a02beeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for audible-0.11.0.tar.gz:

Publisher: release.yml on mkb79/Audible

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

File details

Details for the file audible-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: audible-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 77.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for audible-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41e7b358122a2668948d09cdbfef809dd814a68d45c5b6aef2aad44f3ab559e4
MD5 11f8b22b904cb4bec14ace072e6e2878
BLAKE2b-256 d976091dd484c9a91ad2bbb7e93c38d0210c17682d9af63a9fd20f68f8dd2b9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for audible-0.11.0-py3-none-any.whl:

Publisher: release.yml on mkb79/Audible

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