Skip to main content

Python API to kinopoisk.ru

Project description

# Kinopoiskpy

[![PyPI version](https://img.shields.io/pypi/v/kinopoiskpy.svg)](https://pypi-hypernode.com/pypi/kinopoiskpy) [![Circle CI](https://circleci.com/gh/ramusus/kinopoiskpy/tree/master.svg?style=shield)](https://circleci.com/gh/ramusus/kinopoiskpy) [![Coverage Status](https://coveralls.io/repos/ramusus/kinopoiskpy/badge.svg?branch=master)](https://coveralls.io/r/ramusus/kinopoiskpy) [![Build Status](https://img.shields.io/travis/ramusus/kinopoiskpy.svg?branch=master)](https://travis-ci.org/ramusus/kinopoiskpy) [![Coverage Status](https://coveralls.io/repos/ramusus/kinopoiskpy/badge.svg?branch=master)](https://coveralls.io/r/ramusus/kinopoiskpy)

This package is pythonic API to kinopoisk.ru website.

## Installation

To install the latest version using pip:

$ pip install kinopoiskpy

## Example usage

Search movies:

>>> from kinopoisk.movie import Movie
>>> movie_list = Movie.objects.search('Redacted')
>>> len(movie_list)
1
>>> print movie_list[0].title
Без цензуры
>>> print movie_list[0].id
278229

Get content of movie by ID:

>>> from kinopoisk.movie import Movie
>>> movie = Movie(id=278229)
>>> movie.get_content('main_page')
>>> movie.year
2007
>>> movie.title
u'Без цензуры'
>>> movie.title_en
u'Redacted'
>>> movie.plot
u'В центре картины  -  небольшой отряд американских солдат на контрольно-пропускном пункте в Ираке. Причём восприятие их истории постоянно меняется. Мы видим события глазами самих солдат, представителей СМИ, иракцев и понимаем, как на каждого из них влияет происходящее, их встречи и столкновения друг с другом.'
>>> movie.runtime
90
>>> movie.tagline
u'"Фильм, запрещенный к прокату во многих странах"'
>>> movie.rating
8.5
>>> movie.get_content('posters')
>>> len(movie.posters) > 0
True

Get content of person by ID:

>>> from kinopoisk.person import Person
>>> person = Person(id=6245)
>>> person.get_content('main_page')
>>> person.id
6245
>>> person.name
u'Джонни Депп'
>>> person.year_birth
1963
>>> person.name_en
u'Johnny Depp'
>>> len(person.information) > 50
True
>>> person.get_content('photos')
>>> len(person.photos) > 10
True

## Testing

By default, all communication with kinopoisk.ru is recorded in special files called cassettes (see vcrpy-unittest). To reproduce real requests to kinopoisk.ru just delete directory kinopoisk/tests/cassettes/ with all it’s content.

Run all tests:

$ python -W ignore -m kinopoisk.tests

Run particular test:

$ python -W ignore -m kinopoisk.tests -v MovieTest.test_movie_cast

## Contributors

[Alex Rembish](http://github.com/rembish)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kinopoiskpy-0.9.0.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

kinopoiskpy-0.9.0-py3-none-any.whl (3.6 MB view details)

Uploaded Python 3

File details

Details for the file kinopoiskpy-0.9.0.tar.gz.

File metadata

  • Download URL: kinopoiskpy-0.9.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for kinopoiskpy-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0d7d2f471dad669028b0982847c9372786e07284db5f14544a1a9a814689e7e5
MD5 35df44603c76a2fa22b13345f2cd1446
BLAKE2b-256 1de324de05fa4f723b2c1bd66a64c9fe485ef675fb1c1a024038763d1c2ce73f

See more details on using hashes here.

File details

Details for the file kinopoiskpy-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: kinopoiskpy-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for kinopoiskpy-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7b171d1b98bcdab8043cd4f5d9ced0ebd9d3484f72bab2cf07c25b8535fbb91
MD5 a52d696ed49dff307971ecc42a97cd82
BLAKE2b-256 48daa058f3197a40fe5860c0f70ca4d20c6de7d5642bc3457a811e633e8d3416

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page