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/.
Release files for sgs 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sgs-2.0.4.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sgs-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.7 kB
Release files / sgs-2.0.4.tar.gz
| Download URL | sgs-2.0.4.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de22c31f76f0a0b87823bd0b20382812e0fcc539dbd6bf155972c238c09d09c0
|
|
BLAKE2b-256 checksum How to use checksums |
24be83e5f9ca69b898415ce2bda76263eef15f76c6cc0cd6c3ceb44c69f81cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.6.8
|
Release files / sgs-2.0.4-py3-none-any.whl
| Download URL | sgs-2.0.4-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50b2738b7580fdb4f1a1ab88a043b2f176ce76e601c7ace3c480505641dd8674
|
|
BLAKE2b-256 checksum How to use checksums |
67cdadfd617abeed1ea1cd2baa7041d0fa6d2ade1e6b092c259d1129be565125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.6.8
|