Fetch and process historical daily currency exchange rate from the ECB
Project description
ECB Exchange Rates
A Python package to fetches the exchange rate for a given date, from currency, and to currency.
This package uses daily exchange rate published by ECB. ECB page for Euro foreign exchange reference rates
The ECB exchange rate data does not include weekends. If the date falls on a weekend or holiday, it uses the last available rate.
Installation
pip install ecb-currency-exchange-rate
Usage
Single time conversion
from ecb_rates import ecb_rates
rate = ecb_rates.get_exchange_rate("2025-03-31", "EUR", "USD")
print(rate)
Batch conversion: different dates for fixed currency exchange pair with pandas DataFrame.
from ecb_rates import ecb_rates
# Assuming df has 'transaction_date' and 'usd_amount' columns
df = pd.DataFrame({
'transaction_date': ['2025-04-01', '2025-04-02', '2025-04-03'],
'usd_amount': [100, 150, 200]
})
# Convert from USD to EUR starting from '2025-04-01' with custom column names
converted_df = convert_currency_amounts(df, 'USD', 'EUR', start_date='2025-04-01',
date_column='transaction_date', amount_column='usd_amount')
print(converted_df)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecb_currency_exchange_rate-0.1.4.tar.gz.
File metadata
- Download URL: ecb_currency_exchange_rate-0.1.4.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d0ba58399953d3c8bd5eef4d3453fd1d9427aa948748997125ac6bbbd98235e
|
|
| MD5 |
cd8a4002999fbaf70d3f8b729f1690b3
|
|
| BLAKE2b-256 |
8a2524c1007a269de552fa662d94bc81bb2b2841f01c11f5dee5f02926ffb084
|
File details
Details for the file ecb_currency_exchange_rate-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ecb_currency_exchange_rate-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360d66111d61b35ee9078d0df30fee73411042ff2d7f0af9f8e97a5255a792d5
|
|
| MD5 |
2a81cfda0c25196562ab31e50daf11e1
|
|
| BLAKE2b-256 |
aae48ec846a5c8fb0bb500578858606dc354b2af0cd371f488ec96836632fcb4
|