Skip to main content

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

Project description

PyPI - Python Version

PyPI - Developer Build Status PyPI - License

Official Repo: https://github.com/lesykbiceps/nbu-exchange-rates

Welcome! Using this library you can collect exchange rates and reproduce this information in various forms. You can do various manipulations with the obtained data:

  • Save the data in json or csv format
  • Get graphs of how the exchange rate of a particular currency has changed
  • Get the selected exchange rate

Those who have access to data have great opportunities

Libraries

It uses the following libraries:

Library Link
Requests https://pypi.org/project/requests/
Matplotlib https://pypi.org/project/matplotlib/

Why you need them?

Additional info

Also you should have python3-tk installed or any of the matplotlib supported GUI backends For example on Linux:

    sudo apt-get install python3-tk

Quick Install / Usage

pip install nbu_exchange_rates
import json
import csv

from datetime import datetime

from nbu_exchange_rates import get_exchange_rates,format_time,to_json,to_csv,get_diagram


def main():
    exchange_rates = get_exchange_rates(datetime(day=19, month=4, year=2022), datetime(day=23, month=4, year=2022),
               currency='Євро')
    to_json(exchange_rates)
    to_csv(exchange_rates)
    get_diagram(exchange_rates)


    # Output:
    # Євро:31.6216 (19.04.2022)
    # Євро:31.5792 (20.04.2022)    
    # Євро:31.6787 (21.04.2022)    
    # Євро:31.8264 (22.04.2022)

Available currencies

License

Data are taken from the link: https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?date=20220402&json MIT

Free Software, Hell Yeah!

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

nbu-exchange-rates-1.0.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

nbu_exchange_rates-1.0.1-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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