kinopoisk-dev


Namekinopoisk-dev JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/odi1n/kinopoisk_dev
SummaryРеализация Api для сервиса kinopoisk.dev
upload_time2023-03-11 15:06:11
maintainer
docs_urlNone
authorYour Name
requires_python>=3.9,<4.0
licenseMIT
keywords kinopoisk kinopoisk api kinopoisk dev kinopoisk dev api api dev
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <h1>Kinopoisk Dev Api</h1>
    <p>Python-модуль для взаимодействия с неофициальным <a href="https://kinopoisk.dev/">API КиноПоиска</a></p>
</div>

## Установка

### Pip

```
pip install kinopoisk-dev
```

### Poetry

```
poetry add kinopoisk-dev
```

## Получение токена

Для получения токена необходимо перейти [kinopoisk.dev](https://kinopoisk.dev/documentation.html) и написать по
контактам.

## Методы взаимодействия

### Random

Получить рандомный тайтл из базы

- Endpoint - `/v1/movie/random`
- [Примеры](./example/example_movie_random.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.arandom())
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = kp.random()
```

### Possible values by field

Получить все возможные значения полей

- Endpoint - `/v1/movie/possible-values-by-field`
- [Примеры](./example/example_movie_possible_values_by_field.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev, PossValField

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.apossible_values_by_field(params=PossValField.GENRES))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, PossValField

kp = KinopoiskDev(token=TOKEN)
item = kp.possible_values_by_field(params=PossValField.GENRES)
```

### Movies

Поиск тайтлов

- Ендпоинт - `/v1/movie/`
- [Примеры](./example/example_movie.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev, MovieParams, MovieField

kp = KinopoiskDev(token=TOKEN)
items = asyncio.run(kp.afind_many_movies(params=[
    MovieParams(keys=MovieField.name, value="Аватар"),
    MovieParams(keys=MovieField.page, value="1"),
    MovieParams(keys=MovieField.limit, value="1000")
]))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, MovieParams, MovieField

kp = KinopoiskDev(token=TOKEN)
items = kp.find_many_movies(params=[
    MovieParams(keys=MovieField.name, value="Аватар"),
    MovieParams(keys=MovieField.page, value="1"),
    MovieParams(keys=MovieField.limit, value="1000")
])
```

### Movie

Поиск по id

- Ендпоинт - `/v1/movie/{id}`
- [Примеры](./example/example_movie_id.py)

#### Async

```python
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.afind_one_movie(666))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = kp.find_one_movie(666)
```

### Season

- Ендпоинт - `/v1/season`
- [Пример](./example/example_season.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev, SeasonParams, SeasonField

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.aseasons(params=[
    SeasonParams(keys=SeasonField.PAGE, value=1),
    SeasonParams(keys=SeasonField.LIMIT, value=100)
]))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, SeasonParams, SeasonField

kp = KinopoiskDev(token=TOKEN)
item = kp.seasons(params=[
    SeasonParams(keys=SeasonField.PAGE, value=1),
    SeasonParams(keys=SeasonField.LIMIT, value=100)
])
```

### Review

- Ендпоинт - `/v1/review`
- [Пример](./example/example_review.py)

#### Async

```python
import asyncio

from kinopoisk_dev import KinopoiskDev, ReviewParams, ReviewField

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.areview(params=[
    ReviewParams(keys=ReviewField.PAGE, value=1),
    ReviewParams(keys=ReviewField.LIMIT, value=100)
]))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, ReviewParams, ReviewField

kp = KinopoiskDev(token=TOKEN)
item = kp.review(params=[
    ReviewParams(keys=ReviewField.PAGE, value=1),
    ReviewParams(keys=ReviewField.LIMIT, value=100)
])
```

### Persons

- Ендпоинт - `/v1/person`
- [Пример](./example/example_person.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev, PersonParams, PersonField

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.afind_many_person(params=[
    PersonParams(keys=PersonField.PAGE, value=1),
    PersonParams(keys=PersonField.LIMIT, value=100)
]))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, PersonParams, PersonField

kp = KinopoiskDev(token=TOKEN)
item = kp.find_many_person(params=[
    PersonParams(keys=PersonField.PAGE, value=1),
    PersonParams(keys=PersonField.LIMIT, value=100)
])
```

### Person

- Ендпоинт - `/v1/person/{id}`
- [Пример](./example/example_person_id.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.afind_one_person(24262))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev

kp = KinopoiskDev(token=TOKEN)
item = kp.find_one_person(24262)
```

### Image

- Ендпоинт - `/v1/image`
- [Пример](./example/example_image.py)

#### Async

```python
import asyncio
from kinopoisk_dev import KinopoiskDev, ImageParams, ImageField

kp = KinopoiskDev(token=TOKEN)
item = asyncio.run(kp.aimage(params=[
    ImageParams(keys=ImageField.PAGE, value=1),
    ImageParams(keys=ImageField.LIMIT, value=100)
]))
```

#### Sync

```python
from kinopoisk_dev import KinopoiskDev, ImageParams, ImageField

kp = KinopoiskDev(token=TOKEN)
item = kp.image(params=[
    ImageParams(keys=ImageField.PAGE, value=1),
    ImageParams(keys=ImageField.LIMIT, value=100)
])

```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/odi1n/kinopoisk_dev",
    "name": "kinopoisk-dev",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "kinopoisk,kinopoisk api,kinopoisk dev,kinopoisk dev api,api,dev",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/60/14/122bfd0437b1f3aaf36b3afc1e27086ff36ec736d0197af0e033198b3120/kinopoisk_dev-0.2.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <h1>Kinopoisk Dev Api</h1>\n    <p>Python-\u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0435\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c <a href=\"https://kinopoisk.dev/\">API \u041a\u0438\u043d\u043e\u041f\u043e\u0438\u0441\u043a\u0430</a></p>\n</div>\n\n## \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n\n### Pip\n\n```\npip install kinopoisk-dev\n```\n\n### Poetry\n\n```\npoetry add kinopoisk-dev\n```\n\n## \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430\n\n\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 [kinopoisk.dev](https://kinopoisk.dev/documentation.html) \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\n\u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\u043c.\n\n## \u041c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\n\n### Random\n\n\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u0439 \u0442\u0430\u0439\u0442\u043b \u0438\u0437 \u0431\u0430\u0437\u044b\n\n- Endpoint - `/v1/movie/random`\n- [\u041f\u0440\u0438\u043c\u0435\u0440\u044b](./example/example_movie_random.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.arandom())\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.random()\n```\n\n### Possible values by field\n\n\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439\n\n- Endpoint - `/v1/movie/possible-values-by-field`\n- [\u041f\u0440\u0438\u043c\u0435\u0440\u044b](./example/example_movie_possible_values_by_field.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev, PossValField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.apossible_values_by_field(params=PossValField.GENRES))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, PossValField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.possible_values_by_field(params=PossValField.GENRES)\n```\n\n### Movies\n\n\u041f\u043e\u0438\u0441\u043a \u0442\u0430\u0439\u0442\u043b\u043e\u0432\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/movie/`\n- [\u041f\u0440\u0438\u043c\u0435\u0440\u044b](./example/example_movie.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev, MovieParams, MovieField\n\nkp = KinopoiskDev(token=TOKEN)\nitems = asyncio.run(kp.afind_many_movies(params=[\n    MovieParams(keys=MovieField.name, value=\"\u0410\u0432\u0430\u0442\u0430\u0440\"),\n    MovieParams(keys=MovieField.page, value=\"1\"),\n    MovieParams(keys=MovieField.limit, value=\"1000\")\n]))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, MovieParams, MovieField\n\nkp = KinopoiskDev(token=TOKEN)\nitems = kp.find_many_movies(params=[\n    MovieParams(keys=MovieField.name, value=\"\u0410\u0432\u0430\u0442\u0430\u0440\"),\n    MovieParams(keys=MovieField.page, value=\"1\"),\n    MovieParams(keys=MovieField.limit, value=\"1000\")\n])\n```\n\n### Movie\n\n\u041f\u043e\u0438\u0441\u043a \u043f\u043e id\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/movie/{id}`\n- [\u041f\u0440\u0438\u043c\u0435\u0440\u044b](./example/example_movie_id.py)\n\n#### Async\n\n```python\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.afind_one_movie(666))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.find_one_movie(666)\n```\n\n### Season\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/season`\n- [\u041f\u0440\u0438\u043c\u0435\u0440](./example/example_season.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev, SeasonParams, SeasonField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.aseasons(params=[\n    SeasonParams(keys=SeasonField.PAGE, value=1),\n    SeasonParams(keys=SeasonField.LIMIT, value=100)\n]))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, SeasonParams, SeasonField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.seasons(params=[\n    SeasonParams(keys=SeasonField.PAGE, value=1),\n    SeasonParams(keys=SeasonField.LIMIT, value=100)\n])\n```\n\n### Review\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/review`\n- [\u041f\u0440\u0438\u043c\u0435\u0440](./example/example_review.py)\n\n#### Async\n\n```python\nimport asyncio\n\nfrom kinopoisk_dev import KinopoiskDev, ReviewParams, ReviewField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.areview(params=[\n    ReviewParams(keys=ReviewField.PAGE, value=1),\n    ReviewParams(keys=ReviewField.LIMIT, value=100)\n]))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, ReviewParams, ReviewField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.review(params=[\n    ReviewParams(keys=ReviewField.PAGE, value=1),\n    ReviewParams(keys=ReviewField.LIMIT, value=100)\n])\n```\n\n### Persons\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/person`\n- [\u041f\u0440\u0438\u043c\u0435\u0440](./example/example_person.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev, PersonParams, PersonField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.afind_many_person(params=[\n    PersonParams(keys=PersonField.PAGE, value=1),\n    PersonParams(keys=PersonField.LIMIT, value=100)\n]))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, PersonParams, PersonField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.find_many_person(params=[\n    PersonParams(keys=PersonField.PAGE, value=1),\n    PersonParams(keys=PersonField.LIMIT, value=100)\n])\n```\n\n### Person\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/person/{id}`\n- [\u041f\u0440\u0438\u043c\u0435\u0440](./example/example_person_id.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.afind_one_person(24262))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.find_one_person(24262)\n```\n\n### Image\n\n- \u0415\u043d\u0434\u043f\u043e\u0438\u043d\u0442 - `/v1/image`\n- [\u041f\u0440\u0438\u043c\u0435\u0440](./example/example_image.py)\n\n#### Async\n\n```python\nimport asyncio\nfrom kinopoisk_dev import KinopoiskDev, ImageParams, ImageField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = asyncio.run(kp.aimage(params=[\n    ImageParams(keys=ImageField.PAGE, value=1),\n    ImageParams(keys=ImageField.LIMIT, value=100)\n]))\n```\n\n#### Sync\n\n```python\nfrom kinopoisk_dev import KinopoiskDev, ImageParams, ImageField\n\nkp = KinopoiskDev(token=TOKEN)\nitem = kp.image(params=[\n    ImageParams(keys=ImageField.PAGE, value=1),\n    ImageParams(keys=ImageField.LIMIT, value=100)\n])\n\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Api \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 kinopoisk.dev",
    "version": "0.2.0",
    "split_keywords": [
        "kinopoisk",
        "kinopoisk api",
        "kinopoisk dev",
        "kinopoisk dev api",
        "api",
        "dev"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6eb43ad022f23884724e16577d1a6925b8327f3d18570b9741d0dd189f69942a",
                "md5": "788c61d7b8c0536b13be6109bbc5f3d8",
                "sha256": "030b425f0e0902f494335e8d4be7a13909dd61c9f2f9e5677230cf0f2324e0e5"
            },
            "downloads": -1,
            "filename": "kinopoisk_dev-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "788c61d7b8c0536b13be6109bbc5f3d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 14397,
            "upload_time": "2023-03-11T15:06:08",
            "upload_time_iso_8601": "2023-03-11T15:06:08.560295Z",
            "url": "https://files.pythonhosted.org/packages/6e/b4/3ad022f23884724e16577d1a6925b8327f3d18570b9741d0dd189f69942a/kinopoisk_dev-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6014122bfd0437b1f3aaf36b3afc1e27086ff36ec736d0197af0e033198b3120",
                "md5": "c8376da37091738c52fa50014e6476fb",
                "sha256": "33469d9ae2e75447af61eb40cd963387beaad1a32aca693d1f7287e862aa25ae"
            },
            "downloads": -1,
            "filename": "kinopoisk_dev-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c8376da37091738c52fa50014e6476fb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 10963,
            "upload_time": "2023-03-11T15:06:11",
            "upload_time_iso_8601": "2023-03-11T15:06:11.479053Z",
            "url": "https://files.pythonhosted.org/packages/60/14/122bfd0437b1f3aaf36b3afc1e27086ff36ec736d0197af0e033198b3120/kinopoisk_dev-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-11 15:06:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "odi1n",
    "github_project": "kinopoisk_dev",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "kinopoisk-dev"
}
        
Elapsed time: 0.15391s