Skip to main content

A lightweight wrapper for the frankfurter API

Project description

frankfurter - Unofficial Lightweight Wrapper for the frankfurter API

The Frankfurter API tracks foreign exchange references rates published by the European Central Bank. The data refreshes around 16:00 CET every working day.

Installation

You can directly download it from pip using the command

pip install frankfurter

Usage

First, you need to make a object of the FrankfurterEngine class. It takes an argument called quiet_mode which decides whether to print the logging information.

from frankfurter import FrankfurterEngine

engine = FrankfurterEngine(quiet_mode=False)

Get List of Supported Currencies

To fetch the list of supported currencies:

currencies = engine.fetch_currencies()
print(currencies)

Fetch Latest Forex Data

To fetch the latest forex data for a base currency and an optional target currency:

latest_data = engine.fetch_latest_data(base="USD", to="EUR")
print(latest_data)

Fetch Historical Data for a Specific Date

To fetch forex data for a specific date:

historical_data = engine.fetch_data_for_date(date="2022-01-01", base="USD", to="EUR")
print(historical_data)

Fetch Time Series Data

To fetch forex data over a date range:

time_series_data = engine.fetch_time_series_data(
    base="USD", to="EUR", start_date="2022-01-01", end_date="2022-12-31"
)
print(time_series_data)

API Documentation

API Documentation For more information on the API itself, visit the official documentation.

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

frankfurter-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

frankfurter-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file frankfurter-1.0.0.tar.gz.

File metadata

  • Download URL: frankfurter-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for frankfurter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9bf4b0d81cc7e98243de2ab0f84953c2a0eee32d1440b4575b12d184f399e4a5
MD5 9c5e4bdb0b4e323acd81ec23b539a2f0
BLAKE2b-256 438aad1dbf2acd18aeb743ffbe2595ed73a88d28e0957659548cd455cca98ae2

See more details on using hashes here.

File details

Details for the file frankfurter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: frankfurter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for frankfurter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 528cd4f2fdca299f4598545ed1417bd3c064c68f3ffbdfcce68927566b115a1b
MD5 2ee43784a518ef012844b44641769cc8
BLAKE2b-256 59c269d3398cad0a725e23a71cc061a75a8acd0020787935d676c1ac12052036

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