Skip to main content

dagster-unirate

PyPI Dagster License

Dagster integration for UniRateAPI — real-time currency exchange rates, conversion, supported currencies, and VAT rates. Ships a ConfigurableResource plus a pair of ready-to-run example assets.

Install

pip install dagster-unirate

Requires dagster >= 1.8 and Python 3.10+. Get a free API key at https://unirateapi.com.

Quick start

from dagster import Definitions, EnvVar
from dagster_unirate import UniRateResource, exchange_rates, currencies

defs = Definitions(
    assets=[exchange_rates, currencies],
    resources={
        "unirate": UniRateResource(api_key=EnvVar("UNIRATE_API_KEY")),
    },
)
export UNIRATE_API_KEY=your-key-here
dagster dev -f examples/definitions.py

Resource — UniRateResource

A Dagster ConfigurableResource. Configure it once in your Definitions, then request it from any op or asset by name.

Config Default Notes
api_key — (required) Use EnvVar("UNIRATE_API_KEY") in prod
base_url https://api.unirateapi.com Override for testing
timeout 30.0 Per-request timeout, seconds

Methods (free tier):

from dagster import asset
from dagster_unirate import UniRateResource

@asset
def my_rates(unirate: UniRateResource):
    rate = unirate.get_rate("USD", "EUR")        # -> 0.92 (float)
    all_rates = unirate.get_rate("USD")          # -> {"EUR": 0.92, ...}
    amount = unirate.convert("EUR", 100, "USD")  # -> 92.5 (convert amount)
    codes = unirate.list_currencies()            # -> ["USD", "EUR", ...]
    vat = unirate.get_vat_rates("DE")            # -> {"vat_data": {...}}
    return all_rates

Pro-gated (raises APIError with status_code == 403 on the free tier):

unirate.get_historical_rate("2024-01-15", "EUR")   # requires a Pro plan

Currency and country codes are uppercased automatically before the request.

Example assets

  • exchange_rates — latest USD-based rates for a fixed set of currencies, returned as a {code: rate} dict with per-materialization metadata.
  • currencies — the full list of supported currency codes.

Both live in dagster_unirate.assets; copy them into your project and edit the target list, or use them as-is. A runnable Definitions is in examples/definitions.py.

Error handling

All errors inherit from UniRateError:

HTTP Exception
400 InvalidDateError
401 AuthenticationError
403 APIError (status_code=403) — Pro-gated endpoints
404 InvalidCurrencyError
429 RateLimitError
503 APIError (status_code=503)
other APIError (with status + body)
from dagster_unirate import RateLimitError, UniRateError

try:
    unirate.get_rate("USD", "EUR")
except RateLimitError:
    ...  # back off
except UniRateError:
    ...  # any UniRate failure

Testing

pip install -e ".[test]"
pytest

The suite mocks the HTTP layer with respx (no network) and materializes the example assets via dagster.materialize.

Status

v0.1.0 — initial release. UniRateResource + 2 example assets. 33 mock tests.

Other UniRate clients

UniRate ships official client libraries and framework integrations across the ecosystem, all maintained under the UniRate-API org.

Get a free API key at unirateapi.com.

License

MIT — see LICENSE.

Release files for dagster-unirate 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 dagster-unirate 0.1.0
File Size Uploaded
dagster_unirate-0.1.0.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dagster-unirate 0.1.0
File Interpreter ABI Platform
dagster_unirate-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / dagster_unirate-0.1.0.tar.gz

Download URL dagster_unirate-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
342d4922a3023e84a130b595779b9c09e2e85c6b4e69faa6683243efb5bc72ee
BLAKE2b-256 checksum
How to use checksums
f3a7bc37652480374853bd33e6aaad21d9e2b4e2726e145895113964d9fc07d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Sep 26, 2026.

Transparency log

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

Download URL dagster_unirate-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83f15a34f5cc5c3a382d7f09b1cb5329e161ff632cb2efac3c0f6bc699cb9b27
BLAKE2b-256 checksum
How to use checksums
375f8c533a9460cc3eaabb5cd0a89793be5593dabc5d637300ad6735d0fc9975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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