Catalog PyPI
PACKAGE EXPLORERView in registry

afxapicom

PyPI

Async Python client for currency exchange rates

apiasynccurrencyexchangeforexrates
Versions collected1
Direct dependencies1From release 0.1.1
Last observed20 Oct, 21:16 UTC

README

Version 0.1.1 documentation

afxapicom

An unofficial async Python client for currency exchange rates.

Installation

Install from pip:

pip install afxapicom

Install from source:

pip install git+https://github.com/MrBaconHat/afxapi-python.git

Usage

All requests are made using the Client class, initialized with your API key.

import afxapicom
import asyncio

async def main():
    client = afxapicom.Client('YOUR_API_KEY')
    # make calls here

asyncio.run(main())

Check API Status

result = await client.status()
print(result)

Retrieve Currencies

result = await client.currencies(currencies=['EUR', 'USD'])
print(result)

Latest Exchange Rates

result = await client.latest(base_currency='USD', currencies=['EUR', 'GBP'])
print(result)

Historical Exchange Rates

result = await client.historical('2024-01-01', base_currency='USD')
print(result)

Exchange Rates Over a Range

result = await client.range('2024-01-01', '2024-01-07', base_currency='USD')
print(result)

Convert Currencies

result = await client.convert(1000, base_currency='USD', currencies=['EUR', 'GBP'])
print(result)

Error Handling

from afxapicom import Client
from afxapicom.errors import AuthenticationFailed, RateLimited, QuotaExceeded

async def main():
    client = Client('YOUR_API_KEY')
    try:
        result = await client.latest()
        print(result)
    except AuthenticationFailed:
        print("Invalid API key")
    except RateLimited:
        print("Rate limit hit, slow down")
    except QuotaExceeded:
        print("Monthly quota exceeded")

asyncio.run(main())

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.127 May 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
mrbaconhat/afxapi-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:16 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:de6cc15f25ab823c3d49c6e8ef64033391dcf92668005bf79423ac15b202ffce