A command-line tool for downloading APK files from various sources
This project has been quarantined.
PyPI Admins need to review this project before it can be restored. While in quarantine, the project is not installable by clients, and cannot be being modified by its maintainers.
Read more in the project in quarantine help article.
Project description
apkeep - A command-line tool for downloading APK files from various sources
This is the Python port of apkeep.
It exposes the exact same CLI surface and produces the same human-readable
and JSON output as the Rust version, while being installable from PyPI and
embeddable in any Python project.
Installation
pip install apkeep
To enable Google Play downloads, install the google-play extra:
pip install 'apkeep[google-play]'
This will also install the gpapi Python
package which is used as the underlying Google Play client.
Usage
Downloads APKs from various sources
Usage: apkeep <-a app_id[@version] | -c csv [-f field] [-v version_field]> [-d download_source] [-r parallel] OUTPATH
Arguments:
[OUTPATH] Path to store output files
Options:
-a, --app <app>
Provide the ID and optionally the version of an app directly (e.g. com.instagram.android)
-c, --csv <csv>
CSV file to use
-f, --field <field>
CSV field containing app IDs (used only if CSV is specified) [default: 1]
-v, --version-field <version_field>
CSV field containing versions (used only if CSV is specified)
-l, --list-versions
List the versions available
-d, --download-source <download_source>
Where to download the APKs from [default: apk-pure] [possible values: apk-pure, google-play, f-droid, huawei-app-gallery]
-o, --options <options>
A comma-separated list of additional options to pass to the download source
-i, --ini <ini>
The path to an ini file which contains configuration data
--oauth-token <google_oauth_token>
Google oauth token, required to retrieve long-lived aas token
-e, --email <google_email>
Google account email address (required if download source is Google Play)
-t, --aas-token <google_aas_token>
Google aas token (required if download source is Google Play)
--auth-token <google_auth_token>
Google auth token (alternative to aas-token, e.g., from Aurora dispenser)
--accept-tos
Accept Google Play Terms of Service
-s, --sleep-duration <sleep_duration>
Sleep duration (in ms) before download requests [default: 0]
-r, --parallel <parallel>
The number of parallel APK fetches to run at a time [default: 4]
-h, --help
Print help
-V, --version
Print version
Examples
The simplest example is to download a single APK to the current directory:
apkeep -a com.instagram.android .
This downloads from the default source, APKPure, which does not require credentials.
To download directly from the Google Play Store, you will first have to obtain an AAS token. Then:
apkeep -a com.instagram.android -d google-play -e 'someone@gmail.com' -t aas_token .
To download from the F-Droid open source repository:
apkeep -a org.mozilla.fennec_fdroid -d f-droid .
Or, to download from the Huawei AppGallery:
apkeep -a com.elysiumlabs.newsbytes -d huawei-app-gallery .
To download a specific version of an APK (possible for APKPure or F-Droid),
use the @version convention:
apkeep -a com.instagram.android@1.2.3 .
Or, to list what versions are available, use -l:
apkeep -l -a org.mozilla.fennec_fdroid -d f-droid
Specify a CSV file or individual app ID
You can either specify a CSV file which lists the apps to download, or an
individual app ID. If you specify a CSV file and the app ID is not specified
by the first column, you'll have to use the --field option as well. If you
have a simple file with one app ID per line, you can just treat it as a CSV
with a single field.
Download Sources
You can use this tool to download from a few distinct sources:
- The Google Play Store (
-d google-play), given an email address and AAS token. - APKPure (
-d apk-pure), a third-party site hosting APKs available on the Play Store. - F-Droid (
-d f-droid), a repository for free and open-source Android apps.apkeepverifies that these APKs are signed by the F-Droid maintainers and alerts the user if an APK was downloaded but could not be verified. - The Huawei AppGallery (
-d huawei-app-gallery), an app store popular in China.
Notes on the Python port
- The CLI flags, defaults, exit codes, and the format of
--list-versionsoutput (both plaintext and JSON via-o output_format=json) match the Rust binary. - APKPure, F-Droid (with full PKCS#7 signature + SHA1/SHA256 verification), and Huawei AppGallery sources are fully supported and require no extra dependencies beyond the base install.
- Google Play support is provided through the optional
gpapiPython package. Some advanced Rust-only options (include_dex_metadata) are surfaced but log a clear notice when ignored.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apkeep-1.0.1.tar.gz.
File metadata
- Download URL: apkeep-1.0.1.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ed352204b9ea575bcdc13aa302b7b9c061e1923fca66127fb88edf6887afbc9
|
|
| MD5 |
167796db5724bd3153e4646aee72ba47
|
|
| BLAKE2b-256 |
19b0a6ba17ae5247cdc08fa806aa2de4243b36a3e2b66f5faeb71c81139f162c
|
File details
Details for the file apkeep-1.0.1-py3-none-any.whl.
File metadata
- Download URL: apkeep-1.0.1-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff4627da6f3e2b8ba5a24550f3efed2055fc02cb5c1a17202ad031e6028b78d
|
|
| MD5 |
ef6a55f636bedfc797ebbc55a0e39591
|
|
| BLAKE2b-256 |
bf6fe5edc089ed11b88f8798eb2bae3e5ea1840783ab094368bd026a607dcc26
|