BrazilCentralBank.jl Documentation

Welcome to the documentation page!

About the Project

Current release: 0.1.1 (2024-03-25)

Based on the python-bcb package for python, BrazilCentralBank.jl aims to provide the same level of features to the Julia Language. Currently the package can interact with the foreign exchange (FOREX) prices as shows in the time series availiable in the Brazil's Central Bank (BCB) website.

Right now the project is in its early days and the implementation still resembles a lot the original python project. Future updates include the addition other data sources from the BCB's site such as interest rates, inflation, etc.

The final goal is for this to be a comprehensive set of tools for anyone trying to analyse the brazilian economy using Julia!

Instalation

Source code are avaliable in this project directory, but instalation through Julia's package manager is also avaliable.

julia> using Pkg; Pkg.add(BrazilCentralBank)

API Documentation

BrazilCentralBankModule

The BrazilCentralBank package aims to provide a user interface to Brazil's Central Bank (BCB) web data API.

AUTHOR: azeredo-e@github
GITHUB: github.com/azeredo-e/BCB.jl
LICENSE: MIT License
VERSION: 0.1.0

BrazilCentralBank.getcurrency_listMethod
get_currency_list(;convert_to_utf=true) -> DataFrame

List all avaliables currencies in the BCB API, as well as basic information such as currency code, country of origin, etc.

Args:

converttoutf (Bool, optional): By default BCB information comes in the ISO-8859-1 encoding, different from the UTF-8 pattern used by Julia. This argument forces the API result to come in UTF-8, preventing encoding errors. Defaults to true.

Returns:

DataFrames.DataFrame: DataFrame with all avaliable currencies information.

Examples:

julia> getcurrency_list()
273×7 DataFrame
 Row │ code   name                          symbol  country_code  country_name ⋯
     │ Int32  String                        String  Int32         String       ⋯
─────┼──────────────────────────────────────────────────────────────────────────
   1 │     5  AFEGANE AFEGANIST             AFN              132  AFEGANISTAO  ⋯
   2 │   785  RANDE/AFRICA SUL              ZAR             7560  AFRICA DO SU
   3 │   490  LEK ALBANIA REP               ALL              175  ALBANIA, REP
   4 │   610  MARCO ALEMAO                  DEM              230  ALEMANHA
   5 │   978  EURO                          EUR              230  ALEMANHA     ⋯
   6 │   690  PESETA/ANDORA                 ADP              370  ANDORRA
   7 │   635  KWANZA/ANGOLA                 AOA              400  ANGOLA
   8 │   215  DOLAR CARIBE ORIENTAL         XCD              418  ANGUILLA
  ⋮  │   ⋮                 ⋮                  ⋮          ⋮                     ⋱
 267 │    26  BOLIVAR VENEZUELANO           VEF             8508  VENEZUELA    ⋯
 268 │   260  DONGUE/VIETNAN                VND             8583  VIETNA
 269 │   220  DOLAR DOS EUA                 USD             8630  VIRGENS,ILHA
 270 │   220  DOLAR DOS EUA                 USD             8664  VIRGENS,ILHA
 271 │   766  QUACHA ZAMBIA                 ZMW             8907  ZAMBIA       ⋯
 272 │   765  QUACHA ZAMBIA                 ZMK             8907  ZAMBIA
 273 │   217  DOLAR ZIMBABUE                ZWL             6653  ZIMBABUE
                                                  3 columns and 258 rows omitted
BrazilCentralBank.gettimeseriesMethod

#!fix name for 0.2.0 gettimeseries(symbols::Union{String, Array}, start::Any, finish::Any, side::String="ask", groupby::String="symbol")

DataFrame with the time series of selected currencies.

Args:

symbol (Union{String, Array}): ISO code of desired currencies.
start (Union{AbstractTime, AbstractString, Number}): Desired start date. The type are set this way because it can accept any valid input to Dates.Date().
end (Union{AbstractTime, AbstractString, Number}): Desired end date.
side (String, optional): Which FOREX prices to return "ask" prices, "side" prices or "both". Defaults to "ask".
groupby (String, optional): In what way the columns are grouped, "symbol" or "side".

Returns:

DataFrames.DataFrame: DataFrame with foreign currency prices.

Raises:

ArgumentError: Values passed to side or groupby are not valid.

Examples:

julia> gettimeseries("USD", "2023-12-01", "2023-12-10")
6×2 DataFrame
 Row │ Date        ask_USD 
     │ Date        Float64
─────┼─────────────────────
   1 │ 2023-12-01   4.9191
   2 │ 2023-12-04   4.9091
   3 │ 2023-12-05   4.9522
   4 │ 2023-12-06   4.9031
   5 │ 2023-12-07   4.8949
   6 │ 2023-12-08   4.9158