SeriesBR

pypi downloads travis codecov

SeriesBR is a Python package to interact with brazilian time series databases such as:

  • Banco Central do Brasil (BCB)
  • Instituto de Pesquisa Econômica Aplicada (IPEA)
  • Instituto Brasileiro de Geografia e Estatística (IBGE)

It integrates well with pandas as almost all functions return a DataFrame.

Installation

Get the latest version with:

$ pip3 install --upgrade seriesbr

Main Features

  • Get multiple time series with get_series.
  • Search in a given database with search.
  • Get metadata with get_metadata.

Developer

And here you can explore the source code and its documentation:

Quick Demo

Here’s how to get series from both BCB and IPEA:

In [1]: from seriesbr import seriesbr

In [2]: dados = seriesbr.get_series(
   ...:     {
   ...:         "spread": 20786,
   ...:         "pib_mensal": 4380,
   ...:         "igp": "PAN12_IGPDIG12",
   ...:         "inadimplência": "BM12_CRLIN12"
   ...:     },
   ...:     join="inner",
   ...: )
   ...: 

In [3]: import matplotlib.pyplot as plt

In [4]: import matplotlib

In [5]: dados.plot(subplots=True, layout=(2, 2), figsize=(7, 5));

In [6]: plt.gcf().tight_layout();

In [7]: plt.suptitle("Séries do IPEADATA e do BCB");

In [8]: plt.subplots_adjust(top=.9)
_images/index.png

Indices and tables