Skip to content

Commit 3be90c7

Browse files
Update README.md
1 parent bfb10e7 commit 3be90c7

File tree

1 file changed

+59
-2
lines changed

1 file changed

+59
-2
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,66 @@
88
[![Coverage Status](https://coveralls.io/repos/github/Electronic-Mango/simple-justwatch-python-api/badge.svg?branch=main)](https://coveralls.io/github/Electronic-Mango/simple-justwatch-python-api?branch=main)
99
[![PyPI - Version](https://img.shields.io/pypi/v/simple-justwatch-python-api)](https://pypi.org/project/simple-justwatch-python-api/)
1010

11-
A simple unofficial JustWatch Python API which uses [`GraphQL`](https://graphql.org/) to access JustWatch data.
11+
A simple unofficial JustWatch Python API which uses [`GraphQL`](https://graphql.org/) to access JustWatch data, built with [`httpx`](https://www.python-httpx.org/) and `Python3.11`.
1212

13-
Built with [`httpx`](https://www.python-httpx.org/) and `Python3.11`.
13+
14+
15+
## Installation
16+
17+
Project is available in [PyPi](https://pypi.org/project/simple-justwatch-python-api/):
18+
```bash
19+
pip install simple-justwatch-python-api
20+
```
21+
22+
23+
24+
## Usage
25+
26+
Currently, there's only one function available - search JustWatch:
27+
```python
28+
from simplejustwatchpythonapi.justwatch import search
29+
30+
results = search("title", "US", "en", 5, True)
31+
```
32+
33+
Only the first argument is required, it specifies a title to search.
34+
35+
Other arguments in order are:
36+
1. `str` country code to search for offers, have to be a 2-letter code, e.g. `US`, `GB`, `FR`, etc.
37+
It should be uppercase, however lowercase codes are automatically converted to uppercase. By default `US` is used.
38+
2. `str` language code, usually 2-letter lowercase code, e.g. `en`, `fr`, etc. By default `en` is used.
39+
3. `int` how many results should be returned. Actual response can contain fewer entries if fewer are found.
40+
By default `4` is used.
41+
4. `bool` specify if only best offers should be returned (`True`) or all offers (`False`).
42+
By default `True` is used.
43+
44+
Returned value is a list of `MediaEntry` objects:
45+
```python
46+
class MediaEntry(NamedTuple):
47+
entry_id: str
48+
object_id: int
49+
object_type: str
50+
title: str
51+
url: str
52+
release_year: int
53+
release_date: str
54+
genres: list[str]
55+
imdb_id: str | None
56+
poster: str
57+
backdrops: list[str]
58+
offers: list[Offer]
59+
60+
class Offer(NamedTuple):
61+
monetization_type: str
62+
presentation_type: str
63+
url: str
64+
price_string: str | None
65+
price_value: float | None
66+
price_currency: str
67+
name: str
68+
technical_name: str
69+
icon: str
70+
```
1471

1572

1673

0 commit comments

Comments
 (0)