Skip to main content

FXMacroData for Apache Arrow Flight

Serve FXMacroData public responses to any Arrow Flight client from a server you run. Flight clients in Python, Java, C++, Go, Rust and R, plus engines such as DuckDB and Dremio, can then pull macro announcements, calendars, FX and positioning data as Arrow record batches without an HTTP client or JSON parsing of their own.

FXMacroData documentation

Install

Requires Python 3.10 or later and pyarrow 25 or later (Flight is bundled in the standard wheels). Install this package and its adjacent 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/arrow-flight-fxmacrodata

Example

Start a server on your own network. USD data is served without a key:

from fxmacrodata_flight import FXMacroDataFlightServer

server = FXMacroDataFlightServer("grpc://127.0.0.1:8815")
print("listening on", server.port)
server.serve()

Then from any Flight client:

import json
import pyarrow.flight as flight

client = flight.connect("grpc://127.0.0.1:8815")
request = {"operation": "indicator_history",
           "arguments": {"currency": "usd", "indicator": "policy_rate"}}
info = client.get_flight_info(flight.FlightDescriptor.for_command(json.dumps(request).encode()))
table = client.do_get(info.endpoints[0].ticket).read_all()
print(table.filter(table["value"].is_valid()).select(["date", "value"]))

list_flights returns one flight per served operation with the fixed schema, so clients can discover the catalogue. A command descriptor is JSON with operation, optional arguments (an object matching the operation's input schema) and optional complete_history (default true). Pass allowed_operations=[...] to serve a subset of the catalogue and max_pages to bound history pagination for every read.

The server binds to the location you give it. Flight itself is unencrypted and unauthenticated unless you configure TLS and authentication through the FlightServerBase options (tls_certificates, auth_handler, middleware), which are passed through unchanged. Bind to a loopback or private address unless you have done so.

Credentials

Set FXMD_API_KEY in the server's environment or secret manager and pass its name: FXMacroDataFlightServer(location, api_key_env="FXMD_API_KEY"). The server resolves the value for every upstream read; clients never send a key. Requests whose arguments carry api_key, tokens, URLs or endpoint overrides are rejected with a generic message before any read occurs. Omit api_key_env for anonymous access.

Data semantics

Every flight has the same schema: operation, source_url, record_id, currency, indicator, date, announcement_datetime, value, value_text, record_json, response_json and content_hash. Only value is numeric (nullable float64); every other column is a nullable string. record_json retains the original record and response_json retains the complete response, including pagination and metadata. An empty response streams one envelope row with record_json = "null"; it is not an observation. Dates and announcement times remain source strings. No publication time is inferred and no missing value is filled. record_id is a stable hash of the operation and record; content_hash is the SHA-256 of the canonical JSON of the ten source columns.

Delivery guarantee

Each do_get performs one fresh read and streams the complete response. The server holds no cache and no state between calls; two identical requests produce two upstream reads. An upstream failure ends the stream with a FlightUnavailableError whose message carries no upstream detail.

Development

Run the offline tests with python -m pytest tests -q. They start the server on an ephemeral loopback port inside the test process with the public reader monkeypatched and never call the live service.

Metadata

Release files for arrow-flight-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)

Source distribution for arrow-flight-fxmacrodata 0.1.0
File Size Uploaded Provenance Actions
arrow_flight_fxmacrodata-0.1.0.tar.gz 8.5 kB Without provenance Details for arrow_flight_fxmacrodata-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arrow-flight-fxmacrodata 0.1.0
File Interpreter ABI Platform Actions
arrow_flight_fxmacrodata-0.1.0-py3-none-any.whl Python 3 none any Details for arrow_flight_fxmacrodata-0.1.0-py3-none-any.whl

Total release size: 15.5 kB

Release files / arrow_flight_fxmacrodata-0.1.0.tar.gz

Download URL arrow_flight_fxmacrodata-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8856f43def4de7bc0d60e3887d45b70cf9c9314089e3fdf171acb43d378e1308
BLAKE2b-256 checksum
How to use checksums
c231af66917557070c9a84d36380a31b7223074b6e7f995409ed4ee4596c8d95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via FXMacroData-PackagePublisher/1.0

Release files / arrow_flight_fxmacrodata-0.1.0-py3-none-any.whl

Download URL arrow_flight_fxmacrodata-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f59016c928a6156fec72cf1891e519d357a48d9b8cbf39c81522fc11f87db4f
BLAKE2b-256 checksum
How to use checksums
fe0c4fce6b9fa519732856e90e288a5f3798e7d80efcbc73eb24e050ece6876b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via FXMacroData-PackagePublisher/1.0

Security for arrow-flight-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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No 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