fredric 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/fredric/api.rb +2 -2
- data/lib/fredric/docopt.txt +10 -1
- data/lib/fredric/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeded696850394a227db2c59808569535a5d330f
|
4
|
+
data.tar.gz: f27002ee98c5af408210938274f60f3980fc79b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f23601ce059eecc8db1eb283a25a00df26228f61894449d155dcdbc9e1277ca0a8bd425ebc4d6f59b849c46b35f4e0539c878ca6555a43e7381cbaeb57481cd4
|
7
|
+
data.tar.gz: fe256721ce32f02248f9d5118bac89213d7a25ac62f1c1ab26a8708d56836366cfd8f4bb1ba99e028ed3f1247fcc90e42564131df1734842456a6be8ee109191
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ First, require and initialize with your [FRED API Key][4].
|
|
46
46
|
|
47
47
|
```ruby
|
48
48
|
require 'fredric'
|
49
|
-
fredric = Fredric::API.new
|
49
|
+
fredric = Fredric::API.new 'your-api-key'
|
50
50
|
```
|
51
51
|
|
52
52
|
Now, you can access any FRED endpoint with any optional parameter, like
|
@@ -192,7 +192,7 @@ these environment variables:
|
|
192
192
|
```
|
193
193
|
$ export FREDRIC_CACHE_DIR=cache # default: 'cache'
|
194
194
|
$ export FREDRIC_CACHE_LIFE=120 # default: 3600 (1 hour)
|
195
|
-
$
|
195
|
+
$ fred see category/children
|
196
196
|
# => This call will be cached
|
197
197
|
```
|
198
198
|
|
@@ -201,3 +201,4 @@ $ fredric get indices
|
|
201
201
|
[2]: https://github.com/DannyBen/fredric/blob/master/lib/fredric/docopt.txt
|
202
202
|
[3]: https://github.com/DannyBen/webcache
|
203
203
|
[4]: https://research.stlouisfed.org/docs/api/api_key.html
|
204
|
+
|
data/lib/fredric/api.rb
CHANGED
@@ -38,7 +38,7 @@ module Fredric
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def get_csv(*args)
|
41
|
-
response = get
|
41
|
+
response = get(*args)
|
42
42
|
|
43
43
|
raise Fredric::BadResponse, "API said '#{response}'" if response.is_a? String
|
44
44
|
raise Fredric::BadResponse, "Got a #{response.class}, expected a Hash" unless response.is_a? Hash
|
@@ -55,7 +55,7 @@ module Fredric
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def save_csv(file, *args)
|
58
|
-
data = get_csv
|
58
|
+
data = get_csv(*args)
|
59
59
|
File.write file, data
|
60
60
|
end
|
61
61
|
|
data/lib/fredric/docopt.txt
CHANGED
@@ -57,5 +57,14 @@ Environment Variables:
|
|
57
57
|
will not be cached.
|
58
58
|
|
59
59
|
Examples:
|
60
|
+
fred see category/children
|
60
61
|
fred see series/observations series_id:GNPCA
|
61
|
-
fred get --csv series/observations series_id:GNPCA
|
62
|
+
fred get --csv series/observations series_id:GNPCA
|
63
|
+
fred see series/search "search_text:consumer price index" limit:3
|
64
|
+
fred save result.json series/search search_text:cpi limit:3
|
65
|
+
fred save --csv result.csv series/observations series_id:GNPCA
|
66
|
+
|
67
|
+
Additional Information:
|
68
|
+
Fredric Home: https://github.com/DannyBen/fredric
|
69
|
+
FRED API Docs: https://research.stlouisfed.org/docs/api/fred/
|
70
|
+
|
data/lib/fredric/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fredric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
@@ -167,7 +167,7 @@ files:
|
|
167
167
|
- lib/fredric/exceptions.rb
|
168
168
|
- lib/fredric/version.rb
|
169
169
|
- lib/fredric/web_api.rb
|
170
|
-
homepage: https://github.com/DannyBen/
|
170
|
+
homepage: https://github.com/DannyBen/fredric
|
171
171
|
licenses:
|
172
172
|
- MIT
|
173
173
|
metadata: {}
|