An Python wrapper for TMDb API
Project description
ezapi-tmdb
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
- All endpoints are mapped to functions in a
TMDb
object - 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
-
Icon from www.themoviedb.org
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(11.8 kB
view details)
Built Distribution
File details
Details for the file ezapi_tmdb-0.6.0.tar.gz
.
File metadata
- Download URL: ezapi_tmdb-0.6.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19829913e6fac9bbf490900d431d4f193044855aad5a9164cd0981245c03c326 |
|
MD5 | 732517f84c87e3da8c45e2ed5f73f601 |
|
BLAKE2b-256 | 2f8aa76e22a4a1b15bfa99c8c6a8b66b22b08025dbad24881f7d1fa9fc3290e3 |
File details
Details for the file ezapi_tmdb-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: ezapi_tmdb-0.6.0-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f19b016577cafa5f910faadc0933cd094b8d1236ec35343c05dc21c72e579e |
|
MD5 | c56f6eaaa982402040f4f1663df054e8 |
|
BLAKE2b-256 | da8b1f07898cb8449ab28673437e367def155b4840045e9853a8124c5372cdf0 |