Giter Club home page Giter Club logo

quandl-api's Introduction

quandl-api

This library provides an easy way to download data from Quandl.com in Haskell.

Installation

Basic Usage

The getTable function is all you need to download tables. To get all data points for the dataset FRED/GDP:

import Data.Quandl
getTable "FRED" "GDP" Nothing

Registered users should include their auth_token, like this:

import Data.Quandl
getTable "FRED" "GDP" (Just "dsahFHUiewjjd")

Advanced Usage

The getTableWith function allows you to use query a subset of the data, query multiple tables (multisets), apply frequency conversions, and apply transformations supported by Quandl. For example, here is the annual percentage return for AAPL stock over the previous decade, in ascending date order:

import Data.Quandl
import Data.Time (fromGregorian)
getTableWith (defaultOptions {opSortAscending  = True, 
                              opStartDate      = Just (fromGregorian 2000 1 1), 
                              opEndDate        = Just (fromGregorian 2010 1 1), 
                              opFrequency      = Just Annual, 
                              opTransformation = Just RDiff})
             [("WIKI", "AAPL", Just 4)]  -- Just 4 means we only want the 4'th column (Close price)

You can pull data from multiple datasets (or from multiple columns in a single dataset) using this function as well. In the example below, we combine US GDP from FRED/GDP, crude oil spot prices from DOE/RWTC, and Apple closing prices from WIKI/AAPL. We are going to convert all of them to annual percentage changes, and look only at data for the last 10 years:

import Data.Quandl
getTableWith (defaultOptions {opNumRows        = Just 10,
                              opFrequency      = Just Annual,
                              opTransformation = Just RDiff})
             [("FRED", "GDP", Just 1), ("DOE", "RWTC", Just 1), ("WIKI", "AAPL", Just 4)]

See http://www.quandl.com/help/api for detailed information on the Quandl API.

quandl-api's People

Contributors

dpkatz avatar fpcomplete-support avatar mwm avatar pvdbrand avatar

Watchers

 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.