Sha256: 018eef38b60b0b68487739ad252f6ac2b9523988601760d9a211de26c8b3b06c

Contents?: true

Size: 942 Bytes

Versions: 6

Compression:

Stored size: 942 Bytes

Contents

# Quandl::Format

## Purpose

Load and dump [quandl data format](http://www.quandl.com/help/toolbelt#Quandl-Flavored-CSV).


## Installation

```ruby
gem 'quandl_format'
```


## Configuration

Add this to your Rakefile:

```ruby
require 'quandl/format'
```


## Usage


#### Load

```ruby
# open a file
file = File.open("spec/fixtures/data/annual.qdf")
# read each line of the file until a dataset node has been built
# pass each dataset node to the block for manipulation
Quandl::Format::Dataset.each_line(file) do |dataset|
  puts "full_code: #{dataset.full_code}"
  puts "first_line_of_data: #{dataset.data.first.to_s}"
end
```


#### Dump

```ruby
# load the file as a collection of Dataset instances
datasets = Quandl::Format::Dataset.load_from_file("spec/fixtures/data/annual.qdf")
# make some changes
dataset = datasets.first
dataset.code = 'NEW_CODE'
# dump the collection as QDF
puts Quandl::Format::Dataset.dump( [dataset] )
```


Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
quandl_format-0.5.1 README.md
quandl_format-0.5.0 README.md
quandl_format-0.4.3 README.md
quandl_format-0.4.2 README.md
quandl_format-0.4.1 README.md
quandl_format-0.4.0 README.md