exchango 1.0.2
Exchango - modern Python library for obtaining current exchange rates and converting currencies with support for both synchronous and asynchronous interfaces. Easy integration, flexible settings, and regular data updates.
Requires Python: >=3.7
Keywords: currency, exchange, converter, forex, rates, synchronous, asynchronous, async, sync, aiohttp, requests, conversion, money, finance, financial, api, exchangerate, currency-converter, toolkit

# Supported currencies:
| CODE | FULL NAME |
|------|-----------|
| AUD | Australian Dollar |
| AZN | Azerbaijani Manat |
| GBP | British Pound Sterling |
| AMD | Armenian Dram |
| BYN | Belarusian Ruble |
| BGN | Bulgarian Lev |
| BRL | Brazilian Real |
| HUF | Hungarian Forint |
| VND | Vietnamese Dong |
| HKD | Hong Kong Dollar |
| GEL | Georgian Lari |
| DKK | Danish Krone |
| AED | United Arab Emirates Dirham |
| USD | United States Dollar |
| EUR | Euro |
| EGP | Egyptian Pound |
| INR | Indian Rupee |
| IDR | Indonesian Rupiah |
| KZT | Kazakhstani Tenge |
| CAD | Canadian Dollar |
| QAR | Qatari Riyal |
| KGS | Kyrgystani Som |
| CNY | Chinese Yuan |
| MDL | Moldovan Leu |
| NZD | New Zealand Dollar |
| NOK | Norwegian Krone |
| PLN | Polish Zloty |
| RON | Romanian Leu |
| XDR | Special Drawing Rights |
| SGD | Singapore Dollar |
| TJS | Tajikistani Somoni |
| THB | Thai Baht |
| TRY | Turkish Lira |
| TMT | Turkmenistani Manat |
| UZS | Uzbekistani Som |
| UAH | Ukrainian Hryvnia |
| CZK | Czech Koruna |
| SEK | Swedish Krona |
| CHF | Swiss Franc |
| RSD | Serbian Dinar |
| ZAR | South African Rand |
| KRW | South Korean Won |
| JPY | Japanese Yen |

# 1. Quick start
---
#### First, install exchango. Enter this command in the console or in the terminal:
```sh
pip install exchango
```
---
#### Next, select the synchronous or asynchronous version of the library.
```python
# Synchronous version
import exchango.sync_api as exchango
# Asynchronous version
import exchango.async_api as exchango
```
The difference in usage is almost imperceptible, but the asynchronous version must be applied in ```async def``` and ```await``` before calling the function or in ```asyncio.run()```.
---
### The difference between synchronous and asynchronous versions.
```python
# Synchronous version
import exchango.sync_api as exchango
from time import time

codes = ["AUD", "AZN", "GBP", "AMD", "BYN", "BGN", "BRL", "HUF", "VND", "HKD", "GEL", "DKK", "AED", "USD", "EUR", "EGP", "INR", "IDR", "KZT", "CAD", "QAR", "KGS", "CNY", "MDL", "NZD", "NOK", "PLN", "RON", "XDR", "SGD", "TJS", "THB", "TRY", "TMT", "UZS", "UAH", "CZK", "SEK", "CHF", "RSD", "ZAR", "KRW", "JPY"]

def main():
    start = time()
    for currency in codes:
        for to in codes:
            for amount in range(0, 11):
                result = exchango.convert(currency, amount, to)
                print(f"{amount} {currency} = {result} {to}")
    end = time()
    print(end - start)

if __name__ == "__main__":
    main()
```
```python
# Asynchronous version
import exchango.async_api as exchango
from time import time
import asyncio

codes = ["AUD", "AZN", "GBP", "AMD", "BYN", "BGN", "BRL", "HUF", "VND", "HKD", "GEL", "DKK", "AED", "USD", "EUR", "EGP", "INR", "IDR", "KZT", "CAD", "QAR", "KGS", "CNY", "MDL", "NZD", "NOK", "PLN", "RON", "XDR", "SGD", "TJS", "THB", "TRY", "TMT", "UZS", "UAH", "CZK", "SEK", "CHF", "RSD", "ZAR", "KRW", "JPY"]

async def main():
    start = time()
    for currency in codes:
        for to in codes:
            for amount in range(0, 11):
                result = await exchango.convert(currency, amount, to)
                print(f"{amount} {currency} = {result} {to}")
    end = time()
    print(end - start)

if __name__ == "__main__":
    asyncio.run(main())
```
This code calls the ```exchango.convert``` function 20339 times and at the end outputs how much time was spent.
---
### Currency converting.
```python
# Synchronous version
exchango.convert(currency, amount, to)
```
```python
# Asynchronous version
await exchango.convert(currency, amount, to)
```
| ARGUMENT | DESCRIPTION | TYPE | EXAMPLE 1 | EXAMPLE 2 | EXAMPLE 3 |
|:--------:|:-----------:|:----:|:---------:|:---------:|:---------:|
| ```currency``` | 3-letter code of the currency to convert | ```string``` |    USD    |    EUR    |    RUB    |
| ```amount``` | Amount of ```currency``` to convert into another currency | ```number``` |     5     |   91.84   |   -647    |
| ```to``` | 3-letter code of the target currency to convert ```currency``` into | ```string``` |    RUB    |    USD    |    EUR    | 

| RETURNS | SUCCESS | DESCRIPTION |   EXAMPLE 1    |      EXAMPLE 2       | EXAMPLE 3 |
|:-------:|:-------:|:-----------:|:--------------:|:--------------------:|:---------:|
| ```number``` | YES | Converting result |     500.0      |     145.1541451      |  -23.535  |
| ```string``` | NO | Error during converting | Incorrect type | Unspecified argument | And other |