Skip to main content

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

unirate_api-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file unirate_api-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: unirate_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for unirate_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aaf9595c04890db242dd7eba81641713117c04f8651efeaed4e29ef3df3f9e54
MD5 07283402bc329ace48354675dbe2224f
BLAKE2b-256 76171e705a4c4eea21528222334951a7cd3b469b6ae860fff29e08d7dab3d987

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