Skip to main content

aTMDb

PyPI Version Travis Build Status Code Coverage Code Issues ISC License

Asynchronous API wrapper for TMDb.

Compatibility

aTMDb uses asyncio with the async and await syntax, so is only compatible with Python versions 3.5 and above.

Installation

atmdb can be installed from PyPI using pip:

pip install atmdb

Testing

You can run the tests with python setup.py test. To include the integration suite, ensure that the environment variable TMDB_API_TOKEN is set to a valid API token, and use --runslow if running py.test directly.

Usage

Client

The core TMDbClient must be instantiated with a valid API token (see the API FAQ for more information), either directly:

from atmdb import TMDbClient

client = TMDbClient(api_token='<insert your token here>')

or as the TMDB_API_TOKEN environment variable:

client = TMDbClient.from_env()

You can then access the API by calling asynchronous helper methods on the client instance:

movie = await client.get_movie(550)
assert movie.title == 'Fight Club'

Any API endpoints not currently exposed via the helper methods can be accessed by using the url_builder and get_data methods directly, for example:

url = client.url_builder('company/{company_id}', dict(company_id=508))
                       # ^ endpoint            # ^ parameters to insert
company = await client.get_data(url)
assert company.get('name') == 'Regency Enterprises'

Note that, if you aren’t using a helper method, the result is just a vanilla dictionary.

Utilities

aTMDb also exposes utilities for working with the API and models at a higher level of abstraction, for example:

from aTMDb import TMDbClient
from aTMDb.utils import find_overlapping_actors

actors = await find_overlapping_actors(
    ['monty python holy grail', 'meaning of life'],
    TMDbClient(api_token='<insert your token here>'),
)
assert any(person.name == 'Eric Idle' for person in overlap)

Documentation

Additional documentation is available on PythonHosted.

Metadata

Release files for atmdb 0.2.3

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

Source distribution (sdist)

Source distribution for atmdb 0.2.3
File Size Uploaded Provenance
atmdb-0.2.3.tar.gz 9.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for atmdb 0.2.3
File Interpreter ABI Platform
atmdb-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / atmdb-0.2.3.tar.gz

Download URL atmdb-0.2.3.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3eb0dfd11728ca1def73089ba342c81d3166ecc0a48088892a5a9729cac5f1d3
BLAKE2b-256 checksum
How to use checksums
2dd0d54ab7b7b59201ddf7b852bbef33b8e9e8e14bc53ce1b7c3d86be28f4a12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / atmdb-0.2.3-py3-none-any.whl

Download URL atmdb-0.2.3-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07e45aa455d1888e3c336b1d247f327436c5b6f8e9aacc1d94e96beb57eeab14
BLAKE2b-256 checksum
How to use checksums
37440663c38f8dbc13211eb36836f234d9c5116ae8c63bd9101280f5a6d88c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for atmdb 0.2.3

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.

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