Skip to content

Commit 357138b

Browse files
committed
docs: extend docstrings
1 parent 337042f commit 357138b

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

src/app_store_web_scraper/_entry.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ class AppReview:
4646
class AppStoreEntry:
4747
"""
4848
Represents an app in the app store.
49+
50+
:param app_id:
51+
ID of the app in the App Store. It can be found in the last path
52+
segment of the app's App Store URL (remove the "id" prefix).
53+
54+
:param country:
55+
Two-letter ISO code of the country where the app should be looked up.
56+
Both lowercase ("de") and uppercase ("FI") codes are accepted. The
57+
:meth:`reviews` method will only return reviews from users of that
58+
country.
59+
60+
:param session:
61+
The :class:`AppStoreSession` to use for communicating with the App
62+
Store. If not specified, a new session is created internally. Use
63+
this option to share the same session between entries to increase
64+
efficiency (by using a shared HTTP connection pool) or to pass a
65+
session with custom configuration parameters.
4966
"""
5067

5168
def __init__(
@@ -64,13 +81,24 @@ def __init__(
6481

6582
def reviews(self, limit: int = 0) -> Iterator[AppReview]:
6683
"""
67-
Fetch app reviews from the App Store and return them as an iterator.
84+
Return an iterator that fetches app reviews from the App Store.
6885
6986
As the list of reviews is paginated, iterating over all reviews
7087
triggers an additional HTTP request to the App Store's backend whenever
7188
a new page needs to be fetched. For this reason, it is possible that
7289
the iterator raises an error even after some reviews were already
7390
returned.
91+
92+
Note that only reviews from the App Store entry's country are returned.
93+
Also, the App Store's API only returns a subset of all reviews ever
94+
given to the app, so it is normal that the numer of retrieved reviews
95+
does not match the review count on the App Store page.
96+
97+
:param limit:
98+
The maximum number of reviews to return.
99+
100+
:return:
101+
An iterator that lazily fetches the app's reviews.
74102
"""
75103
path = f"/v1/catalog/{self.country}/apps/{self.app_id}/reviews"
76104

0 commit comments

Comments
 (0)