Skip to main content

A Python wrapper for TMDb API

Project description

logo yelp

ezapi-tmdb

pytest Code style: black PyPI - License PyPI - Python Version PyPI Downloads

A Python wrapper for TMDb API, supporting version 3

Install

pip install ezapi-tmdb

Test

git clone git@github.com:zehengl/ezapi-tmdb.git
export api_key="..."
export username="..."
export password="..."
cd ezapi-tmdb
python setup.py test

Use $Env:api_key="..." , $Env:username="...", and $Env:password="..." to set the api key, username, and password environment variables on Windows.

Usage

  1. All endpoints are mapped to functions in a TMDb object
  2. All query string params are used as keyword arguments

See documents for detailed API usage.

from tmdb import TMDb

api_key = "..."

tmdb = TMDb(api_key)

# query string params are used as keyword arguments
print(tmdb.get_popular_movies(region="US"))
print(tmdb.get_tvs_on_the_air(page=10))

# create session_id with username/password login
username = "..."
password = "..."
request_token = tmdb.create_request_token().get("request_token")
tmdb.create_session_with_login(username, password, request_token)
session_id = tmdb.create_session(request_token).get("session_id")

# some endpoints require session_id
print(tmdb.get_account_details(session_id=session_id))

# store global options, language / region for example
tmdb.set_options(language="de", region="de")
tmdb.get_trending("all", "week")

# reset global options
tmdb.reset_options()

# configure image languages globally
tmdb.set_options(include_image_language=["en", "null"])
tmdb.get_movie_images(597)

# url param per request would overwrite global options
tmdb.get_movie_images(597, include_image_language=["de", "fr"])

Credits

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

ezapi_tmdb-0.6.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

ezapi_tmdb-0.6.2-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file ezapi_tmdb-0.6.2.tar.gz.

File metadata

  • Download URL: ezapi_tmdb-0.6.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for ezapi_tmdb-0.6.2.tar.gz
Algorithm Hash digest
SHA256 0293a571ded7cd59ba3af1fefa6adcc50410a96ad43bed475543f97c3b1f2fc3
MD5 58168c4ac451b69c0386671b3212b161
BLAKE2b-256 1d176b183d06715941f6fe4aabed94a302f33e374b681e7fc9ea1391ac4d406a

See more details on using hashes here.

File details

Details for the file ezapi_tmdb-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: ezapi_tmdb-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4

File hashes

Hashes for ezapi_tmdb-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6db98b618484c44f863dc4921feb05b8ce3a8022ea907735bf74ef76cae7fb8c
MD5 585b37a91245c7e39e72ad596b5ec4f8
BLAKE2b-256 d620da4bffe66623332f04c1ca5e84676f3e54762e4eac250a9d320f8e715e78

See more details on using hashes here.

Supported by

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