Skip to main content

ema-data-access

Lightweight Python tools to query and access EMA data.

Setup

Python environment (Poetry)

  1. Install Poetry if you don't have it:

    curl -sSL https://install.python-poetry.org | python3 -
    
  2. Create a virtual environment in the project directory:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies:

    poetry install --extras "dev test"
    
  4. Install pre-commit hooks:

    poetry run pre-commit install
    

Command Line Utility

Query the ancillary table

Query the ancillary table for files matching a set of filters. An API key is optional — without one, only released files are returned.

$ EMA_API_KEY=<your-api-key> ema-data-access --url <url> query-ancillary --apid 1234 --file-extension csv

or with CLI flags

$ ema-data-access --url <url> --api-key <your-api-key> query-ancillary --apid 1234 --file-extension csv

Other available filters: --file-name, --timetag-start, --timetag-end, --version, --md5checksum. Results are returned as JSON.

Under the hood, this is equivalent to:

$ curl -H "x-api-key: $EMA_API_KEY" "<url>/query_ancillary?apid=1234&file_extension=csv"

Upload a file

Upload a local file to the EMA data archive. The file name must match a known EMA naming convention, and requires an API key with developer-level access — request one from the EMA PDC team.

$ EMA_API_KEY=<your-api-key> ema-data-access --url <url> upload path/to/ema_l1_anc_sc_1234_20240101.csv

or with CLI flags

$ ema-data-access --url <url> --api-key <your-api-key> upload path/to/ema_l1_anc_sc_1234_20240101.csv

Under the hood, this requests a presigned upload URL and then PUTs the file to it, equivalent to:

$ curl -X POST -H "x-api-key: $EMA_API_KEY" <url>/upload/ema_l1_anc_sc_1234_20240101.csv
# => {"upload_url": "<presigned-url>"}
$ curl -X PUT -T path/to/ema_l1_anc_sc_1234_20240101.csv "<presigned-url>"

Importing as a package

import ema_data_access

ema_data_access.config["DATA_ACCESS_URL"] = "<url>"
ema_data_access.config["API_KEY"] = "<your-api-key>"

results = ema_data_access.query_ancillary(apid=1234, file_extension="csv")

ema_data_access.upload("path/to/ema_l1_anc_sc_1234_20240101.csv")

Running tests

pytest

Metadata

Release files for ema-data-access 0.5.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 ema-data-access 0.5.0
File Size Uploaded
ema_data_access-0.5.0.tar.gz 7.8 kB Details

Release files / ema_data_access-0.5.0.tar.gz

Download URL ema_data_access-0.5.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2ff77f20989cb4538b6c61c55ad1a40e50f17864d17a625a3e79939fde6c9f4
BLAKE2b-256 checksum
How to use checksums
9bde49a066571cb5740a9a4b164d96a04fff2e520a0bc349e135daf652e2ac6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Aug 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.0

1 release file

This release

0.5.0 This release

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

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