Skip to main content

FXMacroData for Snowflake

Load FXMacroData public responses through the official Snowflake Connector for Python. Bounded batch inserts feed a temporary staging table, followed by a transactional merge into your analytical table.

FXMacroData documentation

Install and connect

Requires Python 3.10 or later and Snowflake Connector for Python 4.8.1 or later within version 4. Install the supplied adapter wheel; its public client and platform core dependencies resolve from PyPI:

python -m pip install /path/to/snowflake_fxmacrodata-0.1.0-py3-none-any.whl

Use a dedicated Snowflake connection with its current database and schema set. This example uses interactive SSO; headless workloads should use your organization's approved SDK authentication method and runtime secret store. Expose the FXMacroData source key through the FXMD_API_KEY environment name.

import os
import snowflake.connector
from fxmacrodata_platform_core import read
from fxmacrodata_snowflake import load

connection = snowflake.connector.connect(
    account=os.environ["SNOWFLAKE_ACCOUNT"],
    user=os.environ["SNOWFLAKE_USER"],
    authenticator="externalbrowser",
    warehouse=os.environ["SNOWFLAKE_WAREHOUSE"],
    database=os.environ["SNOWFLAKE_DATABASE"],
    schema=os.environ["SNOWFLAKE_SCHEMA"],
    paramstyle="qmark",
)
try:
    batch = read("release_calendar", {"currency": "usd"}, api_key_env="FXMD_API_KEY")
    result = load(batch, connection, "FXMACRODATA", paramstyle="qmark")
finally:
    connection.close()

One-, two- and three-part simple SQL names are accepted and normalized to uppercase, matching Snowflake's unquoted identifier convention. Quoted, case-sensitive names and SQL fragments are rejected. The database and schema must exist. The caller needs table/stage creation and DML privileges. Use create_table=False if an administrator has provisioned the envelope table with create_table_sql(table).

The loader must own the connection's transaction. Snowflake DDL can commit an active transaction, so do not pass a connection with unrelated pending work. paramstyle must match the connection (qmark, numeric, format, or pyformat, the connector default). No global connector settings are changed.

Every operation exposed by fxmacrodata_platform_core.operations() is available, including REST and MCP operations. The loader adds a tabular envelope without changing the original public response. record_json retains the original record; response_json retains the complete response, including pagination and metadata. An empty response produces one envelope with record_json = 'null', so absence of data and the server's metadata remain inspectable. It is not an observation.

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. Dates and announcement times remain source strings. No publication time is inferred, and no missing value is filled. value_text and JSON preserve source numbers supplied as strings. JSON numeric tokens follow the public Python client parser, so original lexical precision is not guaranteed.

Select operations with the shared catalogue rather than constructing URLs:

from fxmacrodata_platform_core import operations, schemas

available = operations()
input_schemas = schemas()

load_operation accepts api_key_env, complete_history, max_pages, and client_factory for the public source reader. max_pages bounds history pagination; an incomplete read raises an error before a destination load starts. batch_size bounds destination blocks to 1���10,000 rows. max_batch_bytes also bounds each block using a conservative JSON byte estimate (16 MiB by default, 128 MiB maximum). An oversized individual envelope is rejected before destination changes; narrow the source date range to reduce the response size. The source response is materialized before loading; choose a source date range suitable for memory. Read the installed operation's schema for required arguments and date filters.

Supply source credentials through your runtime secret store, exposing only the environment variable name to the adapter. Destination authentication belongs to the official SDK connection you pass to the loader. The adapter neither saves nor prints credentials and never constructs destination credentials for you.

The package licence covers this adapter code. FXMacroData data access and onward redistribution remain subject to your subscription and applicable licence. Loading data into a warehouse does not grant permission to publish or resell it.

Retries and querying

The loader creates the destination and temporary table, then fills every bounded block before beginning the destination DML transaction. This also keeps any temporary binding-stage DDL issued by the connector outside the transaction. It then begins, merges on operation, record ID and content hash, and commits. A staging failure leaves destination rows untouched. A merge or commit failure triggers rollback. If rollback itself fails, the loader avoids cleanup DDL that could commit unresolved work.

Repeated exact envelopes are skipped; changed source records or metadata remain distinct. Use one writer per destination table. Concurrent merges into standard Snowflake tables are not an exactly-once guarantee. The loader never retries a write automatically. After connection loss, inspect the transaction outcome before retrying. LoadResult.rows_submitted counts unique envelopes offered to the merge, rather than rows newly inserted.

SELECT CURRENCY, INDICATOR, DATE, VALUE,
       PARSE_JSON(RECORD_JSON):publication_time_status::STRING AS PUBLICATION_STATUS
FROM FXMACRODATA
WHERE RECORD_JSON != 'null';

event_study.sql joins source announcement times to your licensed market-price table. Inspect source publication metadata separately for point-in-time backtesting. sharing.sql shows a customer-controlled secure share; sharing data requires the applicable rights and recipient approval. This package does not create a Marketplace listing.

Test

python -m pytest tests -q

Official SDK references: batch binding and transactions, connector API.

Metadata

Release files for snowflake-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 snowflake-fxmacrodata 0.1.0
File Size Uploaded Provenance Actions
snowflake_fxmacrodata-0.1.0.tar.gz 14.2 kB Without provenance Details for snowflake_fxmacrodata-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.5 kB

Release files / snowflake_fxmacrodata-0.1.0.tar.gz

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

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

Download URL snowflake_fxmacrodata-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f86f5631234a6e19325a25ecdafed1145cd9188cb507911470250ed519c176cd
BLAKE2b-256 checksum
How to use checksums
94544170bdaa524bb4e03f809306ddab913c531b1abaa8ebd5e13a2b1b189021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via FXMacroData-PackagePublisher/1.0

Security for snowflake-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