Skip to content

vitalya420/UAH-ExchangeRate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UAH-ExchangeRate

Get exchange rate for UAH asynced or multithreaded

Example async:

import asyncio

from APIClient import APIClientAsync, Calculator

api_client = APIClientAsync()


@api_client.on("updated")
async def on_exchange_updated(rate):
    calc = Calculator(rate)
    print(calc.get_direction("UAH", "EUR"))


@api_client.on("started")
async def polling_started():
    print("Polling started")

loop = asyncio.get_event_loop()
loop.run_until_complete(api_client.start_polling())

Example threded

from APIClient import APIClientThreaded, Calculator

api_client = APIClientThreaded()


@api_client.on("updated")
def on_exchange_updated(rate):
    calc = Calculator(rate)
    print(calc.get_direction("UAH", "EUR"))


@api_client.on("started")
def polling_started():
    print("Polling started")


api_client.start_polling()

About

Get exchange rate for UAH asynced or multithreaded

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages