Skip to main content

Python wrapper para o webservice do SGS - Sistema Gerenciador de Series Temporais do Banco Central do Brasil.

Project description

https://img.shields.io/pypi/v/sgs.svg https://img.shields.io/pypi/l/sgs.svg https://img.shields.io/pypi/pyversions/sgs.svg https://img.shields.io/pypi/dm/sgs.svg https://img.shields.io/travis/rafpyprog/pysgs.svg codecov.io Read the docs!

pic 1 SGS

Introduction

This library provides a pure Python interface for the Brazilian Central Bank’s Time Series Management System (SGS) api. It works with Python 3.5 and above.

SGS is a service with more than 18,000 time series with economical and financial information. This library is intended to make it easier for Python programmers to use this data in projects of any kind, providing mechanisms to search for, extract and join series.

Quickstart

Access time series data with sgs is very simple

Begin by importing the sgs module:

import sgs

Now, let’s try to get a time serie. For this example, let’s get the “Interest rate - CDI” time serie in 2018, wich has the code 12.

CDI_CODE = 12
ts = sgs.time_serie(CDI_CODE, start='02/01/2018', end='31/12/2018')

Now, we have a Pandas Series object called ts, with all the data and the index representing the dates.

ts.head()

2018-01-02

0.026444

2018-01-03

0.026444

2018-01-04

0.026444

2018-01-05

0.026444

2018-01-08

0.026444

Feature Suport

  • Get time serie data with an one-liner using sgs.time_serie

  • Create a dataframe from a list of time series codes with sgs.dataframe

  • Search time series by text or code with sgs.search_ts

  • Get metadata from all the series in a dataframe using sgs.metadata

  • Support to search and metadata in English and Portuguese

  • Automatic retry

  • Automatic cached requests

Installation

To install, simply use pip:

$ pip install sgs

Documentation

Complete documentation is available at https://pysgs.readthedocs.io/en/stable/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgs-2.1.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

sgs-2.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file sgs-2.1.1.tar.gz.

File metadata

  • Download URL: sgs-2.1.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for sgs-2.1.1.tar.gz
Algorithm Hash digest
SHA256 f0a6720f0b17999a032b2dba479d741a71d575e99f9632b5ce60ac1d85ed8fce
MD5 15052886fec41c3d35060e1821941a1d
BLAKE2b-256 83bb6b67adba2b72251ea730976c8d03a74a35fc8705b89941c9f4bd5d9e5cdd

See more details on using hashes here.

File details

Details for the file sgs-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: sgs-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for sgs-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43a18c76ea16a0d8d314f0bcedc1994bb3492ba01b8715a0ddf9e91eb5abf048
MD5 b74257f0e9785b65b44d50e4c1315184
BLAKE2b-256 f8dd48376be02194b9033e610b7d824a8cd139f1ee19db0c1249cd6944432bd2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page