Skip to main content

A python client for TVDB rest API

Project description

Build Coverage License PyPI Downloads Code style

A python client for the API exposed by the TVDB. API keys should be acquired from the TVDB site prior to using this client.

Installation

tvdb_api_client can be installed by running pip install tvdb_api_client. It requires Python 3.6+.

Usage

Initialise the client (example using the django cache):

from django.core.cache import cache
from tvdb_api_client import TVDBClient

client = TVDBClient("username", "user_key", "api_key", cache)

The cache can be any object from a class that implements the get and set methods. For convenience, you can pass only the other arguments, and a simple object that has them will be initialised.

from tvdb_api_client import TVDBClient

client = TVDBClient("username", "user_key", "api_key")

It is advisable to use a cache that will persist during a server restart, so that the token will not have to be regenerated. Please be advised that the token will be stored in the cache in plaintext, so if there are any security considerations they should be taken care into account when choosing the cache.

Once the client has been initialised, you can use it to get the following info (and the respective methods):

  • Method to get TV series by TVDB id - get_series_by_id(tvdb_id)
  • Method to get TV series by IMDb id - get_series_by_imdb_id(imdb_id)
  • Method to find identifying info for a TV series by its name - find_series_by_name(series_name)
  • Method to get episodes by TV series using its TVDB id - get_episodes_by_series(tvdb_id)

Note: the TVDB id can be an integer of a string in any method that it's required. Also, all of these methods will used the cached value if present. To get new data, you may pass refresh_cache=True to all of them.

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

tvdb_api_client-0.4.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

tvdb_api_client-0.4.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file tvdb_api_client-0.4.1.tar.gz.

File metadata

  • Download URL: tvdb_api_client-0.4.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.8.12-arch1-1

File hashes

Hashes for tvdb_api_client-0.4.1.tar.gz
Algorithm Hash digest
SHA256 04356d5fd0ee14212b8afa88c7df421242c6f0e87c591d29b6499f04ae70cc42
MD5 d17262368ff1bf8139da43c9b26178d2
BLAKE2b-256 1a8b0bde8d4b75b512f02c9c24121d2904155ce12f18cdfa2f95e5685d093bd0

See more details on using hashes here.

File details

Details for the file tvdb_api_client-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: tvdb_api_client-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.8.12-arch1-1

File hashes

Hashes for tvdb_api_client-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8a19411e58e96d914fc5e9065eaa39d123193e107015ac887fb9afbc7811e15
MD5 1810d11d74598d739813fecfb1c1b4da
BLAKE2b-256 0da0f103829ce92823d85a040669cd4bf5c5c85d280f07bfa0e3cc12a2db790e

See more details on using hashes here.

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