Read the official exchange rates data from cbr.ru
Project description
CBR
Provides functionality to get official CBR (Central Bank of Russia) exchange rates. Typical usage often looks like this:
#!/usr/bin/env python
from cbr import get_exchange_rates
get_exchange_rates('15.05.2010')
get_exchange_rates('13.01.2020', codes=['840', '978'])
get_exchange_rates('13.01.2020', code='840')
get_exchange_rates('13.01.2020', symbols=['USD', 'EUR'])
get_exchange_rates('13.01.2020', symbol='JPY')
Result is array like this:
[{'code': '392', 'symbol': 'JPY', 'amount': 100, 'rate': Decimal('55.9098')}]
(Note amount column, it's not always 1)
Raises an InvalidDateArgException if date < 01.07.1992 or > today.
Русский:
Библиотека для получения официальных курсов ЦБ на дату (для использования в расчетах деклараций и пр.).
Кидает исключение InvalidDateArgException если данных на дату нет.
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
python-cbr-0.1.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for python_cbr-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5fb5466f2c0c3141fca930300f39106dccd7427a2657a5108439b54fcf2d54b |
|
MD5 | e3fae62ff6edd42f4928cce1f72ced58 |
|
BLAKE2b-256 | fe4660f43c75511ff42cdda138598a3ab4778c5575a88c552bcb2ef2fe5fcf4f |