bea_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/.gitignore +1 -0
- data/README.md +16 -4
- data/lib/bea_as_dataframe/gdp_per_county_sector.rb +1 -1
- data/lib/bea_as_dataframe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4a005d7ae864db7279444f577a122255e18f3e89d0e03945f6fce3ca400cf27
|
4
|
+
data.tar.gz: f88f259564413f96d65be17dc291703e9ff6d9d40af7fe4665d3914f420379a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d620829ff1af9b326aa834b3501d39d61d9e5e3db510e0e0894c44a2261621faf082e6c659e3bc98cd50ccc5fc27a148521e71c3779d1122c55d7bba8eb4ff44
|
7
|
+
data.tar.gz: 190b9ad9c2bbf40bc52d9f9403895fa444cc7b863871d2ee780093e1f758a54318282dbcfdf94fe103fa3748fd18042d54e0fd7b0118d24eef679267280b4e3c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# BeaAsDataframe
|
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 Bureau of Economic Analysis, and return the results as a Polars Dataframe. For some operations, you may need an API key that can be fetched from the BEA website at https://apps.bea.gov/API/signup/ .
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -20,9 +20,21 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install bea_as_dataframe
|
22
22
|
|
23
|
-
##
|
23
|
+
## Configuration
|
24
24
|
|
25
|
-
|
25
|
+
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/bea_as_dataframe.rb
|
26
|
+
|
27
|
+
Other operations (those in BeaAsDataframe::GdpPerCountySector) will require the specification of a directory for temporarily storing datafiles. See the following initialization snippet to providing that customization.
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
BeaAsDataframe::Client.configure do |config|
|
31
|
+
config.api_key = '1234567890ABCDEF'
|
32
|
+
# OR
|
33
|
+
config.api_key = File.read(File.join('','home', 'user', '.bea_api_key.txt'))
|
34
|
+
|
35
|
+
config.tmp_dir = File.join('', 'tmp')
|
36
|
+
end
|
37
|
+
```
|
26
38
|
|
27
39
|
## Development
|
28
40
|
|
@@ -29,7 +29,7 @@ class BeaAsDataframe
|
|
29
29
|
next if (f.name =~ /ALL_AREAS/).nil?
|
30
30
|
content = f.get_input_stream.read.gsub(/^\s*/,'')
|
31
31
|
|
32
|
-
Tempfile.create(['gdp_per_cnty_sector', '.csv'], @tmp_dir, mode: File::RDWR) do |fn|
|
32
|
+
Tempfile.create(['gdp_per_cnty_sector', '.csv'], @tmp_dir, mode: File::RDWR, binmode: true) do |fn|
|
33
33
|
fnp = fn.path
|
34
34
|
fn.write content
|
35
35
|
fn.rewind
|