Venrate get exchange rates from different platforms
Project description
venrate
Venrate is a library to get the exchange rate from currency A to currency B from different platforms like BCV.
Requeriments
- python3 >= 3.9
- requests >= 2.32.3
- dataclasses and typing (standard libraries)
Installation
You can install venrate from Pypi
pip install venrate
Using venrate.
Exchange rate from 'Bolivares' to 'US Dollars' in all platforms.
# importing venrate and creating object.
from venrate import Venrate
venrate = Venrate()
for p_name, platform in venrate.platforms.items():
currency_from = platform.currency_from
currency_to = platform.currency_to
rate = venrate.get_rate(
p_name,
currency_from,
currency_to,
use_last_response=False,
timeout=10, # This is a requests.request option
verify=True # This is a requests.request option
)
print(f"{p_name} rate from '{currency_from}' to '{currency_to}' is"
" " f"'{rate}'")
Exchange rate from 'Bolivares' to 'US Dollars' using BCV.
# importing venrate and creating object
from venrate import Venrate
venrate = Venrate()
platform_name = 'BcV' # Name is case insensitive
bcv_rate = venrate.get_rate(
platform_name,
use_last_response=False,
timeout=10,
verify=False # Lately BCV it's giving SSL errors
)
print(bcv_rate)
# Successfull requests.Response are saved, so you can use it later.
bcv_rate = venrate.get_rate(
platform_name,
use_last_response=True,
timeout=10,
verify=False # Lately BCV it's giving SSL errors
)
print(bcv_rate)
Default currency names that platforms uses
# importing venrate and creating object
from venrate import Venrate
venrate = Venrate()
for p_name, platform in venrate.platforms.items():
currency_from = platform.currency_from
currency_to = platform.currency_to
print(p_name, currency_from, currency_to)
# Why know this?
# Platforms could have different naming for currencies
# Binance for example uses USDT
# MonitorDolar, BCV and Yadio uses USD
:notebook: Notes
-
It's still a very premature library, it lacks:
- Documentation
- Tests
- More platforms
- More methods or new idea of superclass that results useful to use.
-
There are platforms like MonitorDolar that only does BS to USD so if you try using different currencies or different ordering it will throw the same rate.
Supported platforms
| Name | Image |
| Binance | |
| BCV | |
| MonitorDolar | |
| Yadio |
Made by :link: Sivefunc
Licensed under :link: GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file venrate-1.0.4.tar.gz.
File metadata
- Download URL: venrate-1.0.4.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f1be3cbe0a4fdc1507d31ca974ed320af0324ae151403ceece3009e65868a52
|
|
| MD5 |
ab857f2fa5ab0d7eda2029630c6206c6
|
|
| BLAKE2b-256 |
cd1952980e92e402bfe5556956838554ac79a0de161fe54c31581e8284572f36
|
File details
Details for the file venrate-1.0.4-py3-none-any.whl.
File metadata
- Download URL: venrate-1.0.4-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f206c36c9e39f86c509cd3a1620318373430f6418a25ad4a5d2433dc7fab31f6
|
|
| MD5 |
99713514775bf78acc77a71c824f48dd
|
|
| BLAKE2b-256 |
6409ac272b2858f8ea0c9bc23b0e653490f4d036a7d6040888d90316f146cd73
|