Amplitude data wrapper
This is a wrapper for Amplitude APIs. You can use it to query and export data from your account and use the taxonomy API.
Built with requests, aiohttp and tqdm
Why use this package instead of other wrappers?
This package supports regions and so you can use it with Amplitude accounts in the EU and USA.
This package also supports using a proxy so you can keep your project API keys and API secrets confidential.
Supported Amplitude APIs and docs
See examples below and in example.py
Install with
pip install amplitude-data-wrapper
or
uv add amplitude-data-wrapper
Dashboard Rest API
Results from an existing chart
Get data from EU account by setting region="eu".
import amplitude_data_wrapper.analytics_api as amp
# without proxy
r = amp.get_chart(api_key=api_key, secret=api_secret, chart_id=chart_id_eu, region="eu")
r.status_code
r.json() # returns data as json
Get data from US account by setting region="us".
r = amp.get_chart(api_key=api_key, secret=api_secret, chart_id=chart_id_us, region="us")
r.json() # returns data as json
Get data from EU account with a proxy by setting region and proxy using a dictionary.
# with proxy
proxies = {"http": "http://myproxy.example.org/method"}
r = amp.get_chart(api_key, api_secret, chart_id_eu, region="eu", proxy=proxies)
r.status_code # print status code
Event segmentation lets you export events with segments and filters.
our_event_dict = {
"event_type": "pageview",
"group_by": [{"type": "event", "value": "app"}, {"type": "event", "value": "team"}],
}
data = amp.get_event_segmentation(
api_key=api_key,
secret=api_secret,
start="20220601",
end="20220602",
event=our_event_dict,
metrics="uniques",
interval=1,
limit=1000,
)
User search lets you search for a user with a specific Amplitude ID, Device ID, User ID, or User ID prefix.
user = amp.find_user(
user=example_id_eu, api_key=api_key, secret=api_secret, region="eu"
)
Async chart downloads
You can also download chart data asynchronously. This is more efficient when downloading lots of charts at once. See example-async.py for an example program.
PS! Since this uses asyncio I recommend running asynchronous requests as a separate program, not from a jupyter notebook.
Privacy API
Delete user data with a deletion job
deleteme = amp.delete_user_data(
user["matches"][0]["amplitude_id"],
email=email,
api_key=api_key,
secret=api_secret,
region="eu",
ignore_invalid_id=True,
delete_from_org=False,
)
tobe_deleted = amp.get_deletion_jobs(
start="2022-06-01",
end="2022-07-01",
api_key=api_key,
secret=api_secret,
region="eu",
)
Cohort API
proxies = {"http": "http://myproxy.domain.org/path"}
file_path = "path-to/cohortdata.csv"
kull = amp.get_cohort(
api_key,
api_secret,
cohort_id,
filename=file_path,
props=1,
region="eu",
proxy=proxies,
)
Export API
Export API - Export your project's event data
start = "20220601T00"
end = "20220601T01"
data = amp.export_project_data(
start=start,
end=end,
api_key=api_key,
secret=api_secret,
filename="path-to/projectdata_eu.zip",
region="eu",
)
Taxonomy API
types = amp.get_all_event_types(api_key=api_key, secret=api_secret, region="eu")
Metadata
Release files for amplitude-data-wrapper 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| amplitude_data_wrapper-0.7.1.tar.gz | 10.6 kB | With provenance | Details for amplitude_data_wrapper-0.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amplitude_data_wrapper-0.7.1-py3-none-any.whl | Python 3 | none | any | Details for amplitude_data_wrapper-0.7.1-py3-none-any.whl |
Total release size: 20.4 kB
Release files / amplitude_data_wrapper-0.7.1.tar.gz
| Download URL | amplitude_data_wrapper-0.7.1.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b381e2d60f65a5584376cf99144f10909580023473e8b790848d61fbd9c1c1b
|
|
BLAKE2b-256 checksum How to use checksums |
85599e47aa24174fe781c2108360accd8f587d62e19f821abb1625491974313e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / amplitude_data_wrapper-0.7.1-py3-none-any.whl
| Download URL | amplitude_data_wrapper-0.7.1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c82d4649c4b37249bfa66ed94dfd9a47949232134d26fbe5fdeb8385c5ecde00
|
|
BLAKE2b-256 checksum How to use checksums |
4456866ef7b74ec5ac993ebbe4e46745e0c97bcbcd9d98910b3fd1719a724fab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for amplitude-data-wrapper 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for amplitude_data_wrapper-0.7.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.