pytvdbapi Documentation Release 0.4.0

Björn Larsson

November 22, 2013

Contents

i ii pytvdbapi Documentation, Release 0.4.0

Welcome to the documentation for pytvdbapi version 0.4.0

Contents 1 pytvdbapi Documentation, Release 0.4.0

2 Contents Part I

Basics

3

CHAPTER 1

Basics

1.1 Getting Started

1.1.1 About pytvdbapi is created to be an easy to use and intuitive Python API for the TV-Show database thetvdb.com. It is designed with the intention of making it easier and faster to develop applications using data from thetvdb.com, without having to bother about working with the raw data provided.

1.1.2 Installing

The best and recommended way to install pytvdbapi is to use pip. To install, issue the following command in a shell: $ pip install pytvdbapi

Depending on on what system and where you install pytvdbapi you may need root privileges to perform the above command.

1.1.3 Dependencies pytvdbapi depends on the following external packages: • httplib2 If you install using the above description, the dependencies will be installed for you if you do not already have them on your system.

1.1.4 Supported Versions

The following python versions are supported by pytvdbapi. • 2.6 • 2.7 • 3.3

5 pytvdbapi Documentation, Release 0.4.0

It may work on other Python versions but they are not actively supported and tested against.

1.1.5 Known Issues

The following issues/problems with pytvdbapi are known. • No support for connections through proxy servers.

1.2 Python 2.X and 3.X

This section describes differences in using pytvdbapi in a Python 2.X environment and a Python 3.X environment. In particular it describes the differences and changes regarding unicode handling.

1.2.1 Unicode Vs. Str

In python 3, the unicode object has been removed and the standard str type always represent a unicode string 1. Internally pytvdbapi works exclusively with unicode. That means that on Python 2.X all text attributes will be of type unicode and on Python 3 they will be of type str, all text attributes will be automatically converted as they are loaded. >>> from pytvdbapi import api >>> import sys >>> db= api.TVDB(’B43FF87DE395DF56’) >>> result= db.search(’Alarm für cobra 11’,’de’)

>>> show= result[0]

>>> if sys.version<’3’: ... assert type(show.SeriesName) is unicode ... else: ... assert type(show.SeriesName) is str

pytvdbapi attempts to convert all text parameters passed into unicode, that means unicode on Python 2.X and str on python 3.X. For example, both of these are valid: >>> from pytvdbapi import api >>> db= api.TVDB(’B43FF87DE395DF56’)

>>> result= db.search(’Alarm für cobra 11’,’de’) >>> len(result) 3 >>> print(result[0])

And: >>> result= db.search(u’’,’de’) >>> len(result) 3 >>> print(result[0])

1 http://docs.python.org/3.3/howto/unicode.html

6 Chapter 1. Basics pytvdbapi Documentation, Release 0.4.0

1.3 Examples

This section provides some different examples of how pytvdbapi can be used.

1.3.1 Basic Usage

Search for a show, given its name and a language: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("Dexter","en") >>> show= result[0] # If there is a perfect match, it will be the first

>>> print(show.SeriesName) Dexter >>> print(show.FirstAired) 2006-10-01

You can easily loop all episodes in a show: >>> for season in show: ... for episode in season: ... print(u"{0} - {1}".format(episode.EpisodeName, episode.FirstAired)) ... Early Cuts: Alex Timmons (Chapter 1) - 2009-10-25 ... Finding Freebo - 2008-10-05 The Lion Sleeps Tonight - 2008-10-12 All In the Family - 2008-10-19 Turning Biminese - 2008-10-26 ... Dress Code - 2013-08-11 Are We There Yet? - 2013-08-18 Make Your Own Kind of Music - 2013-08-25 Goodbye Miami - 2013-09-08 Monkey In a Box - 2013-09-15 Remember the Monsters? - 2013-09-22

1.3.2 Working with a show object

Basic usage: # You can use slicing to only get a sub set of all seasons >>> for season in show[2:5]: ... print(season.season_number) ... 2 3 4

# List the total number of seasons # Season 0 is the "specials" season containing special episodes >>> len(show) 9

1.3. Examples 7 pytvdbapi Documentation, Release 0.4.0

>>> print(show[2]) # Access a particular season

Access show attributes: >>> print(show.IMDB_ID) tt0773262

>>> hasattr(show,’foo’) False

>>> hasattr(show,’Genre’) True

>>> getattr(show,’foo’,-1) -1

1.3.3 Working with a Season object

Episode access: >>> from pytvdbapi.error import TVDBIndexError >>> season= show[2] # Grab a specific season, season 0 is the specials season

>>> len(season) # The number of episodes in the season 12

>>> try: ... print(season[0]) ... except TVDBIndexError: ... # Episodes start at index 1 ... print(’No episode at index 0’) No episode at index 0

>>> print(season[3])

You can use slicing to access specific episode objects: >>> for episode in season[3:10:2]: ... print(episode.EpisodeNumber) ... 4 6 8 10

Access the associated show: >>> season.show

1.3.4 Working with an episode object

Accessing episode attributes:

8 Chapter 1. Basics pytvdbapi Documentation, Release 0.4.0

>>> episode= show[2][4] >>> print(episode.EpisodeName) See-Through

>>> hasattr(episode,’foo’) False

>>> hasattr(episode,’Director’) True

Access the containing season: >>> episode.season

1.3.5 Case insensitive attributes

It is possible to tell the API to ignore casing when accessing the objects dynamic attributes. If you pass ignore_case=True when creating the pytvdbapi.api.TVDB instance, you can access the dynamically cre- ated attributes of the pytvdbapi.api.Show, pytvdbapi.api.Season, pytvdbapi.api.Episode, pytvdbapi.actor.Actor and pytvdbapi.banner.Banner instances in a case insensitive manner. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56", ignore_case=True) # Tell API to ignore case >>> result= db.search("Dexter","en") >>> show= result[0]

>>> print(show.seriesname) Dexter

>>> hasattr(show,’SERIESNAME’) True >>> hasattr(show,’seriesname’) True >>> hasattr(show,’sErIeSnAmE’) True

>>> episode= show[3][5] >>> print(episode.episodename) Turning Biminese

>>> hasattr(episode,’EPISODENAME’) True >>> hasattr(episode,’episodename’) True

1.3.6 Working with Actor and Banner Objects

By default, the extended information for pytvdbapi.actor.Actor and pytvdbapi.banner.Banner are not loaded. This is to save server resources and avoid downloading data that is not necessarily needed. The pytvdbapi.api.Show always contain a list of actor names. If you do want to use this extra actor and banner data you can pass actors=True and banners=True respectively when creating the pytvdbapi.api.TVDB instance, this will cause the actors and/or banners to be loaded for all shows. If you only want this information for some shows, you

1.3. Examples 9 pytvdbapi Documentation, Release 0.4.0 can use the pytvdbapi.api.Show.load_actors() and pytvdbapi.api.Show.load_banners() functions instead. Using keyword arguments: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56", actors=True, banners=True) >>> result= db.search("Dexter","en") >>> show= result[0] >>> show.update()

>>> len(show.actor_objects) 26 >>> len(show.banner_objects) 231 >>> print(show.actor_objects[0])

Using instance functions: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("Dexter","en") >>> show= result[0]

>>> len(show.actor_objects) 0 >>> len(show.banner_objects) 0

>>> show.load_actors() # Load actors >>> len(show.actor_objects) 26

>>> print(show.actor_objects[0])

>>> show.load_banners() # Load banners >>> len(show.banner_objects) 231

1.3.7 Handle Network Issues

This provides a more complete example of how to handle the fact that there could be something wrong with the connection to the backend, or the backend could be malfunctioning and return invalid data that we can not work with. >>> from pytvdbapi import api >>> from pytvdbapi.error import ConnectionError, BadData, TVDBIndexError >>> db= api.TVDB("B43FF87DE395DF56")

>>> try: ... result= db.search("Dexter","en") # This hits the network and could raise an exception ... show= result[0] # Find the show object that you want ... show.update() # this loads the full data set and could raise exceptions ... except TVDBIndexError: ... # The search did not generate any hits ... pass ... except ConnectionError:

10 Chapter 1. Basics pytvdbapi Documentation, Release 0.4.0

... # Handle the fact that the server is not responding ... pass ... except BadData: ... # The server responded but did not provide valid XML data, handle this issue here, ... # maybe by trying again after a few seconds ... pass ... else: ... # At this point, we should have a valid show instance that we can work with. ... name= show.SeriesName

1.3. Examples 11 pytvdbapi Documentation, Release 0.4.0

12 Chapter 1. Basics Part II

Modules

13

CHAPTER 2

pytvdbapi modules

2.1 api Module

This is the main module for pytvdbapi intended for client usage. It contains functions to access the API functionality through the TVDB class and its methods. It has implementations for representations of Show, Season and Episode objects. It also contains functionality to access the list of API supported languages through the languages() function. Basic usage: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("How I met your mother","en") >>> len(result) 1

>>> show= result[0] # If there is a perfect match, it will be the first >>> print(show.SeriesName) How I Met Your Mother

>>> len(show) # Show the number of seasons 10

>>> for season in show: ... for episode in season: ... print(episode.EpisodeName) ... Robin Sparkles Music Video - Let’s Go to the Mall Robin Sparkles Music Video - Sandcastles In the Sand ... Pilot Purple Giraffe Sweet Taste of Liberty Return of the Shirt ...

15 pytvdbapi Documentation, Release 0.4.0

2.1.1 Languages class pytvdbapi.api.Language(abbrev, name, id) Bases: object Representing a language that is supported by the API. See Also: TVDB.get_series(), TVDB.get_episode() and TVDB.search() for functions where the language can be specified. abbreviation = None A two letter abbreviation representing the language, e.g. en. This is what should be passed when specifying a language to the API. name = None The localised name of the language. pytvdbapi.api.languages() Returns A list of Language objects Returns the list of all API supported languages. Example: >>> from pytvdbapi import api >>> for language in api.languages(): ... print(language) ˇ ... ... ...

2.1.2 Show, Season and Episode Representation class pytvdbapi.api.Show(data, api, language, config) Bases: _abcoll.Sequence Raise pytvdbapi.error.TVDBAttributeError, pytvdbapi.error.TVDBIndexError Holds attributes about a single show and contains all seasons associated with a show. The attributes are named exactly as returned from thetvdb.com. This object should be considered a read only container of data provided from the server. Some type conversion of of the attributes will take place as follows: •Strings of the format yyyy-mm-dd will be converted into a datetime.date object. •Pipe separated strings will be converted into a list. E.g “foo | bar” => [”foo”, “bar”] •Numbers with a decimal point will be converted to float •A number will be converted into an int The Show uses lazy evaluation and will only load the full data set from the server when this data is needed. This is to speed up the searches and to reduce the workload of the servers. This way, data will only be loaded when actually needed.

16 Chapter 2. pytvdbapi modules pytvdbapi Documentation, Release 0.4.0

The Show supports iteration to iterate over the Seasons contained in the Show. You can also index individual seasons with the [ ] syntax. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("dexter","en") >>> show= result[0]

>>> dir(show) # List the set of basic attributes [’AliasNames’, ’FirstAired’, ’IMDB_ID’, ’Network’, ’Overview’, ’SeriesName’, ’actor_objects’, ’api’, ’banner’, ’banner_objects’, ’id’, ’lang’, ’language’, ’seriesid’, ’zap2it_id’]

>>> show.update() # Load the full data set from the server >>> dir(show) # List the full set of attributes [’Actors’, ’Airs_DayOfWeek’, ’Airs_Time’, ’AliasNames’, ’ContentRating’, ’FirstAired’, ’Genre’, ’IMDB_ID’, ’Language’, ’Network’, ’NetworkID’, ’Overview’, ’Rating’, ’RatingCount’, ’Runtime’, ’SeriesID’, ’SeriesName’, ’Status’, ’actor_objects’, ’added’, ’addedBy’, ’api’, ’banner’, ’banner_objects’, ’fanart’, ’id’, ’lang’, ’language’, ’lastupdated’, ’poster’, ’seriesid’, ’zap2it_id’]

Note: When searching, thetvdb.com provides a basic set of attributes for the show. When the full data set is loaded thetvdb.com provides a complete set of attributes for the show. The full data set is loaded when accessing the season data of the show. If you need access to the full set of attributes you can force the loading of the full data set by calling the update() function.

load_actors() New in version 0.4. Loads the extended actor information into a list of pytvdbapi.actor.Actor objects. They are available through the actor_objects attribute of the show. If you have used the actors=True keyword when creating the TVDB instance the actors will be loaded automatically and there is no need to use this function.

Note: The Show instance always contain a list of actor names. If that is all you need, do not use this function to avoid unnecessary network traffic.

See Also: TVDB for information on how to use the actors keyword argument. load_banners() New in version 0.4. Loads the extended banner information into a list of pytvdbapi.banner.Banner objects. They are available through the banner_objects attribute of the show. If you have used the banners=True keyword when creating the TVDB instance the banners will be loaded automatically and there is no need to use this function. See Also: TVDB for information on how to use the banners keyword argument. update() Updates the data structure with data from the server.

2.1. api Module 17 pytvdbapi Documentation, Release 0.4.0 class pytvdbapi.api.Season(season_number, show) Bases: _abcoll.Sequence Raise pytvdbapi.error.TVDBIndexError Holds all the episodes that belong to a specific season. It is possible to iterate over the Season to obtain the individual Episode instances. It is also possible to obtain an individual episode using the [ ] syntax. It will raise pytvdbapi.error.TVDBIndexError if trying to index an invalid episode index. It is possible to obtain the containing Show instance through the Season.show attribute. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("Dexter","en") >>> show= result[0]

>>> season= show[2] >>> len(season) # Number of episodes in the season 12

>>> print(season.season_number) 2

>>> print(season[2].EpisodeName) Waiting to Exhale

>>> for episode in season: ... print(episode.EpisodeName) ... It’s Alive! Waiting to Exhale See-Through ... The British Invasion

append(episode) Parameters episode (Episode) – The episode to append Adds a new Episode to the season. If an episode with the same EpisodeNumber already exists, it will be overwritten. class pytvdbapi.api.Episode(data, season, config) Bases: object Raise pytvdbapi.error.TVDBAttributeError Holds all information about an individual episode. This should be treated as a read-only object to obtain the attributes of the episode. All episode values returned from thetvdb.com are accessible as attributes of the episode object. TVDBAttribu- teError will be raised if accessing an invalid attribute. Some type conversions of the attributes will take place as follows: •Strings of the format yyyy-mm-dd will be converted into a datetime.date object. •Pipe separated strings will be converted into a list. E.g “foo | bar” => [”foo”, “bar”] •Numbers with a decimal point will be converted to float

18 Chapter 2. pytvdbapi modules pytvdbapi Documentation, Release 0.4.0

•A number will be converted into an int It is possible to obtain the containing season through the Episode.season attribute. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("Dexter","en") >>> show= result[0] >>> episode= show[1][2] # Get episode S01E02

>>> print(episode.season)

>>> print(episode.EpisodeNumber) 2

>>> print(episode.EpisodeName)

>>> episode.FirstAired datetime.date(2006, 10, 8)

>>> dir(episode) [’Combined_episodenumber’, ’Combined_season’, ’DVD_chapter’, ’DVD_discid’, ’DVD_episodenumber’, ’DVD_season’, ’Director’, ’EpImgFlag’, ’EpisodeName’, ’EpisodeNumber’, ’FirstAired’, ’GuestStars’, ’IMDB_ID’, ’Language’, ’Overview’, ’ProductionCode’, ’Rating’, ’RatingCount’, ’SeasonNumber’, ’Writer’, ’absolute_number’, ’filename’, ’id’, ’lastupdated’, ’season’, ’seasonid’, ’seriesid’, ’thumb_added’, ’thumb_height’, ’thumb_width’]

2.1.3 API Access

class pytvdbapi.api.Search(result, search, language) Bases: object Raise pytvdbapi.error.TVDBIndexError A search result returned from calling TVDB.search(). It supports iterating over the results, and the individual shows matching the search can be accessed using the [ ] syntax. The search will contain 0 or more Show() instances matching the search. The shows will be stored in the same order as they are returned from thetvdb.com. They state that if there is a perfect match to the search, it will be the first element returned. See Also: TVDB.search() for an example of how to use the search language = None The language used to perform the search search = None The search term used to generate the search result class pytvdbapi.api.TVDB(api_key, **kwargs) Bases: object

2.1. api Module 19 pytvdbapi Documentation, Release 0.4.0

Parameters • api_key – The API key to use to communicate with the server • kwargs – This is the main entry point for the API. The functionality of the API is controlled by configuring the keyword arguments. The supported keyword arguments are: •cache_dir (default=//pytvdbapi/). Specifies the directory to use for caching the server requests. New in version 0.3. •actors (default=False) The extended actor information is stored in a separate XML file and would require an additional request to the server to obtain. To limit the resource usage, the actor information will only be loaded when explicitly requested.

Note: The Show() object always contain a list of actor names.

•banners (default=False) The extended banner information is stored in a separate XML file and would require an additional request to the server to obtain. To limit the resource usage, the banner information will only be loaded when explicitly requested. New in version 0.4. •ignore_case (default=False) If set to True, all attributes on the Show and Episode instances will be accessible in a case insensitive manner. If set to False, the default, all attributes will be case sensitive and retain the same casing as provided by thetvdb.com. Deprecated since version 0.4. •force_lang (default=False). It is no longer possible to reload the language file. Using it will have no affect but will issue a warning in the log file. search(show, language, cache=True) Parameters • show – The show name to search for • language – The language abbreviation to search for. E.g. “en” • cache – If False, the local cache will not be used and the resources will be reloaded from server. Returns A Search() instance Raise pytvdbapi.error.TVDBValueError Searches the server for a show with the provided show name in the provided language. The language should be one of the supported language abbreviations or it could be set to all to search all languages. It will raise pytvdbapi.error.TVDBValueError if an invalid language is provided. Searches are always cached within a session to make subsequent searches with the same parameters fast. If cache is set to True searches will also be cached across sessions, this is recommended to increase speed and to reduce the workload of the servers. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("House","en")

20 Chapter 2. pytvdbapi modules pytvdbapi Documentation, Release 0.4.0

>>> print(result[0])

>>> for show in result: ... print(show) ... ...

get(series_id, language, cache=True) New in version 0.3.Deprecated since version 0.4: Use get_series() instead. Parameters • series_id – The Show Id to fetch • language – The language abbreviation to search for. E.g. “en” • cache – If False, the local cache will not be used and the resources will be reloaded from server. Returns A Show() instance Raise pytvdbapi.error.TVDBValueError, pytvdbapi.error.TVDBIdError get_series(series_id, language, cache=True) New in version 0.4. Parameters • series_id – The Show Id to fetch • language – The language abbreviation to search for. E.g. “en” • cache – If False, the local cache will not be used and the resources will be reloaded from server. Returns A Show() instance Raise pytvdbapi.error.TVDBValueError, pytvdbapi.error.TVDBIdError Provided a valid Show ID, the data for the show is fetched and a corresponding Show() object is returned. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> show= db.get_series( 79349,"en") # Load Dexter >>> print(show.SeriesName) Dexter

get_episode(series_id, language, cache=True) New in version 0.4. Parameters • episode_id – The Episode Id to fetch • language – The language abbreviation to search for. E.g. “en” • cache – If False, the local cache will not be used and the resources will be reloaded from server. Returns An Episode() instance

2.1. api Module 21 pytvdbapi Documentation, Release 0.4.0

Raise pytvdbapi.error.TVDBIdError if no episode is found with the given Id Given a valid episode Id the corresponding episode data is fetched and the Episode() instance is re- turned. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> episode= db.get_episode(308834,"en") # Load an episode of dexter >>> print(episode.id) 308834

>>> print(episode.EpisodeName) Crocodile

Note: When the Episode() is loaded using get_episode() the season attribute used to link the episode with a season will be None.

2.2 actor Module

A module for actor related functionality. class pytvdbapi.actor.Actor(mirror, data, show) Representing an Actor as provided by thetvdb.com. It Will contain all attributes as delivered from thetvdb.com, the attributes are described in more detail here. Example: >>> from pytvdbapi import api >>> db= api.TVDB("B43FF87DE395DF56") >>> result= db.search("dexter","en") >>> show= result[0]

>>> show.load_actors()

>>> actor= show.actor_objects[0] >>> print(actor.image_url) http://thetvdb.com/banners/actors/70947.jpg

>>> for actor in show.actor_objects: ... print(u"{0} - {1}".format(actor.Name, actor.Role)) ... Michael C. Hall - Jennifer Carpenter - James Remar - ... Jimmy Smits - Miguel Prado - Lila Tournay -

Additional class attributes are: pytvdbapi.actor.Actor.image_url The full URL for the actor image.

22 Chapter 2. pytvdbapi modules pytvdbapi Documentation, Release 0.4.0

2.3 banner Module

A module for managing banner information Although some banners are related to a specific season, all banners will be stored as a property of the related Show instance. class pytvdbapi.banner.Banner(mirror, data, show) Bases: object Representing a Banner as provided by thetvdb.com. More information about the data provided for a Banner can be found here. Attributes: The number and types of attributes that the Banner has is dependent on the type of Banner it is. Below is a description of the different attributes. Note: Wherever ‘text’ is given as the attribute type, this means that on Python 2.X it will be of type unicode and on Python 3.X str. Common: These attributes are present for all Banner objects. •BannerPath (text). The last part of the URL pointing to the image. This is appended to the correct mirror address to form the full URL. •BannerType (text). This could be any of fanart, season or poster. This value controls what other attributes are available as described below. •BannerType2 (text). What this attribute contains will depend on the type of Banner and will be described in each sub section below. •Language (text). •Rating (float). •RatingCount (int). •id (int). •banner_url (text). This is generated by pytvdbapi and is the full URL for the banner. fanart: Additional to the common attributes, the following attributes are included on objects of type fanart. •BannerType2 (text). Contains the dimension of the image as text. •Colors (list). •SeriesName (bool). •ThumbnailPath (text). •VignettePath (text). poster: poster type does not contain any additional attributes. •BannerType2 (text). Contains the dimension of the image as a string. season: Additional to the common attributes, the following attributes are included on objects of type season.

2.3. banner Module 23 pytvdbapi Documentation, Release 0.4.0

•BannerType2 (text). Contains the word ‘season’ •Season (int). Example: >>> from pytvdbapi import api >>> db= api.TVDB(’B43FF87DE395DF56’, banners=True) >>> show= db.get( 79349,"en") # Dexter >>> show.update()

>>> assert len(show.banner_objects)>0 >>> banner= show.banner_objects[0]

>>> print(banner.banner_url) http://thetvdb.com/banners/fanart/original/79349-...jpg

>>> print(banner.Language) en

Showing the different banner types and their attributes.

>>> fanart= [b for b in show.banner_objects if b.BannerType =="fanart"] >>> dir(fanart[0]) [’BannerPath’, ’BannerType’, ’BannerType2’, ’Colors’, ’Language’, ’Rating’, ’RatingCount’, ’SeriesName’, ’ThumbnailPath’, ’VignettePath’, ’banner_url’, ’id’]

>>> print(fanart[0].BannerType2) 1920x1080

>>> posters= [b for b in show.banner_objects if b.BannerType =="poster"] >>> dir(posters[0]) [’BannerPath’, ’BannerType’, ’BannerType2’, ’Language’, ’Rating’, ’RatingCount’, ’banner_url’, ’id’]

>>> print(posters[0].BannerType2) 680x1000

>>> seasons= [b for b in show.banner_objects if b.BannerType =="season"] >>> dir(seasons[0]) [’BannerPath’, ’BannerType’, ’BannerType2’, ’Language’, ’Rating’, ’RatingCount’, ’Season’, ’banner_url’, ’id’]

>>> print(seasons[0].BannerType2) season

2.4 error Module

A module containing all the exceptions raised by pytvdbapi. pytvdbapi will only raise exceptions that are of type PytvdbapiError or it’s subclasses. exception pytvdbapi.error.PytvdbapiError(msg, *args, **kwargs) Bases: exceptions.Exception

24 Chapter 2. pytvdbapi modules pytvdbapi Documentation, Release 0.4.0

Base exception for all exceptions raised by pytvdbapi exception pytvdbapi.error.BadData(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError Raised if there are issues parsing the XML data provided by thetvdb.com exception pytvdbapi.error.ConnectionError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError Raised by the pytvdbapi.Loader when unable to connect to the provided URL. exception pytvdbapi.error.TVDBAttributeError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError, exceptions.AttributeError A replacement for the standard AttributeError. exception pytvdbapi.error.TVDBIndexError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError, exceptions.IndexError A replacement for the standard IndexError. exception pytvdbapi.error.TVDBIdError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError Raised when trying to get a show using an invalid Show ID exception pytvdbapi.error.TVDBValueError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError, exceptions.ValueError A replacement for the standard ValueError exception. exception pytvdbapi.error.TVDBNotFoundError(msg, *args, **kwargs) Bases: pytvdbapi.error.PytvdbapiError Raised when the data can not be found. Represent the 404 http code.

2.4. error Module 25 pytvdbapi Documentation, Release 0.4.0

26 Chapter 2. pytvdbapi modules Part III

Extras

27

CHAPTER 3

License

Copyright 2011 - 2013, Björn Larsson This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see .

29 pytvdbapi Documentation, Release 0.4.0

30 Chapter 3. License CHAPTER 4

Credits

The following persons have in some way contributed to improving pytvdbapi and deserve a mention.

4.1 Contributors

• Alexander van Ratingen • Tobias Röttger • BenoitZugmeyer

31 pytvdbapi Documentation, Release 0.4.0

32 Chapter 4. Credits CHAPTER 5

Contact

To get in contact with me personally you can send me an email at [email protected].

5.1 Feedback / Suggestions

To provide bug reports or feature requests, please use the project provided bug tracker, try to provide as much informa- tion as possible, including how to reproduce the issue, any log files produced and preferably a test case that highlights the issue. Or, feel free to implement the changes yourself and submit a pull request.

5.2 Twitter

You can follow me on Twitter @fuzzycode to get updates about pytvdbapi.

33 pytvdbapi Documentation, Release 0.4.0

34 Chapter 5. Contact Part IV

Indices and tables

35

pytvdbapi Documentation, Release 0.4.0

• genindex • modindex • search

37 pytvdbapi Documentation, Release 0.4.0

38 Python Module Index

p pytvdbapi.actor, ?? pytvdbapi.api, ?? pytvdbapi.banner, ?? pytvdbapi.error, ??

39