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

Metadata

Release files for pycbrf 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycbrf 1.1.0
File Size Uploaded
pycbrf-1.1.0.tar.gz 14.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pycbrf 1.1.0
File Interpreter ABI Platform
pycbrf-1.1.0-py3-none-any.whl Python 3 none any Details
pycbrf-1.1.0-py2-none-any.whl Python 2 none any Details

Total release size: 40.4 kB

Release files / pycbrf-1.1.0.tar.gz

Download URL pycbrf-1.1.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5aa83e886e9f0fcf7c4aff1fd463d130e076800e268386a9797f66308244bebd
BLAKE2b-256 checksum
How to use checksums
32a740769e1d423d6d355942a0963111681a4a7942a534f0b1662cbbcd17b505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release files / pycbrf-1.1.0-py3-none-any.whl

Download URL pycbrf-1.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0aca6e7f363a1188a8edb2df57e526cf9f782df2b152e8691bac264fc9bb3b00
BLAKE2b-256 checksum
How to use checksums
1db403ec4f70d85c1b129f8f030dbe62b0d523335ac1f0752dc20ff282b8e5d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release files / pycbrf-1.1.0-py2-none-any.whl

Download URL pycbrf-1.1.0-py2-none-any.whl
Size 13.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3b74c086dd034c8bfd9cde314a8c87c2f04659adabdd810c39f3990b7bf52700
BLAKE2b-256 checksum
How to use checksums
9108170f779152ccf21f17aa3f6dfec4959b5e84ac8739b264af7af47b1e312d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

3 release files

1.0.1

3 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release 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