Skip to main content

https://github.com/idlesign/pycbrf

https://img.shields.io/pypi/v/pycbrf.svg https://img.shields.io/pypi/l/pycbrf.svg https://img.shields.io/coveralls/idlesign/pycbrf/master.svg https://img.shields.io/travis/idlesign/pycbrf/master.svg

Description

Tools to query Bank of Russia

Provides methods to get the following information:

  1. Exchange rates on various dates

  2. Banks information (requisites, codes, numbers, etc.)

Requirements

  • Python 3.6+

  • requests Python package

  • dbf_light Python package (to support legacy Bank format)

  • click package (optional, for CLI)

Usage

CLI

$ pycbrf --help

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

$ pycbrf banks
$ pycbrf banks -b 045004641

CLI requires click package to be installed. Can be installed with pycbrf using:

$ pip install pycbrf[cli]

Python

from pycbrf import ExchangeRates, Banks


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'))
'''

banks = Banks()
bank = banks['045004641']
assert bank
bank.swift  # SABRRUMMNH1
bank.corr  # 30101810500000000641

bank_annotated = Banks.annotate([bank])[0]
for title, value in bank_annotated.items():
    print(f'{title}: {value}')

Download files

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

Source Distribution

pycbrf-1.0.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycbrf-1.0.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

pycbrf-1.0.1-py2-none-any.whl (12.9 kB view details)

Uploaded Python 2

File details

Details for the file pycbrf-1.0.1.tar.gz.

File metadata

  • Download URL: pycbrf-1.0.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for pycbrf-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0f7b78d990b95660bdd76fca9d780c52d49595d68fc24e7a51e460ddb1066a60
MD5 cbbe858a82770b8917ebde360dee26a1
BLAKE2b-256 96913e971380691cc3ff997c3ae87777060a2f43469bd00d1e418931dafa83af

See more details on using hashes here.

File details

Details for the file pycbrf-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pycbrf-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for pycbrf-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de628607520aca8f3dbc31c91e12dc03ced4fe8e83792fc356bcdcba7b0e0076
MD5 219e45c6c4052e571126de43e88dc429
BLAKE2b-256 091b70d30d0074c75c2106ac5526a56589dc7e66705adf9dc68e9580478d5267

See more details on using hashes here.

File details

Details for the file pycbrf-1.0.1-py2-none-any.whl.

File metadata

  • Download URL: pycbrf-1.0.1-py2-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for pycbrf-1.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 265e9171e4cb10eb51fdd040a1f99ce376fb269b6f798fbef8478a3010adcf0f
MD5 dc5c06b3d9b501dea55e88d909221491
BLAKE2b-256 2c22cb9f53f1c343079bb537230f4bd49a56060009f33b86cca553ac8c0a8f3e

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

3 files

This release

1.0.1 This release

3 files

1.0.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page