Skip to main content

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)

Русский:

Библиотека для получения официальных курсов ЦБ на дату (для использования в расчетах деклараций и пр.).

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

python-cbr-0.2.0.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

python_cbr-0.2.0-py3-none-any.whl (3.4 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