Skip to main content

A python client for TVDB rest API

Project description

Code style: black

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. The simplest solution would be the following:

class C(dict):
    def set(self, key, value):
        self[key] = value

cache = C()

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.

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.2.0.tar.gz (3.7 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.2.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tvdb_api_client-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.15 CPython/3.7.3 Linux/5.1.3-arch1-1-ARCH

File hashes

Hashes for tvdb_api_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8affaea118a07bed3a425199dadef814a77a5572a7e0ca64acb91a0bea7b9aab
MD5 859be9c25aaaa0dfaaec5b879637441e
BLAKE2b-256 e87c805bca397c53c97234e35abbf351ec400efe4cd2b825ff715423c6f16f27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tvdb_api_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.15 CPython/3.7.3 Linux/5.1.3-arch1-1-ARCH

File hashes

Hashes for tvdb_api_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1abc9b4781c9e26ea8092ae809e4730cf8489c9b2b943ae9fb5989f8ad0b9a
MD5 7ec6dd296775a480bec036ce25e9bc8a
BLAKE2b-256 3df47586f6099e0eb0cba0b5f9fd6c1afdc4df91523974ecb922fa04c4eef4fb

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