Python client to collect daily exchange rates provided by the ECB
Project description
fxrates
fxrates provide historical exchange rates. For now, only daily rates are available, using the Frankfurter project's REST API on ECB data. (see: https://github.com/hakanensari/frankfurter). The data refreshes around 16:00 CET every working day. and only business days are retrieved.
Getting Started
Reference documentation for Frankfurter REST API can be found here:
https://www.frankfurter.app/docs/
Installing
pip install fxrates
Exemple
from fxrates import ExchangeRate
# Retrieve most recent exchange rate for JPY/USD
params = {
'targets_codes': 'USD',
'base_code': 'JPY',
'date_from': None,
'date_to': None,
'amount': 1
}
data = ExchangeRate.convert(**params)
# Get exchange rates of EUR/USD and EUR/CAD for all business days from a date to most recent data
params = {
'targets_codes': ['USD', 'CAD'],
'base_code': 'EUR',
'date_from': '2023-01-01',
'date_to': None,
'amount': 1
}
data = ExchangeRate.convert(**params)
# Get amount of USD and CAD corresponding to 100.5 EUR for a specific date
params = {
'targets_codes': ['USD', 'CAD'],
'base_code': 'EUR',
'date_from': None,
'date_to': '2024-01-01',
'amount': 100.5
}
data = ExchangeRate.convert(**params)
# Get amount of USD and CAD corresponding to 100 EUR for all business days between 2 dates
params = {
'targets_codes': ['USD', 'CAD'],
'base_code': 'EUR',
'date_from': '2022-01-01',
'date_to': '2024-05-30',
'amount': 100
}
data = ExchangeRate.convert(**params)
Version History
- 0.1.0
- Initial release
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fxrates-0.1.0.tar.gz
.
File metadata
- Download URL: fxrates-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | daf5301c721bf019379fc067b82dac87fdb9e1c484bcbc85f768b83f0abd8030 |
|
MD5 | b7c39ff22e573b7a09b7fdfcfd530c59 |
|
BLAKE2b-256 | 1a0f41649b53b91a05c213e74553a85b9306682723bcd6a894486c674629df25 |
File details
Details for the file fxrates-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: fxrates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 689d5c27278621f366a9bda35ab04d0396cc6b12cb32b6a7bba920b080400839 |
|
MD5 | aa4b85e8e746c5b673c1c1eb90173af8 |
|
BLAKE2b-256 | 42157a3b3efbedbc65eb30bace1330d8adcdfc959c80605523b8a9a744ceec7e |