Skip to main content

Official CurrencyCore API client - currency conversion, FX rates, PPP, and analytics.

Project description

CurrencyCore SDK for Python

Official client for the CurrencyCore API — currency conversion, FX rates, PPP, and analytics.

Generated from the CurrencyCore OpenAPI 3.1 spec with OpenAPI Generator (python, urllib3), plus a thin create_client helper for API-key and version handling.

Install

pip install currencycore

Quickstart

from currencycore.client import create_client

api = create_client(api_key="cc_live_...")  # or set CURRENCYCORE_API_KEY
res = api.convert(var_from="USD", to="EUR", amount=100)
print(res.results[0])

var_from carries the var_ prefix because from is a reserved word in Python.

Public reference endpoints need no key:

api = create_client()
print(api.currencies())

Endpoints

All 14 endpoints are methods on the api client. * marks a required argument; the rest are optional. from/date become var_from/var_date (reserved words). Public = no key; Free = any plan with a key; Growth = Growth plan or higher.

Endpoint Call Plan
Convert an amount (optional PPP) api.convert(var_from*, to*, amount, ppp, var_date) Free
Rate snapshot for a date (USD base) api.rates(var_date) Free
Rate snapshot in any base api.rates_by_base(base*, var_date) Free
One currency's daily time series api.history(currency*, var_from, to, base, interval) Growth
Trends, comparisons & movers api.history_analysis(base, currencies, var_from, to, period, sort, asset_class, limit, interval, stats) Growth
PPP factor over time / movers api.ppp_analysis(countries, var_from, to, period, sort, limit, stats) Growth
Volatility or stability ranking api.volatility(currency, base, var_from, to, sort, universe, limit) Growth
Return correlation vs a base api.correlation(currencies*, base, var_from, to) Growth
Max drawdown or ranking api.drawdown(currency, base, var_from, to, sort, universe, limit) Growth
Safe-haven score ranking api.safe_haven(currencies, base, var_from, to, limit) Growth
Mean-reversion ranking api.mean_reversion(currencies, base, var_from, to, limit) Growth
Supported countries + currencies api.countries() Public
Supported ISO 4217 currencies api.currencies() Public
Natural-language question api.ai(q*) Free

More calls:

api.rates()                                          # latest snapshot (USD base)
api.rates_by_base(base="EUR")                        # same snapshot, EUR base
api.history(currency="INR", var_from="2024-01-01")
api.volatility(universe="majors", sort="volatile")   # most-volatile majors
api.ai(q="How has the rupee moved this year?")

API key

create_client resolves the key as api_keyCURRENCYCORE_API_KEY.

API version

Base URL is https://api.currency-core.com/{version} (default v1):

create_client(version="v1")
create_client(base_url="https://api.currency-core.com/v1")

Low-level client

import currencycore

config = currencycore.Configuration(
    host="https://api.currency-core.com/v1", access_token="cc_live_..."
)
api = currencycore.CurrencyCoreApi(currencycore.ApiClient(config))

Regenerate

The committed openapi.json is the source of truth:

bash scripts/generate.sh

Hand-written files (currencycore/client.py, this README) are protected by .openapi-generator-ignore.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

currencycore-0.1.2.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

currencycore-0.1.2-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

File details

Details for the file currencycore-0.1.2.tar.gz.

File metadata

  • Download URL: currencycore-0.1.2.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for currencycore-0.1.2.tar.gz
Algorithm Hash digest
SHA256 68cff5bd6a4c5f87741ffd365845d8928d61e1f52803a6e578c85ccf81bec95a
MD5 f1b5da3f979a5ccb82f0a8fadf2e2e5a
BLAKE2b-256 120f1cfee594e2871e7b6e64e4050b6b04a6f74b87f71fdb5a90a99b964ed254

See more details on using hashes here.

Provenance

The following attestation bundles were made for currencycore-0.1.2.tar.gz:

Publisher: ci.yml on CurrencyCore/currencycore-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file currencycore-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: currencycore-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 79.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for currencycore-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26c16ff6edf1cf5929a1cb2d3c88aab7994a69ef6074e4850bac5d1b49af9fe6
MD5 8df3d94a1e8cb897a9b2f3eb12e7f880
BLAKE2b-256 babd9352f253e2494496370de1002041022baeb83ded5b2644dac881a4b967ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for currencycore-0.1.2-py3-none-any.whl:

Publisher: ci.yml on CurrencyCore/currencycore-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page