{"id":13936824,"url":"https://github.com/idlesign/pycbrf","last_synced_at":"2025-04-14T09:41:48.998Z","repository":{"id":46798284,"uuid":"62053279","full_name":"idlesign/pycbrf","owner":"idlesign","description":"Tools to query Bank of Russia","archived":false,"fork":false,"pushed_at":"2021-09-25T05:11:53.000Z","size":2823,"stargazers_count":58,"open_issues_count":3,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T23:02:08.634Z","etag":null,"topics":["bank","currency","exchange-rates","python","python2","python3","russia"],"latest_commit_sha":null,"homepage":"https://github.com/idlesign/pycbrf","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-27T12:05:28.000Z","updated_at":"2024-12-26T06:18:53.000Z","dependencies_parsed_at":"2022-09-05T11:10:53.509Z","dependency_job_id":null,"html_url":"https://github.com/idlesign/pycbrf","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpycbrf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpycbrf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpycbrf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpycbrf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/pycbrf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855959,"owners_count":21172673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bank","currency","exchange-rates","python","python2","python3","russia"],"created_at":"2024-08-07T23:03:01.977Z","updated_at":"2025-04-14T09:41:48.962Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"pycbrf\n======\nhttps://github.com/idlesign/pycbrf\n\n.. image:: https://img.shields.io/pypi/v/pycbrf.svg\n    :target: https://pypi.python.org/pypi/pycbrf\n\n.. image:: https://img.shields.io/pypi/l/pycbrf.svg\n    :target: https://pypi.python.org/pypi/pycbrf\n\n.. image:: https://img.shields.io/coveralls/idlesign/pycbrf/master.svg\n    :target: https://coveralls.io/r/idlesign/pycbrf\n\n\nDescription\n-----------\n\n*Tools to query Bank of Russia*\n\nProvides methods to get the following information:\n\n1. Exchange rates on various dates (including basic currencies data)\n2. Banks information (requisites, codes, numbers, etc.)\n\n\nRequirements\n------------\n\n* Python 3.6+\n* ``requests`` Python package\n* ``dbf_light`` Python package (to support legacy Bank format)\n* ``click`` package (optional, for CLI)\n\n\nUsage\n-----\n\nCLI\n~~~\n\n.. code-block:: bash\n\n    $ pycbrf --help\n\n    $ pycbrf rates\n    $ pycbrf rates -d 2016-06-26 -c USD\n\n    $ pycbrf banks\n    $ pycbrf banks -b 045004641\n\n\nCLI requires ``click`` package to be installed. Can be installed with ``pycbrf`` using:\n\n.. code-block:: bash\n\n    $ pip install pycbrf[cli]\n\n\n\nPython\n~~~~~~\n\n.. code-block:: python\n\n    from pycbrf import ExchangeRates, Banks\n\n\n    rates = ExchangeRates('2016-06-26', locale_en=True)\n\n    rates.date_requested  # 2016-06-26 00:00:00\n    rates.date_received  # 2016-06-25 00:00:00\n    rates.dates_match  # False\n    # Note: 26th of June was a holiday, data is taken from the 25th.\n\n    # Various indexing is supported:\n    rates['USD'].name  # US Dollar\n    rates['R01235'].name  # US Dollar\n    rates['840'].name  # US Dollar\n\n    rates['USD']\n    '''\n        ExchangeRate(\n            id='R01235',\n            name='US Dollar',\n            code='USD',\n            num='840',\n            value=Decimal('65.5287'),\n            par=Decimal('1'),\n            rate=Decimal('65.5287'),\n            date=datetime(2016, 06, 25),\n            currency=Currency(\n                id='R01235',\n                name_eng='US Dollar',\n                name_ru='Доллар США',\n                num='840',\n                code='USD',\n                par=Decimal('1')\n            )\n        )\n    '''\n\n    banks = Banks()\n    bank = banks['045004641']\n    assert bank\n    bank.swift  # SABRRUMMNH1\n    bank.corr  # 30101810500000000641\n\n    bank_annotated = Banks.annotate([bank])[0]\n    for title, value in bank_annotated.items():\n        print(f'{title}: {value}')\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fpycbrf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fpycbrf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fpycbrf/lists"}