Giter Club home page Giter Club logo

cineworld's Introduction

cineworld

What is this?

cineworld offers an easy-to-use Python wrapper to interact with the Cineworld API. Before you try and use the API, make sure you sign up to get an API Key.

In order to cut down on boilerplate code, you can then save your API key in the cineworld_api_key.py file.

Also, note that this package is in no way associated or endorsed by cineworld.co.uk

Prerequisites

fuzzywuzzy at https://github.com/seatgeek/fuzzywuzzy

Provides fuzzy searching capabilities

Installation

Download the source and use the python executable:

python setup.py install

Or, if you want to help develop the package, just git clone the Github repository:

git clone https://github.com/oracal/cineworld.git

Usage

Without saving your API key in the cineworld_api_key.py file:

>>> from cineworld import CW
>>> CW('my_api_key').film_search('some movie here')

With your API key saved:

>>> from cineworld import CW
>>> CW().film_search('some movie here')

NOTE: Documentation from this point forward will assume you have saved your Cineworld Developer API Key to the cineworld_api_key.py file (which you should consider doing in order to cut down on boilerplate code).

Methods

  • get_film_list -- Get a list of all current films

    >>> cw = CW()
    >>> cw.get_film_list()
	[{u'edi': 39523, u'title': u'3D - Harry Potter And The Deathly Hallows Pt 2'}, {u'edi': 40501, u'title': u'3D - Transformers: Dark Of The Moon'}, ...]
  • film_search -- Custom implemented search to find a list of films relating to the search term, returns an ordered list with strongest match first.

    >>> cw = CW()
    >>> cw.film_search('harry potter')
    [{'edi': 39523, 'strength': 90, 'title': '3D - Harry Potter And The Deathly Hallows Pt 2'}, {'edi': 35231, 'strength': 90, 'title': '2D - Harry Potter And The Deathly Hallows Pt 2'}]
  • get_film_id -- Get film id, choosing the strongest match generated from the film_search() function, allows you to specify 3D or 2D.

    >>> cw = CW()
    >>> cw.get_film_id('harry potter', True)
    39523
	>>> cw.get_film_id('harry potter', False)
	35231
  • get_film_info -- Get film info.

    >>> cw = CW()
    >>> cw.get_film_info(39523)
    [{'advisory': 'Contains moderate threat, injury detail and language', 'film_url': 'http://www.cineworld.co.uk/films/4401', ...}]

Tests

In order to run the tests for cineworld.py, make sure you have the mock library installed.

License

MIT

cineworld's People

Contributors

oracal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.