fred_as_dataframe 0.1.0 → 0.1.1
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 +84 -8
- data/lib/fred_as_dataframe/client.rb +140 -0
- data/lib/fred_as_dataframe/version.rb +1 -1
- data/lib/fred_as_dataframe.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e24b9c73a6458790f20e155c14a501646947ab3c900ef50f4355dcdbfab081
|
4
|
+
data.tar.gz: a73f9fff74b59da012b063d60c128bf424529dd0fdc0634d8167a75147e45172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e5ebd6638e5cef9d52ec6de69006ebc15c74a4b40450095bf3923df718ee2740d2020a4def20c349346417b15b43f3781d043aa42adf5917a620aa5407a0a4
|
7
|
+
data.tar.gz: 75c7238bf8fd540b14956c8d3502289652d16649064079fe32fc66b6d50813e7f2c44abeb28d9a0b478f0c5469928a0f494db9bef0745e768d65d02b3798dbf4
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# EconDataReader
|
2
2
|
|
3
|
-
|
3
|
+
Up to date remote economic data access for ruby, using Polars dataframes.
|
4
4
|
|
5
|
-
|
5
|
+
This package will fetch economic and financial information from the Federal Reserve Economic Database, and return the results as a Polars Dataframe. You will need an API key that can be fetched from the FRED website at https://fredaccount.stlouisfed.org/apikeys .
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -20,19 +20,95 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install fred_as_dataframe
|
22
22
|
|
23
|
+
|
24
|
+
### Configuration
|
25
|
+
|
26
|
+
Some data sources will require the specification of an API key. These keys should be provided as part of a configuration file, e.g., config/fred_as_dataframe.rb
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
FredAsDataframe::Client.configure do |config|
|
30
|
+
config.fred_api_key = '1234567890ABCDEF'
|
31
|
+
OR
|
32
|
+
config.fred_api_key = File.read(File.join('','home', 'user', '.fred_api_key.txt'))
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
23
36
|
## Usage
|
24
37
|
|
25
|
-
|
38
|
+
Consider the following transcript.
|
39
|
+
|
40
|
+
``` ruby
|
41
|
+
3.1.2 :001 > a = FredAsDataframe::Client.new('UNRATE')
|
42
|
+
=> #<FredAsDataframe::Client:0x0000000105f1dbb8 @api_key="1234567890ABCDEF", @tag="UNRATE">
|
43
|
+
3.1.2 :002 > b = a.fetch
|
44
|
+
=>
|
45
|
+
shape: (919, 2)
|
46
|
+
...
|
47
|
+
3.1.2 :003 > b
|
48
|
+
=>
|
49
|
+
shape: (919, 2)
|
50
|
+
┌────────────┬────────┐
|
51
|
+
│ Timestamps ┆ UNRATE │
|
52
|
+
│ --- ┆ --- │
|
53
|
+
│ date ┆ f64 │
|
54
|
+
╞════════════╪════════╡
|
55
|
+
│ 1948-01-01 ┆ 3.4 │
|
56
|
+
│ 1948-02-01 ┆ 3.8 │
|
57
|
+
│ 1948-03-01 ┆ 4.0 │
|
58
|
+
│ 1948-04-01 ┆ 3.9 │
|
59
|
+
│ 1948-05-01 ┆ 3.5 │
|
60
|
+
│ … ┆ … │
|
61
|
+
│ 2024-03-01 ┆ 3.8 │
|
62
|
+
│ 2024-04-01 ┆ 3.9 │
|
63
|
+
│ 2024-05-01 ┆ 4.0 │
|
64
|
+
│ 2024-06-01 ┆ 4.1 │
|
65
|
+
│ 2024-07-01 ┆ 4.3 │
|
66
|
+
└────────────┴────────┘
|
67
|
+
3.1.2 :004 > a = FredAsDataframe::Client.new('AAA')
|
68
|
+
=> #<FredAsDataframe::Client:0x0000000106077d38 @api_key="1234567890ABCDEF", @tag="AAA">
|
69
|
+
3.1.2 :005 > b = a.fetch
|
70
|
+
=>
|
71
|
+
shape: (1_267, 2)
|
72
|
+
...
|
73
|
+
3.1.2 :006 > b
|
74
|
+
=>
|
75
|
+
shape: (1_267, 2)
|
76
|
+
┌────────────┬──────┐
|
77
|
+
│ Timestamps ┆ AAA │
|
78
|
+
│ --- ┆ --- │
|
79
|
+
│ date ┆ f64 │
|
80
|
+
╞════════════╪══════╡
|
81
|
+
│ 1919-01-01 ┆ 5.35 │
|
82
|
+
│ 1919-02-01 ┆ 5.35 │
|
83
|
+
│ 1919-03-01 ┆ 5.39 │
|
84
|
+
│ 1919-04-01 ┆ 5.44 │
|
85
|
+
│ 1919-05-01 ┆ 5.39 │
|
86
|
+
│ … ┆ … │
|
87
|
+
│ 2024-03-01 ┆ 5.01 │
|
88
|
+
│ 2024-04-01 ┆ 5.28 │
|
89
|
+
│ 2024-05-01 ┆ 5.25 │
|
90
|
+
│ 2024-06-01 ┆ 5.13 │
|
91
|
+
│ 2024-07-01 ┆ 5.12 │
|
92
|
+
└────────────┴──────┘
|
26
93
|
|
27
|
-
|
94
|
+
```
|
28
95
|
|
29
|
-
|
96
|
+
## Documentation
|
30
97
|
|
31
|
-
|
98
|
+
TBD
|
32
99
|
|
33
100
|
## Contributing
|
34
101
|
|
35
|
-
|
102
|
+
Others are welcome to contribute to the project.
|
103
|
+
|
104
|
+
The following conventions are intended for this project.
|
105
|
+
* Different sources are intended to reside in different classes.
|
106
|
+
* API keys (if needed) should be able to be set in the single configuration file.
|
107
|
+
* Series should be able to be identified via a single unique string, provided in the constructor.
|
108
|
+
* When fetched, the dataset may be filtered based on optional (hash) arguments.
|
109
|
+
* Output should be provided in a consistent DataFrame format (currently Polars::DataFrame).
|
110
|
+
|
111
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bmck/fred_as_dataframe.
|
36
112
|
|
37
113
|
|
38
114
|
## License
|
@@ -0,0 +1,140 @@
|
|
1
|
+
require 'polars-df'
|
2
|
+
require 'httparty'
|
3
|
+
require 'csv'
|
4
|
+
|
5
|
+
module FredAsDataframe
|
6
|
+
class Client
|
7
|
+
include ::HTTParty
|
8
|
+
attr_reader :tag
|
9
|
+
|
10
|
+
def self.configure
|
11
|
+
yield self
|
12
|
+
true
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
attr_accessor :api_key
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(series, options={})
|
20
|
+
@api_key = options[:api_key] || FredAsDataframe::Client.api_key
|
21
|
+
@tag = series
|
22
|
+
end
|
23
|
+
|
24
|
+
def fetch(start: nil, fin: nil, interval: '1d')
|
25
|
+
data = _fetch_data(interval)
|
26
|
+
i = interval[0..-2].to_i
|
27
|
+
|
28
|
+
begin
|
29
|
+
data = data.select{ |date, _| (start.nil? || date >= start.to_date) && (fin.nil? || date <= fin.to_date) }
|
30
|
+
data = data.each_slice(i).map(&:first)
|
31
|
+
rescue KeyError => e
|
32
|
+
if data.keys[3].to_s[7, 5] == "Error"
|
33
|
+
raise IOError, "Failed to get the data. Check that '#{nm}' is a valid FRED series."
|
34
|
+
else
|
35
|
+
raise e
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Polars::DataFrame.new({Timestamps: data.map(&:first), tag.to_sym => data.map(&:last)})
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def _url(n, i = 'm');
|
45
|
+
"https://api.stlouisfed.org/fred/series/observations?series_id=#{n}&api_key=#{@api_key}#{i != 'd' ? "&frequency=#{i}" : ''}"
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def _fetch_data(interval)
|
50
|
+
# Utility to fetch data
|
51
|
+
i = interval.strip[-1]
|
52
|
+
nm = tag
|
53
|
+
resp = nil
|
54
|
+
|
55
|
+
if nm == 'SP500' && i == 'm'
|
56
|
+
resp = sp500
|
57
|
+
else
|
58
|
+
resp = self.class.get(_url(nm, interval[-1]))
|
59
|
+
resp = resp.parsed_response['observations']['observation'] #.map{|a| a.join(',')}.join("\n")
|
60
|
+
resp = "date, #{nm}\n" + resp.map{|r| "#{r['date']},#{r['value']}" }.join("\n")
|
61
|
+
end
|
62
|
+
data = CSV.parse(resp, headers: true, header_converters: :symbol, converters: [:date, :float])
|
63
|
+
data = data.map { |row| [Date.parse(row[:date].to_s), row[data.headers.last].to_f] }.to_h
|
64
|
+
|
65
|
+
data
|
66
|
+
end
|
67
|
+
|
68
|
+
def sp500
|
69
|
+
"date,SP500\n1959-01-01,55.62\n1959-02-01,54.77\n1959-03-01,56.16\n1959-04-01,57.1\n1959-05-01,57.96\n1959-06-01,57.46\n1959-07-01,59.74\n1959-08-01,59.4\n1959-09-01,57.05\n1959-10-01,57\n1959-11-01,57.23\n1959-12-01,59.06\n" \
|
70
|
+
"1960-01-01,58.03\n1960-02-01,55.78\n1960-03-01,55.02\n1960-04-01,55.73\n1960-05-01,55.22\n1960-06-01,57.26\n1960-07-01,55.84\n1960-08-01,56.51\n1960-09-01,54.81\n1960-10-01,53.73\n1960-11-01,55.47\n1960-12-01,56.8\n" \
|
71
|
+
"1961-01-01,59.72\n1961-02-01,62.17\n1961-03-01,64.12\n1961-04-01,65.83\n1961-05-01,66.5\n1961-06-01,65.62\n1961-07-01,65.44\n1961-08-01,67.79\n1961-09-01,67.26\n1961-10-01,68\n1961-11-01,71.08\n1961-12-01,71.74\n" \
|
72
|
+
"1962-01-01,69.07\n1962-02-01,70.22\n1962-03-01,70.29\n1962-04-01,68.05\n1962-05-01,62.99\n1962-06-01,55.63\n1962-07-01,56.97\n1962-08-01,58.52\n1962-09-01,58\n1962-10-01,56.17\n1962-11-01,60.04\n1962-12-01,62.64\n" \
|
73
|
+
"1963-01-01,65.06\n1963-02-01,65.92\n1963-03-01,65.67\n1963-04-01,68.76\n1963-05-01,70.14\n1963-06-01,70.11\n1963-07-01,69.07\n1963-08-01,70.98\n1963-09-01,72.85\n1963-10-01,73.03\n1963-11-01,72.62\n1963-12-01,74.17\n" \
|
74
|
+
"1964-01-01,76.45\n1964-02-01,77.39\n1964-03-01,78.8\n1964-04-01,79.94\n1964-05-01,80.72\n1964-06-01,80.24\n1964-07-01,83.22\n1964-08-01,82\n1964-09-01,83.41\n1964-10-01,84.85\n1964-11-01,85.44\n1964-12-01,83.96\n" \
|
75
|
+
"1965-01-01,86.12\n1965-02-01,86.75\n1965-03-01,86.83\n1965-04-01,87.97\n1965-05-01,89.28\n1965-06-01,85.04\n1965-07-01,84.91\n1965-08-01,86.49\n1965-09-01,89.38\n1965-10-01,91.39\n1965-11-01,92.15\n1965-12-01,91.73\n" \
|
76
|
+
"1966-01-01,93.32\n1966-02-01,92.69\n1966-03-01,88.88\n1966-04-01,91.6\n1966-05-01,86.78\n1966-06-01,86.06\n1966-07-01,85.84\n1966-08-01,80.65\n1966-09-01,77.81\n1966-10-01,77.13\n1966-11-01,80.99\n1966-12-01,81.33\n" \
|
77
|
+
"1967-01-01,84.45\n1967-02-01,87.36\n1967-03-01,89.42\n1967-04-01,90.96\n1967-05-01,92.59\n1967-06-01,91.43\n1967-07-01,93.01\n1967-08-01,94.49\n1967-09-01,95.81\n1967-10-01,95.66\n1967-11-01,92.66\n1967-12-01,95.3\n" \
|
78
|
+
"1968-01-01,95.04\n1968-02-01,90.75\n1968-03-01,89.09\n1968-04-01,95.67\n1968-05-01,97.87\n1968-06-01,100.5\n1968-07-01,100.3\n1968-08-01,98.11\n1968-09-01,101.3\n1968-10-01,103.8\n1968-11-01,105.4\n1968-12-01,106.5\n" \
|
79
|
+
"1969-01-01,102\n1969-02-01,101.5\n1969-03-01,99.3\n1969-04-01,101.3\n1969-05-01,104.6\n1969-06-01,99.14\n1969-07-01,94.71\n1969-08-01,94.18\n1969-09-01,94.51\n1969-10-01,95.52\n1969-11-01,96.21\n1969-12-01,91.11\n" \
|
80
|
+
"1970-01-01,90.31\n1970-02-01,87.16\n1970-03-01,88.65\n1970-04-01,85.95\n1970-05-01,76.06\n1970-06-01,75.59\n1970-07-01,75.72\n1970-08-01,77.92\n1970-09-01,82.58\n1970-10-01,84.37\n1970-11-01,84.28\n1970-12-01,90.05\n" \
|
81
|
+
"1971-01-01,93.49\n1971-02-01,97.11\n1971-03-01,99.6\n1971-04-01,103\n1971-05-01,101.6\n1971-06-01,99.72\n1971-07-01,99\n1971-08-01,97.24\n1971-09-01,99.4\n1971-10-01,97.29\n1971-11-01,92.78\n1971-12-01,99.17\n" \
|
82
|
+
"1972-01-01,103.3\n1972-02-01,105.2\n1972-03-01,107.7\n1972-04-01,108.8\n1972-05-01,107.7\n1972-06-01,108\n1972-07-01,107.2\n1972-08-01,111\n1972-09-01,109.4\n1972-10-01,109.6\n1972-11-01,115.1\n1972-12-01,117.5\n" \
|
83
|
+
"1973-01-01,118.4\n1973-02-01,114.2\n1973-03-01,112.4\n1973-04-01,110.3\n1973-05-01,107.2\n1973-06-01,104.8\n1973-07-01,105.8\n1973-08-01,103.8\n1973-09-01,105.6\n1973-10-01,109.8\n1973-11-01,102\n1973-12-01,94.78\n" \
|
84
|
+
"1974-01-01,96.11\n1974-02-01,93.45\n1974-03-01,97.44\n1974-04-01,92.46\n1974-05-01,89.67\n1974-06-01,89.79\n1974-07-01,79.31\n1974-08-01,76.03\n1974-09-01,68.12\n1974-10-01,69.44\n1974-11-01,71.74\n1974-12-01,67.07\n" \
|
85
|
+
"1975-01-01,72.56\n1975-02-01,80.1\n1975-03-01,83.78\n1975-04-01,84.72\n1975-05-01,90.1\n1975-06-01,92.4\n1975-07-01,92.49\n1975-08-01,85.71\n1975-09-01,84.67\n1975-10-01,88.57\n1975-11-01,90.07\n1975-12-01,88.7\n" \
|
86
|
+
"1976-01-01,96.86\n1976-02-01,100.6\n1976-03-01,101.1\n1976-04-01,101.9\n1976-05-01,101.2\n1976-06-01,101.8\n1976-07-01,104.2\n1976-08-01,103.3\n1976-09-01,105.5\n1976-10-01,101.9\n1976-11-01,101.2\n1976-12-01,104.7\n" \
|
87
|
+
"1977-01-01,103.8\n1977-02-01,101\n1977-03-01,100.6\n1977-04-01,99.05\n1977-05-01,98.76\n1977-06-01,99.29\n1977-07-01,100.2\n1977-08-01,97.75\n1977-09-01,96.23\n1977-10-01,93.74\n1977-11-01,94.28\n1977-12-01,93.82\n" \
|
88
|
+
"1978-01-01,90.25\n1978-02-01,88.98\n1978-03-01,88.82\n1978-04-01,92.71\n1978-05-01,97.41\n1978-06-01,97.66\n1978-07-01,97.19\n1978-08-01,103.9\n1978-09-01,103.9\n1978-10-01,100.6\n1978-11-01,94.71\n1978-12-01,96.11\n" \
|
89
|
+
"1979-01-01,99.71\n1979-02-01,98.23\n1979-03-01,100.1\n1979-04-01,102.1\n1979-05-01,99.73\n1979-06-01,101.7\n1979-07-01,102.7\n1979-08-01,107.4\n1979-09-01,108.6\n1979-10-01,104.5\n1979-11-01,103.7\n1979-12-01,107.8\n" \
|
90
|
+
"1980-01-01,110.9\n1980-02-01,115.3\n1980-03-01,104.7\n1980-04-01,103\n1980-05-01,107.7\n1980-06-01,114.6\n1980-07-01,119.8\n1980-08-01,123.5\n1980-09-01,126.5\n1980-10-01,130.2\n1980-11-01,135.7\n1980-12-01,133.5\n" \
|
91
|
+
"1981-01-01,133\n1981-02-01,128.4\n1981-03-01,133.2\n1981-04-01,134.4\n1981-05-01,131.7\n1981-06-01,132.3\n1981-07-01,129.1\n1981-08-01,129.6\n1981-09-01,118.3\n1981-10-01,119.8\n1981-11-01,122.9\n1981-12-01,123.8\n" \
|
92
|
+
"1982-01-01,117.3\n1982-02-01,114.5\n1982-03-01,110.8\n1982-04-01,116.3\n1982-05-01,116.4\n1982-06-01,109.7\n1982-07-01,109.4\n1982-08-01,109.7\n1982-09-01,122.4\n1982-10-01,132.7\n1982-11-01,138.1\n1982-12-01,139.4\n" \
|
93
|
+
"1983-01-01,144.3\n1983-02-01,146.8\n1983-03-01,151.9\n1983-04-01,157.7\n1983-05-01,164.1\n1983-06-01,166.4\n1983-07-01,167\n1983-08-01,162.4\n1983-09-01,167.2\n1983-10-01,167.7\n1983-11-01,165.2\n1983-12-01,164.4\n" \
|
94
|
+
"1984-01-01,166.4\n1984-02-01,157.3\n1984-03-01,157.4\n1984-04-01,157.6\n1984-05-01,156.6\n1984-06-01,153.1\n1984-07-01,151.1\n1984-08-01,164.4\n1984-09-01,166.1\n1984-10-01,164.8\n1984-11-01,166.3\n1984-12-01,164.5\n" \
|
95
|
+
"1985-01-01,171.6\n1985-02-01,180.9\n1985-03-01,179.4\n1985-04-01,180.6\n1985-05-01,184.9\n1985-06-01,188.9\n1985-07-01,192.5\n1985-08-01,188.3\n1985-09-01,184.1\n1985-10-01,186.2\n1985-11-01,197.5\n1985-12-01,207.3\n" \
|
96
|
+
"1986-01-01,208.2\n1986-02-01,219.4\n1986-03-01,232.3\n1986-04-01,238\n1986-05-01,238.5\n1986-06-01,245.3\n1986-07-01,240.2\n1986-08-01,245\n1986-09-01,238.3\n1986-10-01,237.4\n1986-11-01,245.1\n1986-12-01,248.6\n" \
|
97
|
+
"1987-01-01,264.5\n1987-02-01,280.9\n1987-03-01,292.5\n1987-04-01,289.3\n1987-05-01,289.1\n1987-06-01,301.4\n1987-07-01,310.1\n1987-08-01,329.4\n1987-09-01,318.7\n1987-10-01,280.2\n1987-11-01,245\n1987-12-01,241\n" \
|
98
|
+
"1988-01-01,250.5\n1988-02-01,258.1\n1988-03-01,265.7\n1988-04-01,262.6\n1988-05-01,256.1\n1988-06-01,270.7\n1988-07-01,269.1\n1988-08-01,263.7\n1988-09-01,268\n1988-10-01,277.4\n1988-11-01,271\n1988-12-01,276.5\n" \
|
99
|
+
"1989-01-01,285.4\n1989-02-01,294\n1989-03-01,292.7\n1989-04-01,302.3\n1989-05-01,313.9\n1989-06-01,323.7\n1989-07-01,331.9\n1989-08-01,346.6\n1989-09-01,347.3\n1989-10-01,347.4\n1989-11-01,340.2\n1989-12-01,348.6\n" \
|
100
|
+
"1990-01-01,339.97\n1990-02-01,330.45\n1990-03-01,338.46\n1990-04-01,338.18\n1990-05-01,350.25\n1990-06-01,360.39\n1990-07-01,360.03\n1990-08-01,330.75\n1990-09-01,315.41\n1990-10-01,307.12\n1990-11-01,315.29\n" \
|
101
|
+
"1990-12-01,328.75\n1991-01-01,325.49\n1991-02-01,362.26\n1991-03-01,372.28\n1991-04-01,379.68\n1991-05-01,377.99\n1991-06-01,378.29\n1991-07-01,380.23\n1991-08-01,389.4\n1991-09-01,387.2\n1991-10-01,386.88\n1991-11-01,385.92" \
|
102
|
+
"\n1991-12-01,388.51\n1992-01-01,416.08\n1992-02-01,412.56\n1992-03-01,407.36\n1992-04-01,407.41\n1992-05-01,414.81\n1992-06-01,408.27\n1992-07-01,415.05\n1992-08-01,417.93\n1992-09-01,418.48\n1992-10-01,412.5\n" \
|
103
|
+
"1992-11-01,422.84\n1992-12-01,435.64\n1993-01-01,435.23\n1993-02-01,441.7\n1993-03-01,450.16\n1993-04-01,443.08\n1993-05-01,445.25\n1993-06-01,448.06\n1993-07-01,447.29\n1993-08-01,454.13\n1993-09-01,459.24\n" \
|
104
|
+
"1993-10-01,463.9\n1993-11-01,462.89\n1993-12-01,465.95\n1994-01-01,472.99\n1994-02-01,471.58\n1994-03-01,463.81\n1994-04-01,447.23\n1994-05-01,450.9\n1994-06-01,454.83\n1994-07-01,451.4\n1994-08-01,464.24\n1994-09-01,466.96\n" \
|
105
|
+
"1994-10-01,463.81\n1994-11-01,461.01\n1994-12-01,455.19\n1995-01-01,465.25\n1995-02-01,481.92\n1995-03-01,493.15\n1995-04-01,507.91\n1995-05-01,523.81\n1995-06-01,539.35\n1995-07-01,557.37\n1995-08-01,559.11\n" \
|
106
|
+
"1995-09-01,578.77\n1995-10-01,582.92\n1995-11-01,595.53\n1995-12-01,614.57\n1996-01-01,614.42\n1996-02-01,649.54\n1996-03-01,647.07\n1996-04-01,647.17\n1996-05-01,661.23\n1996-06-01,668.5\n1996-07-01,644.07\n" \
|
107
|
+
"1996-08-01,662.68\n1996-09-01,674.88\n1996-10-01,701.46\n1996-11-01,735.67\n1996-12-01,743.25\n1997-01-01,766.22\n1997-02-01,798.39\n1997-03-01,792.16\n1997-04-01,763.93\n1997-05-01,833.09\n1997-06-01,876.29\n" \
|
108
|
+
"1997-07-01,925.29\n1997-08-01,927.24\n1997-09-01,937.02\n1997-10-01,951.16\n1997-11-01,938.92\n1997-12-01,962.37\n1998-01-01,963.36\n1998-02-01,1023.74\n1998-03-01,1076.83\n1998-04-01,1112.2\n1998-05-01,1108.42\n" \
|
109
|
+
"1998-06-01,1108.39\n1998-07-01,1156.58\n1998-08-01,1074.62\n1998-09-01,1020.64\n1998-10-01,1032.47\n1998-11-01,1144.43\n1998-12-01,1190.05\n1999-01-01,1248.77\n1999-02-01,1246.58\n1999-03-01,1281.66\n1999-04-01,1334.76\n" \
|
110
|
+
"1999-05-01,1332.07\n1999-06-01,1322.55\n1999-07-01,1380.99\n1999-08-01,1327.49\n1999-09-01,1318.17\n1999-10-01,1300.01\n1999-11-01,1391\n1999-12-01,1428.68\n2000-01-01,1425.59\n2000-02-01,1388.87\n2000-03-01,1442.21\n" \
|
111
|
+
"2000-04-01,1461.36\n2000-05-01,1418.48\n2000-06-01,1461.96\n2000-07-01,1473\n2000-08-01,1485.46\n2000-09-01,1468.05\n2000-10-01,1390.14\n2000-11-01,1378.04\n2000-12-01,1330.93\n2001-01-01,1335.63\n2001-02-01,1305.75\n" \
|
112
|
+
"2001-03-01,1185.85\n2001-04-01,1189.84\n2001-05-01,1270.37\n2001-06-01,1238.71\n2001-07-01,1204.45\n2001-08-01,1178.5\n2001-09-01,1044.64\n2001-10-01,1076.59\n2001-11-01,1129.68\n2001-12-01,1144.93\n2002-01-01,1140.21\n" \
|
113
|
+
"2002-02-01,1100.67\n2002-03-01,1153.79\n2002-04-01,1111.93\n2002-05-01,1079.25\n2002-06-01,1014.02\n2002-07-01,903.59\n2002-08-01,912.55\n2002-09-01,867.81\n2002-10-01,854.63\n2002-11-01,909.93\n2002-12-01,899.18\n" \
|
114
|
+
"2003-01-01,895.84\n2003-02-01,837.03\n2003-03-01,846.63\n2003-04-01,890.03\n2003-05-01,935.96\n2003-06-01,988\n2003-07-01,992.54\n2003-08-01,989.53\n2003-09-01,1019.44\n2003-10-01,1038.73\n2003-11-01,1049.9\n" \
|
115
|
+
"2003-12-01,1080.64\n2004-01-01,1132.52\n2004-02-01,1143.36\n2004-03-01,1123.98\n2004-04-01,1133.36\n2004-05-01,1102.78\n2004-06-01,1132.76\n2004-07-01,1105.85\n2004-08-01,1088.94\n2004-09-01,1117.66\n2004-10-01,1117.21\n" \
|
116
|
+
"2004-11-01,1168.94\n2004-12-01,1199.21\n2005-01-01,1181.41\n2005-02-01,1199.63\n2005-03-01,1194.9\n2005-04-01,1164.43\n2005-05-01,1178.28\n2005-06-01,1202.25\n2005-07-01,1222.24\n2005-08-01,1224.27\n2005-09-01,1225.92\n" \
|
117
|
+
"2005-10-01,1191.96\n2005-11-01,1237.37\n2005-12-01,1262.07\n2006-01-01,1278.73\n2006-02-01,1276.65\n2006-03-01,1293.74\n2006-04-01,1302.17\n2006-05-01,1290.01\n2006-06-01,1253.17\n2006-07-01,1260.24\n2006-08-01,1287.15\n" \
|
118
|
+
"2006-09-01,1317.74\n2006-10-01,1363.38\n2006-11-01,1388.64\n2006-12-01,1416.42\n2007-01-01,1424.16\n2007-02-01,1444.8\n2007-03-01,1406.95\n2007-04-01,1463.64\n2007-05-01,1511.14\n2007-06-01,1514.19\n2007-07-01,1520.71\n" \
|
119
|
+
"2007-08-01,1454.62\n2007-09-01,1497.12\n2007-10-01,1539.66\n2007-11-01,1463.39\n2007-12-01,1479.22\n2008-01-01,1378.76\n2008-02-01,1354.87\n2008-03-01,1316.94\n2008-04-01,1370.47\n2008-05-01,1403.22\n2008-06-01,1341.25\n" \
|
120
|
+
"2008-07-01,1257.33\n2008-08-01,1281.47\n2008-09-01,1216.95\n2008-10-01,968.8\n2008-11-01,883.04\n2008-12-01,877.56\n2009-01-01,865.58\n2009-02-01,805.23\n2009-03-01,757.13\n2009-04-01,848.15\n2009-05-01,902.41\n" \
|
121
|
+
"2009-06-01,926.12\n2009-07-01,935.82\n2009-08-01,1009.73\n2009-09-01,1044.55\n2009-10-01,1067.66\n2009-11-01,1088.07\n2009-12-01,1110.38\n2010-01-01,1123.58\n2010-02-01,1089.16\n2010-03-01,1152.05\n2010-04-01,1197.32\n" \
|
122
|
+
"2010-05-01,1125.06\n2010-06-01,1083.36\n2010-07-01,1079.8\n2010-08-01,1087.28\n2010-09-01,1122.08\n2010-10-01,1171.58\n2010-11-01,1198.89\n2010-12-01,1241.53\n2011-01-01,1282.62\n2011-02-01,1321.12\n2011-03-01,1304.49\n" \
|
123
|
+
"2011-04-01,1331.51\n2011-05-01,1338.31\n2011-06-01,1287.29\n2011-07-01,1325.19\n2011-08-01,1185.31\n2011-09-01,1173.88\n2011-10-01,1207.22\n2011-11-01,1226.42\n2011-12-01,1243.32\n2012-01-01,1300.58\n2012-02-01,1352.49\n" \
|
124
|
+
"2012-03-01,1389.24\n2012-04-01,1386.43\n2012-05-01,1341.27\n2012-06-01,1323.48\n2012-07-01,1359.78\n2012-08-01,1403.45\n2012-09-01,1443.42\n2012-10-01,1437.82\n2012-11-01,1394.51\n2012-12-01,1422.29\n2013-01-01,1480.4\n" \
|
125
|
+
"2013-02-01,1512.31\n2013-03-01,1550.83\n2013-04-01,1570.7\n2013-05-01,1639.84\n2013-06-01,1618.77\n2013-07-01,1668.68\n2013-08-01,1670.09\n2013-09-01,1687.17\n2013-10-01,1720.03\n2013-11-01,1783.54\n2013-12-01,1807.78\n" \
|
126
|
+
"2014-01-01,1822.36\n2014-02-01,1817.04\n2014-03-01,1863.52\n2014-04-01,1864.26\n2014-05-01,1889.77\n2014-06-01,1947.09\n2014-07-01,1973.1\n2014-08-01,1961.53\n2014-09-01,1993.23\n2014-10-01,1937.27\n2014-11-01,2044.57\n" \
|
127
|
+
"2014-12-01,2054.27\n2015-01-01,2028.18\n2015-02-01,2082.2\n2015-03-01,2079.99\n2015-04-01,2094.86\n2015-05-01,2111.94\n2015-06-01,2099.29\n2015-07-01,2094.14\n2015-08-01,2039.87\n2015-09-01,1945.41\n2015-10-01,2071.18\n" \
|
128
|
+
"2015-11-01,2080.62\n2015-12-01,2054.08\n2016-01-01,1918.6\n2016-02-01,1903.03\n2016-03-01,2021.95\n2016-04-01,2075.54\n2016-05-01,2065.55\n2016-06-01,2083.89\n2016-07-01,2148.9\n2016-08-01,2177.48\n2016-09-01,2157.69\n" \
|
129
|
+
"2016-10-01,2143.02\n2016-11-01,2164.99\n2016-12-01,2246.63\n2017-01-01,2275.12\n2017-02-01,2329.91\n2017-03-01,2345.96\n2017-04-01,2359.31\n2017-05-01,2395.35\n2017-06-01,2433.99\n2017-07-01,2454.1\n2017-08-01,2456.22\n" \
|
130
|
+
"2017-09-01,2492.84\n2017-10-01,2557\n2017-11-01,2593.61\n2017-12-01,2664.34\n2018-01-01,2789.8\n2018-02-01,2705.16\n2018-03-01,2702.77\n2018-04-01,2653.63\n2018-05-01,2701.49\n2018-06-01,2754.35\n2018-07-01,2793.64\n" \
|
131
|
+
"2018-08-01,2857.82\n2018-09-01,2901.5\n2018-10-01,2785.46\n2018-11-01,2723.23\n2018-12-01,2567.31\n2019-01-01,2607.39\n2019-02-01,2754.86\n2019-03-01,2803.98\n2019-04-01,2903.8\n2019-05-01,2854.71\n2019-06-01,2890.17\n" \
|
132
|
+
"2019-07-01,2996.11\n2019-08-01,2897.5\n2019-09-01,2982.16\n2019-10-01,2977.68\n2019-11-01,3104.9\n2019-12-01,3176.75\n2020-01-01,3278.2\n2020-02-01,3277.31\n2020-03-01,2652.39\n2020-04-01,2761.98\n2020-05-01,2919.62\n" \
|
133
|
+
"2020-06-01,3104.66\n2020-07-01,3207.62\n2020-08-01,3391.71\n2020-09-01,3365.52\n2020-10-01,3418.7\n2020-11-01,3548.99\n2020-12-01,3695.31\n2021-01-01,3793.75\n2021-02-01,3883.43\n2021-03-01,3910.51\n2021-04-01,4141.18\n" \
|
134
|
+
"2021-05-01,4167.85\n2021-06-01,4238.49\n2021-07-01,4363.71\n2021-08-01,4454.21\n2021-09-01,4445.54\n2021-10-01,4460.71\n2021-11-01,4667.39\n2021-12-01,4674.77\n2022-01-01,4573.82\n2022-02-01,4435.98\n2022-03-01,4391.27\n" \
|
135
|
+
"2022-04-01,4391.3\n2022-05-01,4040.36\n2022-06-01,3898.95\n2022-07-01,3911.73\n2022-08-01,4158.56\n2022-09-01,3850.52\n2022-10-01,3726.05\n2022-11-01,3917.49\n2022-12-01,3912.38\n2023-01-01,3960.66\n2023-02-01,4079.68\n" \
|
136
|
+
"2023-03-01,3968.56\n2023-04-01,4121.47\n2023-05-01,4146.17\n2023-06-01,4345.37\n2023-07-01,4508.08\n2023-08-01,4457.36\n2023-09-01,4409.1\n2023-10-01,4269.4\n2023-11-01,4460.06\n2023-12-01,4685.05\n2024-01-01,4815.61\n" \
|
137
|
+
"2024-02-01,5011.96\n2024-03-01,5170.57\n2024-04-01,5112.49\n2024-05-01,5235.23"
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
data/lib/fred_as_dataframe.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fred_as_dataframe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill McKinnon
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- bin/setup
|
56
56
|
- fred_as_dataframe.gemspec
|
57
57
|
- lib/fred_as_dataframe.rb
|
58
|
+
- lib/fred_as_dataframe/client.rb
|
58
59
|
- lib/fred_as_dataframe/version.rb
|
59
60
|
homepage: https://github.com/bmck/fred_as_dataframe
|
60
61
|
licenses:
|