Tools to query Bank of Russia
Project description
https://github.com/idlesign/pycbrf
Description
Tools to query Bank of Russia
Provides methods to get the following information:
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'))
'''
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
pycbrf-0.1.0.tar.gz
(11.3 kB
view hashes)
Built Distribution
Close
Hashes for pycbrf-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae5cbb418ca7944373ac10e9b3c111f6138b123876404d1eae241b960439df09 |
|
MD5 | 864ebf9639f5e10a4799f2bf0f61ad18 |
|
BLAKE2b-256 | e9ac295b07b65200097ae143d35015164849d090c09b4e9070a4eea1cfbea074 |