PyCurrenciesTools is a Python library for easy currency conversion and information retrieval, providing real-time exchange rates and a comprehensive list of currency symbols and tags.
Project description
This library provides a simple and efficient way to work with currencies, including getting exchange rates and converting amounts between different currencies. It leverages live exchange rate data for up-to-date conversions.
Key Features
Real-time Exchange Rates: Fetch the latest exchange rates between various currencies using get_exchange_rate().
Currency Conversion: Easily convert amounts from one currency to another with exchange_currency().
Currency Symbols and Tags: Access a comprehensive list of currency abbreviations (tags) and symbols using the PyCurrenciesTools.data.CurrenciesTags and PyCurrenciesTools.data.CurrenciesSymbols classes.
Error Handling: Clear error messages are raised for invalid currency tags or unavailable exchange rates, simplifying debugging.
Installation
Install PyCurrenciesTools using pip:
pip install PyCurrenciesTools
Usage Examples
Getting the exchange rate:
from PyCurrenciesTools import get_exchange_rate
try:
rate = get_exchange_rate("USD", "EUR")
print(f"The exchange rate from USD to EUR is: {rate}")
except Exception as e:
print(f"Error: {e}")
Converting currency:
from PyCurrenciesTools import exchange_currency
try:
converted_amount = exchange_currency(100, "USD", "EUR")
print(f"100 USD is equal to {converted_amount} EUR")
except Exception as e:
print(f"Error: {e}")
Accessing Currency Symbols and Tags:
from PyCurrenciesTools.data import CurrenciesTags, CurrenciesSymbols
usd_tag = CurrenciesTags.united_states_dollar
usd_symbol = CurrenciesSymbols.united_states_dollar
print(f"USD Tag: {usd_tag}")
print(f"USD Symbol: {usd_symbol}")
Future Notes
PyCurrenciesTools is actively maintained and we are continually working to improve its functionality and data accuracy. Future development may include expanding the range of supported currencies, providing historical exchange rate data, and adding more advanced currency-related features. We welcome contributions and suggestions from the community. Feel free to report any issues or propose new features.
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 pycurrenciestools-1.0.2.tar.gz
.
File metadata
- Download URL: pycurrenciestools-1.0.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9039e6f0a4e8e1505022eb179b68f16e6386688bdbb4d41421b14b865628a7b |
|
MD5 | 4ca014adc84ba52e182ae6eef7e4fe23 |
|
BLAKE2b-256 | 991d4821bf20121672ff646ea7852c089764ab93b8b183cd54ac70ae35cb23ae |
File details
Details for the file PyCurrenciesTools-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: PyCurrenciesTools-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6db6ebfaf6ab54d5c7671276539dc909df9148ee308bead9e9273b61a5e9fb3 |
|
MD5 | 627e6a81e3e3549558922b7140dea177 |
|
BLAKE2b-256 | ec81d2dd58cabfe22bcfa6f89ddc42a04e7913196f537493f6f426d95c3649e9 |