Skip to main content

Amplitude data wrapper

Ruff

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,
)

Get a list of deletion jobs

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

Getting one cohort

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

Get all event types

types = amp.get_all_event_types(
    api_key=api_key, 
    secret=api_secret, 
    region="eu")

Metadata

Release files for amplitude-data-wrapper 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amplitude-data-wrapper 0.7.0
File Size Uploaded Provenance Actions
amplitude_data_wrapper-0.7.0.tar.gz 10.1 kB With provenance Details for amplitude_data_wrapper-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amplitude-data-wrapper 0.7.0
File Interpreter ABI Platform Actions
amplitude_data_wrapper-0.7.0-py3-none-any.whl Python 3 none any Details for amplitude_data_wrapper-0.7.0-py3-none-any.whl

Total release size: 19.7 kB

Release files / amplitude_data_wrapper-0.7.0.tar.gz

Download URL amplitude_data_wrapper-0.7.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
89a4dbb51a5097585487ed41a3859f6120710088365de117c173a82e36160b3c
BLAKE2b-256 checksum
How to use checksums
c61a01e5de0574792d99808a29f31afccaf192230e8d5de62e3bbe229693fef7
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 11, 2026.

Transparency log

Release files / amplitude_data_wrapper-0.7.0-py3-none-any.whl

Download URL amplitude_data_wrapper-0.7.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3435f069d3b590aaf18101db8b11fc62bc1d263fd44f3e6cacfe51884fd7078d
BLAKE2b-256 checksum
How to use checksums
4d7f61741084e8dd80b76d5caba5b78acfe8624184a562e57c81ad38445d7d9a
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 11, 2026.

Transparency log

Security for amplitude-data-wrapper 0.7.0

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.

Select from 2 files

Attestation for amplitude_data_wrapper-0.7.0.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 11, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page