quandl_client 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +54 -2
- data/lib/quandl/client/models/dataset.rb +0 -4
- data/lib/quandl/client/models/dataset/properties.rb +9 -0
- data/lib/quandl/client/version.rb +1 -1
- data/quandl_client.gemspec +2 -1
- metadata +19 -3
data/README.md
CHANGED
@@ -63,6 +63,57 @@ d.data_table
|
|
63
63
|
```
|
64
64
|
|
65
65
|
|
66
|
+
#### Create
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
|
70
|
+
attributes = {
|
71
|
+
code: "TEST_12345",
|
72
|
+
source_code: 'OFDP',
|
73
|
+
name: "Test Upload #{Time.now.to_i}",
|
74
|
+
frequency: 'daily',
|
75
|
+
locations:
|
76
|
+
[
|
77
|
+
{
|
78
|
+
type: 'http',
|
79
|
+
url: 'http://test.com',
|
80
|
+
post_data: '[magic]',
|
81
|
+
cookie_url: 'http://cookies.com'
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
d = Dataset.create( attributes )
|
86
|
+
|
87
|
+
```
|
88
|
+
|
89
|
+
##### Errors
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
|
93
|
+
d = Dataset.create(code: 'TEST', source_code: 'OFDP', locations_attributes: [{ type: 'http', url: 'test.com' }] )
|
94
|
+
d.errors
|
95
|
+
=> {"locations.post_data"=>["can't be blank"], "locations.cookie_url"=>["can't be blank"], "name"=>["can't be blank"], "frequency"=>["is not included in the list"]}
|
96
|
+
|
97
|
+
```
|
98
|
+
|
99
|
+
|
100
|
+
#### Update
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
|
104
|
+
d = Dataset.find("OFDP/TEST_12345")
|
105
|
+
d.name = 'New Name'
|
106
|
+
d.data = Quandl::Data::Random.table.to_csv
|
107
|
+
d.save
|
108
|
+
|
109
|
+
d = Dataset.collapse(:weekly).find("OFDP/TEST_12345")
|
110
|
+
d.data
|
111
|
+
=> [[...],...]
|
112
|
+
|
113
|
+
```
|
114
|
+
|
115
|
+
|
116
|
+
|
66
117
|
|
67
118
|
## Quandl::Client::Source
|
68
119
|
|
@@ -88,6 +139,7 @@ sheet = Quandl::Client::Source.find('STATCAN1')
|
|
88
139
|
|
89
140
|
|
90
141
|
|
142
|
+
|
91
143
|
## Quandl::Client::Sheet
|
92
144
|
|
93
145
|
|
@@ -112,7 +164,6 @@ sheet = Quandl::Client::Sheet.find('housing/hood')
|
|
112
164
|
|
113
165
|
#### Create
|
114
166
|
|
115
|
-
|
116
167
|
```ruby
|
117
168
|
|
118
169
|
include Quandl::Client
|
@@ -129,7 +180,6 @@ Sheet.find('ocean').children.first.title
|
|
129
180
|
|
130
181
|
#### Update
|
131
182
|
|
132
|
-
|
133
183
|
```ruby
|
134
184
|
|
135
185
|
Quandl::Client.token = 'xyz'
|
@@ -141,6 +191,8 @@ s.save
|
|
141
191
|
```
|
142
192
|
|
143
193
|
|
194
|
+
|
195
|
+
|
144
196
|
# Authentication
|
145
197
|
|
146
198
|
```ruby
|
@@ -15,6 +15,15 @@ module Properties
|
|
15
15
|
attributes :data, :source_code, :code, :name, :urlize_name,
|
16
16
|
:description, :updated_at, :frequency, :from_date,
|
17
17
|
:to_date, :column_names, :private, :type
|
18
|
+
|
19
|
+
attributes :locations_attributes
|
20
|
+
|
21
|
+
alias_method :locations, :locations_attributes
|
22
|
+
alias_method :locations=, :locations_attributes=
|
23
|
+
|
24
|
+
def errors
|
25
|
+
self.attributes[:errors]
|
26
|
+
end
|
18
27
|
|
19
28
|
def full_code
|
20
29
|
@full_code ||= File.join(self.source_code, self.code)
|
data/quandl_client.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_runtime_dependency "activesupport", ">= 3.0.0"
|
26
26
|
s.add_runtime_dependency "her", "~> 0.6.7"
|
27
27
|
s.add_runtime_dependency "scope_builder", "~> 0.0.6"
|
28
|
-
s.add_runtime_dependency "quandl_data", "~> 0.0.
|
28
|
+
s.add_runtime_dependency "quandl_data", "~> 0.0.5"
|
29
|
+
s.add_runtime_dependency "quandl_operation", "~> 0.0.8"
|
29
30
|
s.add_runtime_dependency 'json', '~> 1.7.7'
|
30
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.0.
|
133
|
+
version: 0.0.5
|
134
134
|
type: :runtime
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,23 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 0.0.
|
141
|
+
version: 0.0.5
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: quandl_operation
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 0.0.8
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 0.0.8
|
142
158
|
- !ruby/object:Gem::Dependency
|
143
159
|
name: json
|
144
160
|
requirement: !ruby/object:Gem::Requirement
|