Skip to main content
Help us improve Python packaging – donate today!

Tools to query Bank of Russia

Project Description

https://github.com/idlesign/pycbrf

https://landscape.io/github/idlesign/pycbrf/master/landscape.svg?style=flat

Description

Tools to query Bank of Russia

Provides methods to get the following information:

  1. Exchange rates on various dates

Requirements

  • Python 2.7, 3.2+

Getting Exchange Rates

From command line:

$ pycbrf rates
$ pycbrf rates -d 2016-06-26 -c USD

From your application:

from pycbrf.toolbox import ExchangeRates


rates = ExchangeRates('2016-06-26', locale_en=True)

rates.date_requested  # 2016-06-26 00:00:00
rates.date_received  # 2016-06-25 00:00:00
rates.dates_match  # False
# Note: 26th of June was a holiday, data is taken from the 25th.

# Various indexing is supported:
rates['USD'].name  # US Dollar
rates['R01235'].name  # US Dollar
rates['840'].name  # US Dollar

rates['USD']
'''
    ExchangeRate(
        id='R01235',
        name='US Dollar',
        code='USD',
        num='840',
        value=Decimal('65.5287'),
        par=Decimal('1'),
        rate=Decimal('65.5287'))
'''

Release history Release notifications

This version
History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pycbrf-0.1.0-py2.py3-none-any.whl (6.4 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jun 27, 2016
pycbrf-0.1.0.tar.gz (11.3 kB) Copy SHA256 hash SHA256 Source None Jun 27, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page