FXMacroData for Hugging Face Datasets
Build a datasets.Dataset directly from FXMacroData macroeconomic releases, FX
reference rates, commodities, positioning and calendar data. Use the result with
the Hugging Face ecosystem: map, filter, Arrow and Parquet export, pandas and
Polars conversion, or model training inputs.
Install
Requires Python 3.10 or later and datasets 5.x. Install this package and its
public client dependencies from the distribution supplied to you:
python -m pip install /path/to/fxmacrodata-public-client /path/to/fxmacrodata-platform-core /path/to/datasets-fxmacrodata
Example
USD indicators are readable without a key:
from fxmacrodata_datasets_hf import load_dataset_fxmacrodata
dataset = load_dataset_fxmacrodata(
"indicator_history", {"currency": "usd", "indicator": "policy_rate"}
)
print(dataset)
print(dataset.features)
print(dataset.filter(lambda row: row["value"] is not None).to_pandas().head())
With a subscription, set FXMD_API_KEY in your environment or secret manager
and pass its name:
dataset = load_dataset_fxmacrodata(
"forex", {"base": "EUR", "quote": "USD", "start_date": "2024-01-01"},
api_key_env="FXMD_API_KEY",
)
dataset.to_parquet("eurusd.parquet")
api_key_env is an environment variable name, never an API key. Omitting it
explicitly selects anonymous access. Credentials do not belong in arguments,
notebooks, dataset cards or source control; the package never stores or prints
them.
Every operation listed by fxmacrodata_platform_core.operations() is supported,
including the mcp_ tools. Historical operations follow all pages by default;
complete_history=False requests the supplied page only. max_pages (default
10,000) raises on an incomplete history instead of silently truncating it.
to_dataset(batch) converts a Batch you have already read, and features()
returns the schema without a request.
Data semantics
The dataset has fixed Features: value is a nullable float64; operation,
source_url, record_id, currency, indicator, date,
announcement_datetime, value_text, record_json and response_json are
nullable strings. record_json preserves the original record and response_json
preserves the complete response envelope, including metadata and revisions.
Dates and announcement times remain source strings; no publication time is
inferred and no missing value is filled. value_text keeps numbers the source
supplied as strings.
An empty response still produces one envelope row with record_json = "null",
so absence of data and the server's metadata remain inspectable. It is not an
observation. record_id is a stable hash of the operation and original record,
so reading the same data again yields the same identifiers and repeated reads
can be deduplicated on it (at-least-once delivery, idempotent key).
The dataset's info.description states that the rows are a live read made under
your own FXMacroData access and licence. It is not a redistributed snapshot.
Building a dataset does not grant permission to publish it to the Hub or to
resell it; onward distribution remains subject to your subscription terms.
Development
Run the offline tests with python -m pytest tests -q. They build in-memory
datasets from fixture responses and never contact the Hugging Face Hub or the
live service.
Metadata
Release files for datasets-fxmacrodata 0.1.0
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 |
|---|---|---|---|---|
| datasets_fxmacrodata-0.1.0.tar.gz | 6.8 kB | Without provenance | Details for datasets_fxmacrodata-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasets_fxmacrodata-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for datasets_fxmacrodata-0.1.0-py3-none-any.whl |
Total release size: 12.4 kB
Release files / datasets_fxmacrodata-0.1.0.tar.gz
| Download URL | datasets_fxmacrodata-0.1.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61374aa9bcd45db8fb14e1be3ff157a5471eba5ae28bae61adca20c78bd0b7eb
|
|
BLAKE2b-256 checksum How to use checksums |
7919f502360d7c0c5cb3c2f51def511fa161726b03c5376d9bad7914082361b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Release files / datasets_fxmacrodata-0.1.0-py3-none-any.whl
| Download URL | datasets_fxmacrodata-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53f48ee90486e20d1947b520b1edab9ae2104365ed64a5e8fe66e3fd6218e9eb
|
|
BLAKE2b-256 checksum How to use checksums |
873c58b1f38bf9ce3f9c326388dca978962f34bc18c80605ba79aa19c2dbce12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Security for datasets-fxmacrodata 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.