Skip to main content
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://github.com/rafpyprog/pySGS/actions/workflows/tests.yml/badge.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/.

Metadata

Release files for sgs 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgs 3.0.0
File Size Uploaded
sgs-3.0.0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sgs 3.0.0
File Interpreter ABI Platform
sgs-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / sgs-3.0.0.tar.gz

Download URL sgs-3.0.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4eab9c7372ff37bedae03926dc135c682307f4d116ca84af62cbfc16512bc30d
BLAKE2b-256 checksum
How to use checksums
285cb51664d3294fb3f265bc3df22c2fd6cec514dcb50128c2dd17d01c8ec159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / sgs-3.0.0-py3-none-any.whl

Download URL sgs-3.0.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3fd81546165910c9bfe1838929ca6a6b8d1574a3f365aa9aaadc6d4212ebaaa
BLAKE2b-256 checksum
How to use checksums
d41874e1f67ea6c1eb51694d5da0db4db6086fc7099f237408b59f8f95b8f662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0

2 release files

1.30.2

2 release files

1.30.1

2 release files

1.27.4

1 release file

1.27.3

1 release file

1.27.2

1 release file

1.27.1

1 release file

1.27

1 release file

1.26

1 release file

1.25

1 release file

1.23

1 release file

1.22

1 release file

1.21

1 release file

1.3.13

1 release file

1.3.11

1 release file

1.3.1

2 release files

1.3.0

2 release files

1.2

1 release file

1.1

1 release file

1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page