Official Python client for the Unirate API
Project description
Unirate API Client
Official Python client for the Unirate API. This library provides a simple and intuitive way to interact with the Unirate currency conversion service.
Installation
pip install unirate-api
Quick Start
from unirate import UnirateClient
# Initialize the client
client = UnirateClient(api_key="your-api-key")
# Get current exchange rate
rate = client.get_rate("USD", "EUR")
print(f"Current USD to EUR rate: {rate}")
# Convert amount
converted = client.convert(amount=100, from_currency="USD", to_currency="EUR")
print(f"100 USD = {converted} EUR")
# Get supported currencies
currencies = client.get_supported_currencies()
print("Supported currencies:", currencies)
Features
- Simple and intuitive API
- Real-time currency conversion
- Support for multiple currency pairs
- Comprehensive error handling
Documentation
For detailed documentation, please visit our documentation site.
Authentication
To use this client, you'll need an API key. You can obtain one by registering at Unirate.
Error Handling
The client includes comprehensive error handling:
from unirate.exceptions import UnirateError
try:
rate = client.get_rate("INVALID", "EUR")
except UnirateError as e:
print(f"An error occurred: {e}")
Available Methods
Get Exchange Rate
rate = client.get_rate("USD", "EUR")
Convert Amount
converted = client.convert(100, "USD", "EUR")
Get Supported Currencies
currencies = client.get_supported_currencies()
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
unirate_api-0.1.0.tar.gz
(3.5 kB
view details)
File details
Details for the file unirate_api-0.1.0.tar.gz.
File metadata
- Download URL: unirate_api-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26b790f7d54c25a681ce0c0bb13cc1f2306f614f892fa39566eca6a20b5c945
|
|
| MD5 |
f45aa181a595ff9cddbe19a0b4a69208
|
|
| BLAKE2b-256 |
a05d75131dad97ec26bd47ee9ff8b7dbc29a8e336b25990f52c68b43993439b1
|