Skip to main content

A lightweight wrapper for the frankfurter API

Project description

frankfurter - Unofficial Lightweight Wrapper for the frankfurter API

Downloads PyPI

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-2.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

frankfurter-2.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for frankfurter-2.0.0.tar.gz
Algorithm Hash digest
SHA256 372bf4876f2632853d50fa39c6ee3f18b61cb7eceb8bbf19192b92ffb7633218
MD5 38377bcd2069acde35ee9b09de24b68e
BLAKE2b-256 1a8fe55c2ff51d5e9f203a87571810a93608ed772bb46ee8d7b6daaf69f2d3b5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for frankfurter-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92a240e1e7ce22c7cd43f068e130aeb22f4b9f7c851c2c14bdcaed4598283770
MD5 9061634622a7ec533e23ae95fba2cad1
BLAKE2b-256 aa4f8c24b7121583e4531f0491b261c8b5a0e44442d0811f351e423de4ccbf81

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