API

thetvdb_api.api.set_cache(path, period=21600)

Set the cache directory.

Parameters:
  • path (str) – path to the cache directory
  • period (int) – the period (in seconds) during which the cache is hold
Raises:

thetvdb_api.theTVDBError if unable to create the cache directory

thetvdb_api.api.set_series(series_name, api_key, language=None)

Search the series in theTVDB.com database.

Parameters:
  • series_name (str) – the name of the series
  • api_key (str) – the api key
  • language (str or None) – a language accepted by theTVDB.com (see Available languages) or None
Returns:

a thetvdb_api.theTVDB object to pass as argument to the other api functions

Return type:

thetvdb_api.theTVDB object

Raises:

thetvdb_api.theTVDBError if something went wrong

thetvdb_api.api.set_language(series, language)

Set the language to use.

Parameters:
  • series (thetvdb_api.theTVDB object) – the series created with set_series()
  • language (str) – a language accepted by theTVDB.com (see Available languages)
thetvdb_api.api.get_series(series)

Get the series informations.

Parameters:series – the series created with set_series()
Returns:a dictionary of all the series informations provided by theTVDB.com.
Return type:dict
Raises:thetvdb_api.theTVDBError if something went wrong

For more details about the output of the function, see Series.

thetvdb_api.api.get_episode(series, episode_season, episode_number, language=None)

Get an episode informations.

Parameters:
  • series – the series created with set_series()
  • episode_season (int or str) – the number of the season
  • episode_number (int or str) – the number of the episode in the season
  • language (str or None) – a language accepted by theTVDB.com (see Available languages)
Returns:

a dictionary of all the episode informations provided by theTVDB.com.

Return type:

dict

Raises:

thetvdb_api.theTVDBError if something went wrong

For more details about the output of the function, see Episode.

thetvdb_api.api.get_banners(series)

Get all the banners of the series.

Parameters:series – the series created with set_series()
Returns:a dictionary of all the banners of the series provided by theTVDB.com.
Return type:dict
Raises:thetvdb_api.theTVDBError if something went wrong

For more details about the output of the function, see Banners.

thetvdb_api.api.get_actors(series)

Get all the actors of the series.

Parameters:series – the series created with set_series()
Returns:a dictionary of all the actors of the series provided by theTVDB.com.
Return type:dict
Raises:thetvdb_api.theTVDBError if something went wrong

For more details about the output of the function, see Actors.