Git Product home page Git Product logo

pysgs's Introduction

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/.

pysgs's People

Contributors

rafpyprog avatar gpetrini avatar royopa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.