Skip to main content

Python wrapper for exchangerateapi.net with latest and historical endpoints

Project description

exchangerateapi-python

A lightweight Python client for exchangerateapi.net providing simple access to two core endpoints.

Installation

pip install exchangerateapi-python

Quick start

from exchangerateapi.client import ExchangeRateApiClient
client = ExchangeRateApiClient(api_key="YOUR_API_KEY")

Usage patterns

  • Fetch most recent rates for a base currency, optionally filter symbols.
  • Retrieve historical rates for a given date and base currency.

Latest

from exchangerateapi.client import ExchangeRateApiClient
client = ExchangeRateApiClient(api_key="YOUR_API_KEY")

latest_usd = client.latest(base="USD")
latest_eur_subset = client.latest(base="EUR", symbols=["USD", "GBP", "JPY"])

Historical

from exchangerateapi.client import ExchangeRateApiClient
client = ExchangeRateApiClient(api_key="YOUR_API_KEY")

hist_usd = client.historical(date="2024-01-02", base="USD")
hist_eur_subset = client.historical(date="2024-01-02", base="EUR", symbols=["USD", "GBP", "JPY"])

Run the examples

EXCHANGERATEAPI_KEY=your_api_key python examples/latest.py
EXCHANGERATEAPI_KEY=your_api_key python examples/historical.py

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

exchangerateapi_python-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

exchangerateapi_python-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file exchangerateapi_python-0.1.0.tar.gz.

File metadata

  • Download URL: exchangerateapi_python-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for exchangerateapi_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4e78ca11786b9d0fceffa6e7d1975e86fbcd9deb10ca2de1c28486f6a03286c
MD5 76252bbfbe82713d48ebebf1b4bf3e1b
BLAKE2b-256 049d3595e1e0e989b328cf1c9f5fb9310cc8fac287c17b707807100a682c21c0

See more details on using hashes here.

File details

Details for the file exchangerateapi_python-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for exchangerateapi_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc53abe781030281ab39a05851aea866adf324fd4bb5e54592296d7081c0b63
MD5 00e860ee03f708b8a7690fb4d2cc2536
BLAKE2b-256 188e6a82446927bc0bf9a5f56f11e84815661fc5265b8fa1129b72a0a9bf8558

See more details on using hashes here.

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