Central Bank of the Russian Federation API Elixir wrapper


Just released small hex package for Elixir (GitHub link), for fetching exchange rates from (Central Bank of the Russian Federation).

Get daily data (for today’s date):

iex(1)> CbrElixir.daily
  %CbrElixir.Models.ValuteCurses{valcurs: [%CbrElixir.Models.Valute{charcode: "AUD",
     id: "R01010", name: "Австралийский доллар", nominal: 1,
     numcode: "036", value: "45,8701"},
    %CbrElixir.Models.Valute{charcode: "AZN", id: "R01020A",
     name: "Азербайджанский манат", nominal: 1,
     numcode: "944", value: "35,4713"},
    %CbrElixir.Models.Valute{charcode: "GBP", id: "R01035",
     name: "Фунт стерлингов Соединенного королевства",
     nominal: 1, numcode: "826", value: "78,2273"}

Get data for specific date:

iex(1)> CbrElixir.daily("03.08.2014")
  %CbrElixir.Models.ValuteCurses{valcurs: [%CbrElixir.Models.Valute{charcode: "AUD",
     id: "R01010", name: "Австралийский доллар", nominal: 1,
     numcode: "036", value: "43,9016"},
    %CbrElixir.Models.Valute{charcode: "AZN", id: "R01020A",
     name: "Азербайджанский манат", nominal: 1,
     numcode: "944", value: "57,4120"},
    %CbrElixir.Models.Valute{charcode: "GBP", id: "R01035",
     name: "Фунт стерлингов Соединенного королевства",
     nominal: 1, numcode: "826", value: "93,9403"}

Get currencies catalog:

iex(1)> CbrElixir.valute_catalog
  %CbrElixir.Models.Valutes{items: [%CbrElixir.Models.Item{engname: "Moldova Lei",
     id: "R01500", name: "Молдавский лей", nominal: 10,
     parentcode: "R01500"},
    %CbrElixir.Models.Item{engname: "US Dollar", id: "R01235",
     name: "Доллар США", nominal: 1, parentcode: "R01235"},
    %CbrElixir.Models.Item{engname: "S.African Rand", id: "R01810",
     name: "Южноафриканский рэнд", nominal: 10,
     parentcode: "R01810"}

Get specific currency rate by charcode:

iex(4)> CbrElixir.daily_by_code(:EUR, '31-12-2001')
  %CbrElixir.Models.Valute{charcode: "EUR", id: "R01239", name: "Евро",
     nominal: 1, numcode: "978", value: "26,4900"}