Giter Club home page Giter Club logo

fred's Introduction

Fred

This is a Ruby wrapper for the St. Louis Federal Reserve Economic Data Fred API.

Installation

As a gem:

gem install fred -v 0.3.0    

Get a FRED API key

Sign up for a Fred API key: http://api.stlouisfed.org/api_key.html

Usage

Instantiate a client

>> fred = Fred::Client.new(:api_key => 'your_api_key')

or configure once

>> Fred.configure do |config|
>>   config.api_key = 'your_api_key'
>> end
>> fred = Fred::Client.new

Examples

>> fred.category(nil, :category_id => '125')
=> <#Hashie::Mash categories=<#Hashie::Mash category=<#Hashie::Mash id="125" name="Trade Balance" parent_id="13">>>

>> fred.series(nil, :series_id => 'GNPA')
=> #<Hashie::Mash seriess=#<Hashie::Mash realtime_end="2013-08-26" realtime_start="2013-08-26" series=#<Hashie::Mash frequency="Annual" frequency_short="A" id="GNPA" last_updated="2013-07-31 09:26:17-05" notes="BEA Account Code: A001RC1" observation_end="2012-01-01" observation_start="1929-01-01" popularity="46" realtime_end="2013-08-26" realtime_start="2013-08-26" seasonal_adjustment="Not Seasonally Adjusted" seasonal_adjustment_short="NSA" title="Gross National Product" units="Billions of Dollars" units_short="Bil. of $">>>

>> fred.series('observations', :series_id => 'GNPA')
=> #<Hashie::Mash observations=#<Hashie::Mash count="84" file_type="xml" limit="100000" observation=[#<Hashie::Mash date="1929-01-01" realtime_end="2013-08-26" realtime_start="2013-08-26" value="105.3">,
.....
#<Hashie::Mash date="2012-01-01" realtime_end="2013-08-26" realtime_start="2013-08-26" value="16497.4">] observation_end="9999-12-31" observation_start="1776-07-04" offset="0" order_by="observation_date" output_type="1" realtime_end="2013-08-26" realtime_start="2013-08-26" sort_order="asc" units="lin">>

Copyright

Contact me if you have any suggestions and feel free to fork it!

Copyright (c) 2009 Johnny Khai Nguyen, released under the MIT license

fred's People

Contributors

jasonl99 avatar johnnyn avatar phuphighter avatar tshieh 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.