FXMacroData for Apache Iceberg
Load FXMacroData public responses into Apache Iceberg tables with PyIceberg. Keep macro announcements, calendars, FX and positioning data in the same catalog as your own tables while retaining the source payload and revision metadata.
Install
Requires Python 3.10 or later and PyIceberg 0.12 or later. Install this
package and its adjacent public client dependencies from the distribution
supplied to you, together with the PyIceberg extras for your catalog and
object store (for example pyiceberg[sql-sqlite], pyiceberg[glue] or
pyiceberg[s3fs]):
python -m pip install /path/to/fxmacrodata-public-client /path/to/fxmacrodata-platform-core /path/to/pyiceberg-fxmacrodata
Example
USD data is available without a key:
from pyiceberg.catalog import load_catalog
from fxmacrodata_platform_core import read
from fxmacrodata_iceberg import load
catalog = load_catalog("default") # configured in ~/.pyiceberg.yaml
batch = read("indicator_history", {"currency": "usd", "indicator": "policy_rate"})
result = load(batch, catalog, "analytics.fxmacrodata", batch_size=1000)
print(result.rows, "envelopes appended in", result.batches, "blocks")
The namespace (analytics) must already exist. By default the loader creates
the table if absent through catalog.create_table_if_not_exists; set
create_table=False to use a table provisioned by your administrator, and
iceberg_schema() returns the schema it expects. Identifiers are dotted
simple names with at least a namespace and a table (analytics.fxmacrodata),
or a tuple of parts. Quoted names, SQL fragments and URL-like names are
rejected before the catalog is contacted.
Credentials
Set FXMD_API_KEY in your environment or secret manager and pass its name
to read (or to load_operation) through api_key_env. Omit it for
anonymous access. Catalog and object-store credentials belong to the
PyIceberg catalog object you construct and pass in; this package never builds
connection settings or reads destination secrets.
Data semantics
Columns are operation, source_url, record_id, currency, indicator,
date, announcement_datetime, value, value_text, record_json,
response_json and the loader's content_hash. Only value is numeric
(optional double); every other column is an optional string. The schema
declares no identifier fields. record_json retains the original record and
response_json retains the complete response, including pagination and
metadata. An empty response produces one envelope row with
record_json = 'null', so absence of data and the server's metadata remain
inspectable; it is not an observation. Dates and announcement times remain
source strings. No publication time is inferred and no missing value is
filled. content_hash is the SHA-256 of the canonical JSON of the ten
source columns.
Delivery guarantee
load appends bounded blocks of batch_size rows (1 to 10,000) through
Table.append, each block as its own snapshot. Delivery is at-least-once:
repeating a load appends the same envelopes again, and a failed block is not
retried automatically; earlier blocks may already be committed. Deduplicate
downstream with a MERGE INTO keyed on operation, record_id and
content_hash in your query engine (Spark, Trino, Dremio, Flink) when you
need exactly-once storage semantics. Changed record data or response
metadata produces a distinct content_hash with the same record_id.
load_operation reads one operation and loads it in one call. It accepts
api_key_env, complete_history, max_pages and client_factory for the
public reader; max_pages bounds history pagination, and an incomplete read
raises before the destination is touched.
Development
Run the offline tests with python -m pytest tests -q. They use an in-test
fake catalog that records appended Arrow tables and never call the live
service or a real catalog.
Metadata
Release files for pyiceberg-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 |
|---|---|---|---|---|
| pyiceberg_fxmacrodata-0.1.0.tar.gz | 9.0 kB | Without provenance | Details for pyiceberg_fxmacrodata-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyiceberg_fxmacrodata-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyiceberg_fxmacrodata-0.1.0-py3-none-any.whl |
Total release size: 15.7 kB
Release files / pyiceberg_fxmacrodata-0.1.0.tar.gz
| Download URL | pyiceberg_fxmacrodata-0.1.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef5e9532b02402f83167be74f0d1e84d0dd1ab99c7350840260909a09a2e9e7d
|
|
BLAKE2b-256 checksum How to use checksums |
33cc7093c50f64c709ede4065053ad5bdb800dd1bd9573db1a91b23bb1e4725d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Release files / pyiceberg_fxmacrodata-0.1.0-py3-none-any.whl
| Download URL | pyiceberg_fxmacrodata-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b565c79d80e725b71567073d4f8dbf59c3f7dd09ebafa0157eaa6d4b5a215951
|
|
BLAKE2b-256 checksum How to use checksums |
94c60494c6ae88e8b39dcb54cfbe3fb2efa784aeadc51ac2326e4b37d6d43a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
FXMacroData-PackagePublisher/1.0
|
Security for pyiceberg-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.