Skip to main content

A small library for getting information on cash exchange rates of PrivatBank and the NBU on the selected date

Project description

PyPI - Python Version

Official Repo: https://gtlb.jetsoftpro.com/mariana.drozd/exchange_rates_mariana_drozd

It uses the following libraries:

Quick Install / Usage

pip install exchange_rates_mariana_drozd
from datetime import datetime

from exchange_rates_mariana_drozd import get_exchange_rates_from_date_to_date


def main():
    exchange_rates_from_date_to_date = get_exchange_rates_from_date_to_date(
        datetime(day=15, month=4, year=2019),
        datetime(day=20, month=4, year=2019),
        currency="USD",
        save_to_csv_file=False,
        save_to_json_file=False,
        show_plot=False
    )

    print(exchange_rates_from_date_to_date)

 # Output:
 #    {
 # "15.04.2019": {
 #  "date": "15.04.2019",
 #  "bank": "PB",
 #  "baseCurrency": 980,
 #  "baseCurrencyLit": "UAH",
 #  "exchangeRate": [
 #   {
 #    "baseCurrency": "UAH",
 #    "currency": "UZS",
 #    "saleRateNB": 0.003243,
 #    "purchaseRateNB": 0.003243
 #   },
 #   {
 #    "baseCurrency": "UAH",
 #    "currency": "BYN",
 #    "saleRateNB": 12.64203,
 #    "purchaseRateNB": 12.64203
 #   },
 #   {
 #    "baseCurrency": "UAH",
 #    "currency": "TMT",
 #    "saleRateNB": 7.774029,
 #    "purchaseRateNB": 7.774029
 #   },
 #    ...

Note:

If you need to save data in CSV or/and JSON file, set needed parameter (save_to_csv_file and/or save_to_json_file) to "True".

Also, if you want to see plot of selected currency, set show_plot to "True"

Example of USD currency plot:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exchange-rates_mariana_drozd-0.0.4.tar.gz (4.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page