https://github.com/ramusus/kinopoiskpy
Python API to kinopoisk.ru
https://github.com/ramusus/kinopoiskpy
api kinopoisk movie python python-api
Last synced: 5 months ago
JSON representation
Python API to kinopoisk.ru
- Host: GitHub
- URL: https://github.com/ramusus/kinopoiskpy
- Owner: ramusus
- License: bsd-3-clause
- Created: 2010-09-14T19:54:57.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2023-11-29T11:14:40.000Z (over 2 years ago)
- Last Synced: 2025-09-07T05:59:41.432Z (9 months ago)
- Topics: api, kinopoisk, movie, python, python-api
- Language: Python
- Homepage:
- Size: 9.52 MB
- Stars: 155
- Watchers: 11
- Forks: 48
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kinopoiskpy
[](https://pypi.python.org/pypi/kinopoiskpy)
[](https://circleci.com/gh/ramusus/kinopoiskpy)
[](https://coveralls.io/r/ramusus/kinopoiskpy)
[](https://travis-ci.org/ramusus/kinopoiskpy) [](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)