Giter VIP home page Giter VIP logo

pytvmaze's Introduction

To install:

pip install pytvmaze

Basic single-show usage

import pytvmaze

# Get show object
show = pytvmaze.get_show('dexter')
print show
>>> <pytvmaze.Show instance at 0x107abefc8>
print show.name, show.status, show.maze_id
>>> Dexter Ended 161

# Iterate over episodes
for episode in show.episodes:
  print episode.title
>>> Dexter
>>> Crocodile
>>> Popping Cherry
>>> etc...

# Get a specific episode with: get_episode(season, episode)
ep = show.get_episode(1,8)
print ep
>>> <pytvmaze.Episode instance at 0x107b060e0>
print ep.title
>>> Shrink Wrap

There are many possible attributes of the Show class, but since TV Maze is full of user contributions and always being updated, shows will have different available attributes. Possible attributes are:

show.status
show.rating
show.genres
show.weight
show.updated
show.name
show.language
show.schedule
show.url
show.image
show.externals # dict of tvdb and tvrage id's if available
show.premiered
show.summary
show._links # dict of previousepisode and nextepisode keys for their links
show.webChannel
show.runtime
show.type
show.id
show.maze_id # same as show.id
show.network # dict of network properties
show.episodes # list of Episode objects

## Episode object attributes ##
episode.title
episode.airdate
episode.url
episode.season_number
episode.episode_number
episode.image
episode.airstamp
episode.runtime
episode.maze_id

Aside from these classes, you can also utilize all of the TV Maze endpoints directly, without creating an insance of the Show class, via their respective functions. The results of these functions are JSON:

pytvmaze.show_search(show) # returns a list of fuzzy-matched shows given a show name (string)
pytvmaze.show_single_search(show) # returns the best-matched show
pytvmaze.show_single_search(show, embed=[option]) # see http://www.tvmaze.com/api#embedding for embedding other information in your results
pytvmaze.lookup_tvrage(tvrage_id) # get tvmaze show data from a tvrage show id
pytvmaze.lookup_tvdb(tvdb_id) # get tvmaze show data from a tvdb show id
pytvmaze.get_schedule(country='US')
pytvmaze.get_full_schedule() # ALL future known episodes.  Several MB large, cached for 24 hours
pytvmaze.show_main_info(maze_id)
pytvmaze.episode_list(maze_id)
pytvmaze.episode_by_number(maze_id, season_number, episode_number)
pytvmaze.episodes_by_date(maze_id, airdate) # returns a list of all episodes that show aired on that day, airdate must be ISO 8601 formatted
pytvmaze.show_cast(maze_id)
pytvmaze.show_index(page=1)
pytvmaze.people_search(person)
pytvmaze.person_main_info(person_id)
pytvmaze.person_cast_credits(person_id)
pytvmaze.person_crew_credits(person_id)
pytvmaze.show_updates()

pytvmaze's People

Contributors

srob650 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.