GithubHelp home page GithubHelp logo

tizz98 / netflix_roulette Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 58 KB

A simple python wrapper for the Netflix Roulette API

License: GNU General Public License v3.0

Python 100.00%
netflix netflix-roulette python-wrapper

netflix_roulette's Introduction

Netflix Roulette

This is a simple python wrapper for the Netflix Roulette API.

Build Status PyPI version Python Versions License Code Climate

Installation

Pip

  • pip install netflix_roulette

From Source

  • git clone [email protected]:tizz98/netflix_roulette.git
  • cd netflix_roulette
  • python setup.py install

Usage

Simple Query

>>> import netflix_roulette
>>> media = netflix_roulette.NetflixMedia('Attack on titan')
>>> media
<NetflixMedia(title='Attack on titan', year='None')>
>>> media.show_id
70299043
>>> media.summary
u'For over a century, people have been living behind barricades to block out the giant Titans that threaten to destroy the human race. When a Titan destroys his hometown, young Eren Yeager becomes determined to fight back.'
>>> media.is_on_netflix
True
>>> media.get_readable_mediatype()
'TV Show'

Query with year

>>> import netflix_roulette
>>> media = netflix_roulette.NetflixMedia('The Boondocks', year=2005)
>>> media
<NetflixMedia(title='The Boondocks', year='2005')>
>>> media.show_id
70153391
>>> media.summary
u'Based on the comic strip by Aaron McGruder, this satirical animated series follows the socially conscious misadventures of Huey Freeman, a preternaturally smart 10-year-old who relocates from inner-city Chicago to the suburbs.'
>>> media.is_on_netflix
True
>>> media.get_readable_mediatype()
'TV Show'

class NetflixMedia

Parameters

  • title: Title of the media you are searching for.
  • year: (Optional) Year of the media you are searching for.

Attributes

  • title: User supplied title of the media you are searching for.
  • year: User supplied year of the media you are searching for.
  • rating: How high the media is rated, max is 5.
  • poster: The poster for the media, right from the Netflix CDN.
  • mediatype: 0 means movie, 1 means TV Show. See also get_readable_mediatype().
  • release_year: The media's release date.
  • show_cast: The cast of a given title.
  • category: A title's given category.
  • summary: A plot summary.
  • director: The name(s) of the director(s) of a given title.
  • show_id: The Netflix id of the title.
  • is_on_netflix: A boolean, whether or not the show is on Netflix.

Methods

  • get_readable_mediatype(): Returns TV Show or Movie instead of 1 or 0.
  • is_movie(): Returns True if the media is a Movie.
  • is_tv_show(): Returns True if the media is a TV Show.

class NetflixDirector

Parameters

  • name: Name of the director you are searching for.

Attributes

  • name: User supplied name.
  • media: List of NetflixMedia that the person has directed.

class NetflixActor

Parameters

  • name: Name of the actor you are searching for.

Attributes

  • name: User supplied name.
  • media: List of NetflixMedia that the person has been in.

netflix_roulette's People

Contributors

tizz98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

xstaticxgpx

netflix_roulette's Issues

Fix pypi versioning

Version numbers if a single number e.g. 0.2 should instead become 0.2.0 and 0.13 would be 0.1.3 to be consistent.

Actor support

Ex: http://netflixroulette.net/api/api.php?actor=Nicolas%20Cage

[
    {
        "category": "Comedies", 
        "rating": "3.4", 
        "show_id": 643557, 
        "release_year": "1994", 
        "poster": "http://netflixroulette.net/api/posters/643557.jpg", 
        "show_cast": "Nicolas Cage, Bridget Fonda, Rosie P\u00e9rez, Wendell Pierce, Isaac Hayes, V\u00edctor Rojas, Seymour Cassel, Stanley Tucci, J.E. Freeman", 
        "mediatype": 0, 
        "summary": "In this charming romantic comedy based on a true story, a coffee-shop waitress gets a life-changing tip when a beat cop comes up short on pocket change and promises her half of his potential winnings from a lottery ticket.", 
        "director": "Andrew Bergman", 
        "show_title": "It Could Happen to You", 
        "runtime": "101 min", 
        "unit": 636
    }, 
    {
        "category": "Children & Family Movies", 
        "rating": "4.1", 
        "show_id": 70143241, 
        "release_year": "2013", 
        "poster": "http://netflixroulette.net/api/posters/70143241.jpg", 
        "show_cast": "Nicolas Cage, Emma Stone, Ryan Reynolds, Catherine Keener, Cloris Leachman, Clark Duke, Chris Sanders, Randy Thom", 
        "mediatype": 0, 
        "summary": "When an earthquake obliterates their cave, an unworldly prehistoric family is forced to journey through unfamiliar terrain in search of a new home. But things for pessimistic dad Grug go from bad to worse when his daughter meets a clever cave boy.", 
        "director": "Kirk De Micco, Chris Sanders", 
        "show_title": "The Croods", 
        "runtime": "98 min", 
        "unit": 800
    }, 
    {
        "category": "Children & Family Movies", 
        "rating": "3.5", 
        "show_id": 70131173, 
        "release_year": "2001", 
        "poster": "http://netflixroulette.net/api/posters/70131173.jpg", 
        "show_cast": "Simon Callow, Rhys Ifans, Kate Winslet, Nicolas Cage, Jane Horrocks, Michael Gambon, Juliet Stevenson, Robert Llewellyn, Iain Jones, Colin McFarlane", 
        "mediatype": 0, 
        "summary": "Nicolas Cage, Kate Winslet and Simon Callow provide voices for this animated version of the classic Charles Dickens tale about the miserable Ebenezer Scrooge, who learns the true meaning of Christmas from three ghosts who confront him in the night. The film uses live-action sequences to bookend the story, and a mouse in the animated portion helps younger viewers follow the story. Winslet sings the film's main theme.", 
        "director": "Jimmy T. Murakami", 
        "show_title": "Christmas Carol: The Movie", 
        "runtime": "77 min", 
        "unit": 2651
    }, 
    {
        "category": "Action & Adventure", 
        "rating": "3.7", 
        "show_id": 70257818, 
        "release_year": "2012", 
        "poster": "http://netflixroulette.net/api/posters/70257818.jpg", 
        "show_cast": "Nicolas Cage, Josh Lucas, Danny Huston, Malin Akerman, Sami Gayle, Edrick Browne, Mark Valley, Barry Shabaka Henley, M.C. Gainey", 
        "mediatype": 0, 
        "summary": "Master thief Will Montgomery is ready to leave his criminal past behind. But when his daughter is kidnapped, he has no choice but to reunite with his old partner in crime and pull off one last heist.", 
        "director": "Simon West", 
        "show_title": "Stolen", 
        "runtime": "96 min", 
        "unit": 3863
    }, 
    {
        "category": "Action & Adventure", 
        "rating": "3.8", 
        "show_id": 70135880, 
        "release_year": "2011", 
        "poster": "http://netflixroulette.net/api/posters/70135880.jpg", 
        "show_cast": "Nicolas Cage, January Jones, Guy Pearce, Harold Perrineau, Jennifer Carpenter, Xander Berkeley, IronE Singleton, Wayne P\u00e9re, Marcus Lyle Brown, Jason Davis", 
        "mediatype": 0, 
        "summary": "After his wife is brutally raped, English teacher Will Gerard is approached by a man from a vigilante group who offers to exact revenge on the perpetrator. But once the deed is done, Will discovers that the group expects a certain favor in return.", 
        "director": "Roger Donaldson", 
        "show_title": "Seeking Justice", 
        "runtime": "105 min", 
        "unit": 5221
    }, 
    {
        "category": "Thrillers", 
        "rating": "3.5", 
        "show_id": 70206627, 
        "release_year": "2011", 
        "poster": "http://netflixroulette.net/api/posters/70206627.jpg", 
        "show_cast": "Nicolas Cage, Nicole Kidman, Ben Mendelsohn, Liana Liberato, Cam Gigandet, Jordana Spiro, Dash Mihok, Emily Meade, Nico Tortorella, Brandon Belknap", 
        "mediatype": 0, 
        "summary": "A husband and wife find themselves pushed to their absolute limit when they're held for ransom by brutal thugs who invade their home. As tensions escalate and shocking revelations emerge, the couple is forced to take ever-more desperate measures.", 
        "director": "Joel Schumacher", 
        "show_title": "Trespass", 
        "runtime": "91 min", 
        "unit": 6000
    }, 
    {
        "category": "Thrillers", 
        "rating": "3.4", 
        "show_id": 70253159, 
        "release_year": "2013", 
        "poster": "http://netflixroulette.net/api/posters/70253159", 
        "show_cast": "Nicolas Cage, Vanessa Hudgens, John Cusack, Dean Norris, Gia Mantegna, Robert Forgit, Brad William Henke, Michael McGrady, Radha Mitchell, 50 Cent", 
        "mediatype": 0, 
        "summary": "In this fact-based thriller, an Alaska state trooper pursuing a serial killer teams with a 17-year-old-prostitute who escaped the predator's clutches.", 
        "director": "Scott Walker", 
        "show_title": "Frozen Ground", 
        "runtime": "N/A", 
        "unit": 8054
    }, 
    {
        "category": "Action & Adventure", 
        "rating": "3.7", 
        "show_id": 1154341, 
        "release_year": "1997", 
        "poster": "http://netflixroulette.net/api/posters/1154341.jpg", 
        "show_cast": "John Travolta, Nicolas Cage, Joan Allen, Alessandro Nivola, Gina Gershon, Dominique Swain, Nick Cassavetes, Harve Presnell, Colm Feore, John Carroll Lynch", 
        "mediatype": 0, 
        "summary": "An antiterrorism agent goes under the knife to acquire the likeness of a terrorist and gather details about a bombing plot.", 
        "director": "John Woo", 
        "show_title": "Face/Off", 
        "runtime": "N/A", 
        "unit": 16989
    }, 
    {
        "category": "Action & Adventure", 
        "rating": "2.9", 
        "show_id": 80005641, 
        "release_year": "2014", 
        "poster": "http://netflixroulette.net/api/posters/80005641.jpg", 
        "show_cast": "Nicolas Cage, Danny Glover, Michael McGrady, Peter Stormare, Max Ryan, Rachel Nichols, Patrice Cols, Weston Cage, Aubrey Peeples, Pasha D. Lychnikoff", 
        "mediatype": 0, 
        "summary": "When his daughter is abducted, a respectable businessman with a violent past rounds up his old crew to help him find her -- by any means necessary.", 
        "director": "Paco Cabezas", 
        "show_title": "Rage", 
        "runtime": "N/A", 
        "unit": 17703
    }, 
    {
        "category": "Romantic Movies", 
        "rating": "3.5", 
        "show_id": 772556, 
        "release_year": "1987", 
        "poster": "http://netflixroulette.net/api/posters/772556.jpg", 
        "show_cast": "Cher, Nicolas Cage, Vincent Gardenia, Olympia Dukakis, Danny Aiello, Julie Bovasso, John Mahoney, Louis Guss, Feodor Chaliapin Jr., Anita Gillette", 
        "mediatype": 0, 
        "summary": "In this slice-of-life comedy about the Italian American residents of a Brooklyn neighborhood, a strong widow falls in love with a one-handed baker.", 
        "director": "Norman Jewison", 
        "show_title": "Moonstruck", 
        "runtime": "N/A", 
        "unit": 47519
    }, 
    {
        "category": "Independent Movies", 
        "rating": "3.1", 
        "show_id": 70293723, 
        "release_year": "2013", 
        "poster": "http://netflixroulette.net/api/posters/70293723.jpg", 
        "show_cast": "Nicolas Cage, Tye Sheridan, Gary Poulter, Ronnie Gene Blevins, Sue Rock, Adriene Mishler, Heather Kafka", 
        "mediatype": 0, 
        "summary": "When ex-con Joe hires 15-year-old Gary to help clear trees for a lumber company, he doesn't expect to become a father figure for the abused boy.", 
        "director": "David Gordon Green", 
        "show_title": "Joe", 
        "runtime": "N/A", 
        "unit": 47637
    }, 
    {
        "category": "Romantic Movies", 
        "rating": "3.5", 
        "show_id": 692295, 
        "release_year": "1995", 
        "poster": "http://netflixroulette.net/api/posters/692295.jpg", 
        "show_cast": "Nicolas Cage, Elisabeth Shue, Julian Sands, Richard Lewis, Steven Weber, Kim Adams, Emily Procter, Stuart Regen, Valeria Golino", 
        "mediatype": 0, 
        "summary": "An alcoholic moves to Las Vegas to drink himself to death and meets a prostitute who comes to love him, without trying to upset his nihilistic agenda.", 
        "director": "Mike Figgis", 
        "show_title": "Leaving Las Vegas", 
        "runtime": "N/A", 
        "unit": 47642
    }
]
import netflix_roulette

actor = netflix_roulette.Actor('Nicolas Cage')
for movie in actor.movies:  # list of netflix_roulette.NetflixMedia
    print movie.show_title

Actually fix pypi versioning

Since I started the versioning in the 0.1, 0.16 scheme, I think pypi thinks 0.2 and 0.2.1 are less than 0.16 so we'll have to stick with the old scheme but for single digit releases 0.30 in order to be the top release. Very confusing.

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.