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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24b09031564ef29791f0bbd24f900447e00f836123c58499e4cd8aebab02fab9
4
- data.tar.gz: 546d7c3141ffb6b2be5efd78a6764df610c71ac1a3ccbe16649877ef1e985d08
3
+ metadata.gz: b4a005d7ae864db7279444f577a122255e18f3e89d0e03945f6fce3ca400cf27
4
+ data.tar.gz: f88f259564413f96d65be17dc291703e9ff6d9d40af7fe4665d3914f420379a3
5
5
  SHA512:
6
- metadata.gz: 4560c290948d1fdab0cf0399ce0282d9454237ff33d8c5e818bf5aeee5833818c2a5f80243528242c6b89d0f6aafec02cd6047d6ee63fdbafbeac4f3f28b6d33
7
- data.tar.gz: 47b7ed9162e2245c6b1f22180c70b87fa52105f78b2283aa2ba8f34a14f392df0e60074b272e1f851f66f545ee5021ec015cc2b965df5acb8a1e53dd09e4cc01
6
+ metadata.gz: d620829ff1af9b326aa834b3501d39d61d9e5e3db510e0e0894c44a2261621faf082e6c659e3bc98cd50ccc5fc27a148521e71c3779d1122c55d7bba8eb4ff44
7
+ data.tar.gz: 190b9ad9c2bbf40bc52d9f9403895fa444cc7b863871d2ee780093e1f758a54318282dbcfdf94fe103fa3748fd18042d54e0fd7b0118d24eef679267280b4e3c
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  Gemfile.lock
10
+ *.gem
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # BeaAsDataframe
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bea_as_dataframe`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Up to date remote economic data access for ruby, using Polars dataframes.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
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
- ## Usage
23
+ ## Configuration
24
24
 
25
- TODO: Write usage instructions here
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class BeaAsDataframe
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bea_as_dataframe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bill McKinnon