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.1.tar.gz (44.1 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.1-py3-none-any.whl (79.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: currencycore-0.1.1.tar.gz
  • Upload date:
  • Size: 44.1 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.1.tar.gz
Algorithm Hash digest
SHA256 9dbecdd0f56282cc554a117e0fab524f78274035283e817d8d866bdac93c7414
MD5 4fbdb439c2205fb06645fb028553ac47
BLAKE2b-256 ab9d1512218b7b9634847745563dd7c1538789db547ba479adfcc7a3ee143d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for currencycore-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: currencycore-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 79.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6f58218651bd844725ff48047d0c19621e7aec57ab273e906abe9c9db132257
MD5 f73db1567db16c3ee04a1a285bfe995d
BLAKE2b-256 fee489184620a1491fe19949ee14b7f0cf800517ef4b3ca494f5acf36e07f6e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for currencycore-0.1.1-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