CLI requires click package to be installed. Can be installed with pycbrf using:
$pipinstallpycbrf[cli]
Python
frompycbrfimportExchangeRates,Banksrates=ExchangeRates('2016-06-26',locale_en=True)rates.date_requested# 2016-06-26 00:00:00rates.date_received# 2016-06-25 00:00:00rates.dates_match# False# Note: 26th of June was a holiday, data is taken from the 25th.# Various indexing is supported:rates['USD'].name# US Dollarrates['R01235'].name# US Dollarrates['840'].name# US Dollarrates['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']assertbankbank.swift# SABRRUMMNH1bank.corr# 30101810500000000641bank_annotated=Banks.annotate([bank])[0]fortitle,valueinbank_annotated.items():print(f'{title}: {value}')