Skip to main content

Google Play Store async application scraper

Project description


Asynchronously scrapes and parses application data from the Google Play Store.
(Fork of play-scraper, a synchronous Google Play Store scraper, https://github.com/danieliu/play-scraper)

### Installation

Install with pip.

```
pip install playmate
```

#### details

Fetch an application's details.

```python
async with PlayMate() as mate:
app_info = await mate.get_app_details(app_id)
```
* `app_id` the app id to get, e.g. `com.android.chrome` for Google Chrome.


#### collection

Fetch a list of applications from a collection, optionally filtered by category.

```python
async with PlayMate() as mate:
collection = await mate.get_apps(
coln_id, catg_id, max_page=max_page
)
```
* `coln_id` a [collection](https://github.com/Gulats/playmate/blob/master/playmate/lists.py#L3) to fetch.
* `catg_id` a [category](https://github.com/Gulats/playmate/blob/master/playmate/lists.py#L12) to filter by.
* `max_page` (default 1, max 5) the number of pages to fetch with each page containing 120 records.


#### search

Fetch a list of applications matching a search query. Retrieves `20` apps at a time.

```python
async with PlayMate() as mate:
search_results = await mate.search_apps(
term, max_page=max_page
)
```
* `term` query term(s) to search for.
* `max_page` (default 1, max 5) the number of pages to fetch with each page containing 48 records.


#### similar

Fetch a list of similar applications.

```python
async with PlayMate() as mate:
similar_apps = await mate.get_similar_apps(app_id)
```
* `app_id` the app id to get, e.g. `com.supercell.clashofclans` for Clash of Clans.


#### custom settings

Add customisation to the request

```python
async with PlayMate(
headers=dict(Origin='https://play.google.com'),
timeout=180,
hl='en', gl='us') as mate:
app_info = await mate.get_app_details(app_id)
```
* `headers` the headers to be sent for each request
* `timeout` the total timeout for each request in seconds
* `hl` (default `en` for English) the language code to receive results in a specific language
* `gl` (default `us` for United States) the country code to receive results based from a specific country


#### manually close session

Manually close a persisted session

```python
mate = PlayMate()
app_info = await mate.get_app_details(app_id)
await mate.close()
```


### Tests

Run test:
```
make test
```
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

playmate-0.5.3.tar.gz (16.4 kB view details)

Uploaded Source

File details

Details for the file playmate-0.5.3.tar.gz.

File metadata

  • Download URL: playmate-0.5.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for playmate-0.5.3.tar.gz
Algorithm Hash digest
SHA256 4b4ae276ae38f0afdf8a83090dcd117d145fabc5420c1a181741a8f85f301e21
MD5 d24d33006a5a60e24ee2937db46f940d
BLAKE2b-256 7c83e5b5edc834a6211ac3aba989d1eae70cc3c5f60877adfa537b98fd06c585

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page