Skip to content

Commit 05064c3

Browse files
Fix docstring formatting issues
1 parent 319cb64 commit 05064c3

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

src/simplejustwatchapi/justwatch.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""Main module orchestrating requests to JustWatch GraphQL API.
22
Currently supported requests are:
3+
34
- ``search`` - search for entries via title
45
- ``details`` - get details for given node ID
56
- ``offers_for_countries`` - get all offers for entry with given node ID,
67
can look for offers for multiple countries
8+
79
"""
810

911
from httpx import post
@@ -82,18 +84,20 @@ def offers_for_countries(
8284
8385
Country codes passed as argument are case-insensitive, however keys in returned dict will match
8486
them exactly. E.g. for countries specified as:
87+
8588
.. code-block:: python
8689
8790
{"uK", "Us", "AU", "ca"}
8891
8992
returned dict will have the following structure:
93+
9094
.. code-block:: python
9195
9296
{
93-
"uK": [... offers ...],
94-
"Us": [... offers ...],
95-
"AU": [... offers ...],
96-
"ca": [... offers ...],
97+
"uK": [ ... offers ... ],
98+
"Us": [ ... offers ... ],
99+
"AU": [ ... offers ... ],
100+
"ca": [ ... offers ... ],
97101
}
98102
99103
``best_only`` allows filtering out redundant offers, e.g. when if provide offers service

src/simplejustwatchapi/query.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
"""Module responsible for creating GraphQL queries and parsing responses from JustWatch GraphQL API.
22
Parsed responses are returned as Python NamedTuples for easier access.
3-
Currently only responses from "GetSearchTitles" query are supported.
3+
Currently supported queries are:
4+
5+
- ``GetTitleNode``
6+
- ``GetSearchTitles``
7+
- ``GetTitleOffers``
8+
49
"""
510

611
from typing import NamedTuple
@@ -149,7 +154,8 @@
149154

150155

151156
class OfferPackage(NamedTuple):
152-
"""Parsed single offer package from JustWatch GraphQL API for single entry."""
157+
"""Parsed single offer package from JustWatch GraphQL API for single entry.
158+
Contains information about platform on which given offer is available."""
153159

154160
id: str
155161
package_id: int
@@ -159,7 +165,8 @@ class OfferPackage(NamedTuple):
159165

160166

161167
class Offer(NamedTuple):
162-
"""Parsed single offer from JustWatch GraphQL API for single entry."""
168+
"""Parsed single offer from JustWatch GraphQL API for single entry.
169+
One platform can have multiple offers for one entry available, e.g. renting, buying, etc."""
163170

164171
id: str
165172
monetization_type: str

0 commit comments

Comments
 (0)