ny_frb_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: 037b31b64679ee33a6a8632a80e5a9fcc9d09939b9e45c8499a561c624f98816
4
- data.tar.gz: 96a90d12efa519f0633a2162cf2f263769395cfcd2b992af3dbb235e37a0577c
3
+ metadata.gz: 90ab84e7883a2a7fd86e6349c210e7934b427ffaab4c31e4113eb0977ea0b2f5
4
+ data.tar.gz: dad8b0082e9e7b9c5bc67e0c29862f100d8824031ec2ed4029f1a1d9f4001f28
5
5
  SHA512:
6
- metadata.gz: 30eea77268f8ebab0ca02efbcfb1f5531046123738b1bb57796663cc9677ada2fbcdf61d688ce27a92352bb9c3bc6526b8ec37b82900d838575a60965466a803
7
- data.tar.gz: d34d36721197a590d1e16c4fec87657e68c5723047a4c674ded9d6233cf4280f61929420d253ef7df9bb7a5afd1b5479f3b4df6ba95123e602d2b9faa8cdaab2
6
+ metadata.gz: 2e244d59b1beab7ff6342528e3604a216b313d58c9f5835febf17268e6301c064f342480c7f16d958eb08b645217d9ecc3ad8b8bbbd1661a76d6cc0788eef284
7
+ data.tar.gz: ba9513f960bd4fd72e58e9ccc8e1b40eafcb1b0d20c11f003bf669f20efd89564259ec0d1a2715b799a127919b6beb5524d56175c18982c8bee8f2b3ad3170cf
data/.DS_Store ADDED
Binary file
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  Gemfile.lock
10
+ *.gem
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Up to date remote economic data access for ruby, using Polars dataframes.
4
4
 
5
- This package will fetch economic and financial information from the Federal Reserve Bank of Philadelphia, and return the results as a Polars dataframe.
5
+ This package will fetch economic and financial information from the Federal Reserve Bank of NY (specifically several time series from the FRB NY's Household Credit and Debt report), and return the results as a Polars dataframe.
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,13 +22,338 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```{ruby}
26
+ 3.1.2 :001 > NyFrbAsDataframe::Hhdc.new.fetch # Fetches all data
27
+ =>
28
+ shape: (102, 103)
29
+ ┌────────────┬───────────────────┬────────────────────┬────────────────────────┬───┬────────────────────────┬────────────────────────┬────────────────────────┬───────────────────────┐
30
+ │ Timestamps ┆ Mort Debt Balance ┆ HELOC Debt Balance ┆ Car Loan Debt Balance ┆ … ┆ New Bankruptcies for ┆ New Bankruptcies for ┆ New Bankruptcies for ┆ New Bankruptcies for │
31
+ │ --- ┆ ($T) ┆ ($T) ┆ ($T) ┆ ┆ 40-49 yo … ┆ 50-59 yo … ┆ 60-69 yo … ┆ 70+ yo (0… │
32
+ │ str ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │
33
+ │ ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
34
+ ╞════════════╪═══════════════════╪════════════════════╪════════════════════════╪═══╪════════════════════════╪════════════════════════╪════════════════════════╪═══════════════════════╡
35
+ │ 1999-01-01 ┆ null ┆ null ┆ null ┆ … ┆ null ┆ null ┆ null ┆ null │
36
+ │ 1999-04-01 ┆ null ┆ null ┆ null ┆ … ┆ null ┆ null ┆ null ┆ null │
37
+ │ 1999-07-01 ┆ null ┆ null ┆ null ┆ … ┆ null ┆ null ┆ null ┆ null │
38
+ │ 1999-10-01 ┆ null ┆ null ┆ null ┆ … ┆ null ┆ null ┆ null ┆ null │
39
+ │ 2000-01-01 ┆ null ┆ null ┆ null ┆ … ┆ 108.38 ┆ 63.04 ┆ 25.2 ┆ 17.84 │
40
+ │ 2000-04-01 ┆ null ┆ null ┆ null ┆ … ┆ 135.18 ┆ 79.94 ┆ 30.04 ┆ 19.56 │
41
+ │ 2000-07-01 ┆ null ┆ null ┆ null ┆ … ┆ 111.94 ┆ 66.2 ┆ 25.42 ┆ 16.16 │
42
+ │ 2000-10-01 ┆ null ┆ null ┆ null ┆ … ┆ 115.6 ┆ 66.34 ┆ 24.94 ┆ 15.56 │
43
+ │ 2001-01-01 ┆ null ┆ null ┆ null ┆ … ┆ 118.3 ┆ 70.46 ┆ 27.44 ┆ 18.04 │
44
+ │ 2001-04-01 ┆ null ┆ null ┆ null ┆ … ┆ 168.38 ┆ 104.18 ┆ 40.98 ┆ 25.0 │
45
+ │ 2001-07-01 ┆ null ┆ null ┆ null ┆ … ┆ 129.8 ┆ 77.82 ┆ 31.56 ┆ 20.02 │
46
+ │ 2001-10-01 ┆ null ┆ null ┆ null ┆ … ┆ 139.88 ┆ 82.96 ┆ 31.68 ┆ 21.02 │
47
+ │ 2002-01-01 ┆ null ┆ null ┆ null ┆ … ┆ 187.78 ┆ 123.64 ┆ 50.78 ┆ 29.8 │
48
+ │ 2002-04-01 ┆ null ┆ null ┆ null ┆ … ┆ 141.18 ┆ 89.02 ┆ 33.86 ┆ 18.96 │
49
+ │ 2002-07-01 ┆ null ┆ null ┆ null ┆ … ┆ 140.06 ┆ 88.94 ┆ 34.24 ┆ 18.08 │
50
+ │ 2002-10-01 ┆ null ┆ null ┆ null ┆ … ┆ 143.2 ┆ 88.26 ┆ 36.88 ┆ 18.76 │
51
+ │ 2003-01-01 ┆ 4.942 ┆ 0.242 ┆ 0.641 ┆ … ┆ 165.44 ┆ 108.78 ┆ 47.3 ┆ 28.52 │
52
+ │ 2003-04-01 ┆ 5.08 ┆ 0.26 ┆ 0.622 ┆ … ┆ 166.3 ┆ 106.36 ┆ 43.32 ┆ 24.1 │
53
+ │ 2003-07-01 ┆ 5.183 ┆ 0.269 ┆ 0.684 ┆ … ┆ 144.2 ┆ 90.44 ┆ 38.48 ┆ 22.24 │
54
+ │ 2003-10-01 ┆ 5.66 ┆ 0.302 ┆ 0.704 ┆ … ┆ 135.0 ┆ 89.42 ┆ 37.56 ┆ 20.26 │
55
+ │ 2004-01-01 ┆ 5.84 ┆ 0.328 ┆ 0.72 ┆ … ┆ 143.6 ┆ 93.12 ┆ 40.68 ┆ 22.66 │
56
+ │ 2004-04-01 ┆ 5.967 ┆ 0.367 ┆ 0.743 ┆ … ┆ 153.58 ┆ 99.18 ┆ 44.3 ┆ 22.1 │
57
+ │ 2004-07-01 ┆ 6.21 ┆ 0.426 ┆ 0.751 ┆ … ┆ 135.56 ┆ 92.74 ┆ 37.88 ┆ 21.58 │
58
+ │ 2004-10-01 ┆ 6.36 ┆ 0.468 ┆ 0.728 ┆ … ┆ 153.16 ┆ 102.98 ┆ 41.78 ┆ 22.5 │
59
+ │ 2005-01-01 ┆ 6.512 ┆ 0.502 ┆ 0.725 ┆ … ┆ 125.52 ┆ 87.14 ┆ 36.92 ┆ 21.4 │
60
+ │ 2005-04-01 ┆ 6.696 ┆ 0.528 ┆ 0.774 ┆ … ┆ 178.98 ┆ 127.16 ┆ 55.3 ┆ 29.22 │
61
+ │ 2005-07-01 ┆ 6.906 ┆ 0.541 ┆ 0.83 ┆ … ┆ 176.7 ┆ 126.84 ┆ 54.7 ┆ 30.64 │
62
+ │ 2005-10-01 ┆ 7.102 ┆ 0.565 ┆ 0.792 ┆ … ┆ 257.14 ┆ 173.72 ┆ 68.4 ┆ 33.26 │
63
+ │ 2006-01-01 ┆ 7.436 ┆ 0.582 ┆ 0.788 ┆ … ┆ 52.76 ┆ 37.24 ┆ 16.42 ┆ 10.14 │
64
+ │ 2006-04-01 ┆ 7.76 ┆ 0.59 ┆ 0.796 ┆ … ┆ 69.0 ┆ 49.48 ┆ 23.22 ┆ 13.54 │
65
+ │ 2006-07-01 ┆ 8.045 ┆ 0.603 ┆ 0.821 ┆ … ┆ 75.58 ┆ 56.16 ┆ 24.48 ┆ 13.28 │
66
+ │ 2006-10-01 ┆ 8.234 ┆ 0.604 ┆ 0.821 ┆ … ┆ 75.96 ┆ 53.72 ┆ 25.04 ┆ 14.46 │
67
+ │ 2007-01-01 ┆ 8.422 ┆ 0.605 ┆ 0.794 ┆ … ┆ 73.02 ┆ 51.82 ┆ 24.66 ┆ 12.14 │
68
+ │ 2007-04-01 ┆ 8.706 ┆ 0.619 ┆ 0.807 ┆ … ┆ 78.72 ┆ 60.14 ┆ 25.86 ┆ 13.74 │
69
+ │ 2007-07-01 ┆ 8.925 ┆ 0.631 ┆ 0.818 ┆ … ┆ 90.12 ┆ 64.7 ┆ 29.2 ┆ 14.26 │
70
+ │ 2007-10-01 ┆ 9.101 ┆ 0.647 ┆ 0.815 ┆ … ┆ 99.94 ┆ 72.18 ┆ 31.98 ┆ 15.38 │
71
+ │ 2008-01-01 ┆ 9.234 ┆ 0.663 ┆ 0.808 ┆ … ┆ 92.32 ┆ 66.94 ┆ 31.4 ┆ 15.2 │
72
+ │ 2008-04-01 ┆ 9.273 ┆ 0.679 ┆ 0.81 ┆ … ┆ 109.68 ┆ 79.1 ┆ 37.22 ┆ 16.8 │
73
+ │ 2008-07-01 ┆ 9.294 ┆ 0.692 ┆ 0.809 ┆ … ┆ 115.04 ┆ 83.9 ┆ 38.44 ┆ 16.36 │
74
+ │ 2008-10-01 ┆ 9.257 ┆ 0.705 ┆ 0.791 ┆ … ┆ 121.56 ┆ 91.02 ┆ 43.52 ┆ 19.3 │
75
+ │ 2009-01-01 ┆ 9.135 ┆ 0.714 ┆ 0.766 ┆ … ┆ 115.06 ┆ 89.94 ┆ 46.76 ┆ 19.96 │
76
+ │ 2009-04-01 ┆ 9.063 ┆ 0.713 ┆ 0.743 ┆ … ┆ 151.9 ┆ 113.08 ┆ 53.72 ┆ 22.94 │
77
+ │ 2009-07-01 ┆ 8.944 ┆ 0.708 ┆ 0.739 ┆ … ┆ 150.84 ┆ 115.84 ┆ 56.44 ┆ 22.8 │
78
+ │ 2009-10-01 ┆ 8.843 ┆ 0.7064 ┆ 0.7219 ┆ … ┆ 141.88 ┆ 110.3 ┆ 52.66 ┆ 20.72 │
79
+ │ 2010-01-01 ┆ 8.834 ┆ 0.6951 ┆ 0.7047 ┆ … ┆ 134.62 ┆ 107.18 ┆ 54.62 ┆ 22.56 │
80
+ │ 2010-04-01 ┆ 8.703 ┆ 0.6826 ┆ 0.7022 ┆ … ┆ 181.98 ┆ 144.74 ┆ 71.06 ┆ 29.56 │
81
+ │ 2010-07-01 ┆ 8.609 ┆ 0.6734 ┆ 0.71 ┆ … ┆ 153.62 ┆ 123.42 ┆ 62.66 ┆ 24.62 │
82
+ │ 2010-10-01 ┆ 8.452 ┆ 0.6678 ┆ 0.711 ┆ … ┆ 149.36 ┆ 116.0 ┆ 57.48 ┆ 23.6 │
83
+ │ 2011-01-01 ┆ 8.544 ┆ 0.6405 ┆ 0.7056 ┆ … ┆ 126.34 ┆ 101.66 ┆ 56.36 ┆ 23.16 │
84
+ │ 2011-04-01 ┆ 8.516 ┆ 0.6245 ┆ 0.713 ┆ … ┆ 142.22 ┆ 110.26 ┆ 56.06 ┆ 22.96 │
85
+ │ 2011-07-01 ┆ 8.402 ┆ 0.6387 ┆ 0.7304 ┆ … ┆ 124.38 ┆ 101.38 ┆ 50.7 ┆ 20.74 │
86
+ │ 2011-10-01 ┆ 8.268 ┆ 0.6271 ┆ 0.7341 ┆ … ┆ 129.6 ┆ 100.98 ┆ 50.18 ┆ 21.32 │
87
+ │ 2012-01-01 ┆ 8.187 ┆ 0.6118 ┆ 0.7365 ┆ … ┆ 109.8 ┆ 89.98 ┆ 46.86 ┆ 20.46 │
88
+ │ 2012-04-01 ┆ 8.147 ┆ 0.589 ┆ 0.75 ┆ … ┆ 115.9 ┆ 97.26 ┆ 47.18 ┆ 20.76 │
89
+ │ 2012-07-01 ┆ 8.028 ┆ 0.573 ┆ 0.768 ┆ … ┆ 101.54 ┆ 84.32 ┆ 43.78 ┆ 18.42 │
90
+ │ 2012-10-01 ┆ 8.033 ┆ 0.563 ┆ 0.783 ┆ … ┆ 98.58 ┆ 81.44 ┆ 41.32 ┆ 16.3 │
91
+ │ 2013-01-01 ┆ 7.932 ┆ 0.552 ┆ 0.794 ┆ … ┆ 88.8 ┆ 75.06 ┆ 40.26 ┆ 17.58 │
92
+ │ 2013-04-01 ┆ 7.841 ┆ 0.54 ┆ 0.814 ┆ … ┆ 108.58 ┆ 94.28 ┆ 48.34 ┆ 21.4 │
93
+ │ 2013-07-01 ┆ 7.897 ┆ 0.535 ┆ 0.845 ┆ … ┆ 102.08 ┆ 87.72 ┆ 46.56 ┆ 20.52 │
94
+ │ 2013-10-01 ┆ 8.049 ┆ 0.529 ┆ 0.863 ┆ … ┆ 95.44 ┆ 82.88 ┆ 41.68 ┆ 19.32 │
95
+ │ 2014-01-01 ┆ 8.165 ┆ 0.526 ┆ 0.875 ┆ … ┆ 74.66 ┆ 67.54 ┆ 37.04 ┆ 16.32 │
96
+ │ 2014-04-01 ┆ 8.096 ┆ 0.521 ┆ 0.905 ┆ … ┆ 88.74 ┆ 76.62 ┆ 39.94 ┆ 17.54 │
97
+ │ 2014-07-01 ┆ 8.131 ┆ 0.512 ┆ 0.934 ┆ … ┆ 74.48 ┆ 63.14 ┆ 34.98 ┆ 15.54 │
98
+ │ 2014-10-01 ┆ 8.17 ┆ 0.51 ┆ 0.955 ┆ … ┆ 76.98 ┆ 64.14 ┆ 35.84 ┆ 15.3 │
99
+ │ 2015-01-01 ┆ 8.171 ┆ 0.51 ┆ 0.968 ┆ … ┆ 70.1 ┆ 63.48 ┆ 35.98 ┆ 16.7 │
100
+ │ 2015-04-01 ┆ 8.116 ┆ 0.499 ┆ 1.006 ┆ … ┆ 72.94 ┆ 62.82 ┆ 35.04 ┆ 16.12 │
101
+ │ 2015-07-01 ┆ 8.26 ┆ 0.492 ┆ 1.045 ┆ … ┆ 60.52 ┆ 53.82 ┆ 30.06 ┆ 13.68 │
102
+ │ 2015-10-01 ┆ 8.249 ┆ 0.487 ┆ 1.064 ┆ … ┆ 56.66 ┆ 51.82 ┆ 28.06 ┆ 13.7 │
103
+ │ 2016-01-01 ┆ 8.369 ┆ 0.485 ┆ 1.071 ┆ … ┆ 54.02 ┆ 50.38 ┆ 28.08 ┆ 13.4 │
104
+ │ 2016-04-01 ┆ 8.362 ┆ 0.478 ┆ 1.103 ┆ … ┆ 58.4 ┆ 51.5 ┆ 30.74 ┆ 15.32 │
105
+ │ 2016-07-01 ┆ 8.35 ┆ 0.472 ┆ 1.135 ┆ … ┆ 56.24 ┆ 48.74 ┆ 28.8 ┆ 13.98 │
106
+ │ 2016-10-01 ┆ 8.48 ┆ 0.473 ┆ 1.157 ┆ … ┆ 53.78 ┆ 48.26 ┆ 27.24 ┆ 13.46 │
107
+ │ 2017-01-01 ┆ 8.627 ┆ 0.456 ┆ 1.167 ┆ … ┆ 53.64 ┆ 48.88 ┆ 29.96 ┆ 14.92 │
108
+ │ 2017-04-01 ┆ 8.691 ┆ 0.452 ┆ 1.19 ┆ … ┆ 59.96 ┆ 50.06 ┆ 30.78 ┆ 15.8 │
109
+ │ 2017-07-01 ┆ 8.743 ┆ 0.448 ┆ 1.213 ┆ … ┆ 54.44 ┆ 49.12 ┆ 28.04 ┆ 15.96 │
110
+ │ 2017-10-01 ┆ 8.882 ┆ 0.444 ┆ 1.221 ┆ … ┆ 51.74 ┆ 44.52 ┆ 29.44 ┆ 15.36 │
111
+ │ 2018-01-01 ┆ 8.939 ┆ 0.436 ┆ 1.229 ┆ … ┆ 50.26 ┆ 45.08 ┆ 27.0 ┆ 15.3 │
112
+ │ 2018-04-01 ┆ 8.999 ┆ 0.432 ┆ 1.238 ┆ … ┆ 58.82 ┆ 51.58 ┆ 32.12 ┆ 17.66 │
113
+ │ 2018-07-01 ┆ 9.14 ┆ 0.422 ┆ 1.265 ┆ … ┆ 54.26 ┆ 49.26 ┆ 31.66 ┆ 17.36 │
114
+ │ 2018-10-01 ┆ 9.124 ┆ 0.412 ┆ 1.274 ┆ … ┆ 51.24 ┆ 45.78 ┆ 26.62 ┆ 14.78 │
115
+ │ 2019-01-01 ┆ 9.244 ┆ 0.406 ┆ 1.28 ┆ … ┆ 48.74 ┆ 45.7 ┆ 28.46 ┆ 16.68 │
116
+ │ 2019-04-01 ┆ 9.406 ┆ 0.399 ┆ 1.297 ┆ … ┆ 59.26 ┆ 55.22 ┆ 31.54 ┆ 19.04 │
117
+ │ 2019-07-01 ┆ 9.437 ┆ 0.396 ┆ 1.315 ┆ … ┆ 47.52 ┆ 42.24 ┆ 25.66 ┆ 14.78 │
118
+ │ 2019-10-01 ┆ 9.557 ┆ 0.39 ┆ 1.331 ┆ … ┆ 52.28 ┆ 46.26 ┆ 28.26 ┆ 16.02 │
119
+ │ 2020-01-01 ┆ 9.713 ┆ 0.386 ┆ 1.346 ┆ … ┆ 48.28 ┆ 43.42 ┆ 27.82 ┆ 16.42 │
120
+ │ 2020-04-01 ┆ 9.776 ┆ 0.375 ┆ 1.343 ┆ … ┆ 33.38 ┆ 30.42 ┆ 19.54 ┆ 12.42 │
121
+ │ 2020-07-01 ┆ 9.861 ┆ 0.362 ┆ 1.36 ┆ … ┆ 33.1 ┆ 29.62 ┆ 19.02 ┆ 11.58 │
122
+ │ 2020-10-01 ┆ 10.043 ┆ 0.349 ┆ 1.374 ┆ … ┆ 29.8 ┆ 28.1 ┆ 17.38 ┆ 9.52 │
123
+ │ 2021-01-01 ┆ 10.16 ┆ 0.335 ┆ 1.382 ┆ … ┆ 27.64 ┆ 26.86 ┆ 16.94 ┆ 9.58 │
124
+ │ 2021-04-01 ┆ 10.442 ┆ 0.322 ┆ 1.415 ┆ … ┆ 29.26 ┆ 27.84 ┆ 17.52 ┆ 9.72 │
125
+ │ 2021-07-01 ┆ 10.672 ┆ 0.317 ┆ 1.443 ┆ … ┆ 24.68 ┆ 22.56 ┆ 14.94 ┆ 8.72 │
126
+ │ 2021-10-01 ┆ 10.93 ┆ 0.318 ┆ 1.458 ┆ … ┆ 22.28 ┆ 21.26 ┆ 15.72 ┆ 7.96 │
127
+ │ 2022-01-01 ┆ 11.18 ┆ 0.317 ┆ 1.469 ┆ … ┆ 21.98 ┆ 21.7 ┆ 14.5 ┆ 8.3 │
128
+ │ 2022-04-01 ┆ 11.387 ┆ 0.319 ┆ 1.502 ┆ … ┆ 22.02 ┆ 21.96 ┆ 14.62 ┆ 8.46 │
129
+ │ 2022-07-01 ┆ 11.669 ┆ 0.322 ┆ 1.524 ┆ … ┆ 24.62 ┆ 22.38 ┆ 16.18 ┆ 8.18 │
130
+ │ 2022-10-01 ┆ 11.923 ┆ 0.336 ┆ 1.552 ┆ … ┆ 24.58 ┆ 22.52 ┆ 14.6 ┆ 8.08 │
131
+ │ 2023-01-01 ┆ 12.044 ┆ 0.339 ┆ 1.562 ┆ … ┆ 24.06 ┆ 24.92 ┆ 15.44 ┆ 9.4 │
132
+ │ 2023-04-01 ┆ 12.014 ┆ 0.34 ┆ 1.582 ┆ … ┆ 28.5 ┆ 26.1 ┆ 15.74 ┆ 9.98 │
133
+ │ 2023-07-01 ┆ 12.14 ┆ 0.349 ┆ 1.595 ┆ … ┆ 28.54 ┆ 26.86 ┆ 16.34 ┆ 9.5 │
134
+ │ 2023-10-01 ┆ 12.252 ┆ 0.36 ┆ 1.607 ┆ … ┆ 28.44 ┆ 25.62 ┆ 16.68 ┆ 9.26 │
135
+ │ 2024-01-01 ┆ 12.442 ┆ 0.376 ┆ 1.616 ┆ … ┆ 30.2 ┆ 28.66 ┆ 18.3 ┆ 9.88 │
136
+ │ 2024-04-01 ┆ 12.519 ┆ 0.38 ┆ 1.626 ┆ … ┆ 34.26 ┆ 31.0 ┆ 18.92 ┆ 11.42 │
137
+ └────────────┴───────────────────┴────────────────────┴────────────────────────┴───┴────────────────────────┴────────────────────────┴────────────────────────┴───────────────────────┘
138
+ 3.1.2 :002 > NyFrbAsDataframe::Hhdc.new('Mort Debt Balance ($T)').fetch
139
+ =>
140
+ shape: (102, 2)
141
+ ┌────────────┬────────────────────────┐
142
+ │ Timestamps ┆ Mort Debt Balance ($T) │
143
+ │ --- ┆ --- │
144
+ │ str ┆ f64 │
145
+ ╞════════════╪════════════════════════╡
146
+ │ 1999-01-01 ┆ null │
147
+ │ 1999-04-01 ┆ null │
148
+ │ 1999-07-01 ┆ null │
149
+ │ 1999-10-01 ┆ null │
150
+ │ 2000-01-01 ┆ null │
151
+ │ 2000-04-01 ┆ null │
152
+ │ 2000-07-01 ┆ null │
153
+ │ 2000-10-01 ┆ null │
154
+ │ 2001-01-01 ┆ null │
155
+ │ 2001-04-01 ┆ null │
156
+ │ 2001-07-01 ┆ null │
157
+ │ 2001-10-01 ┆ null │
158
+ │ 2002-01-01 ┆ null │
159
+ │ 2002-04-01 ┆ null │
160
+ │ 2002-07-01 ┆ null │
161
+ │ 2002-10-01 ┆ null │
162
+ │ 2003-01-01 ┆ 4.942 │
163
+ │ 2003-04-01 ┆ 5.08 │
164
+ │ 2003-07-01 ┆ 5.183 │
165
+ │ 2003-10-01 ┆ 5.66 │
166
+ │ 2004-01-01 ┆ 5.84 │
167
+ │ 2004-04-01 ┆ 5.967 │
168
+ │ 2004-07-01 ┆ 6.21 │
169
+ │ 2004-10-01 ┆ 6.36 │
170
+ │ 2005-01-01 ┆ 6.512 │
171
+ │ 2005-04-01 ┆ 6.696 │
172
+ │ 2005-07-01 ┆ 6.906 │
173
+ │ 2005-10-01 ┆ 7.102 │
174
+ │ 2006-01-01 ┆ 7.436 │
175
+ │ 2006-04-01 ┆ 7.76 │
176
+ │ 2006-07-01 ┆ 8.045 │
177
+ │ 2006-10-01 ┆ 8.234 │
178
+ │ 2007-01-01 ┆ 8.422 │
179
+ │ 2007-04-01 ┆ 8.706 │
180
+ │ 2007-07-01 ┆ 8.925 │
181
+ │ 2007-10-01 ┆ 9.101 │
182
+ │ 2008-01-01 ┆ 9.234 │
183
+ │ 2008-04-01 ┆ 9.273 │
184
+ │ 2008-07-01 ┆ 9.294 │
185
+ │ 2008-10-01 ┆ 9.257 │
186
+ │ 2009-01-01 ┆ 9.135 │
187
+ │ 2009-04-01 ┆ 9.063 │
188
+ │ 2009-07-01 ┆ 8.944 │
189
+ │ 2009-10-01 ┆ 8.843 │
190
+ │ 2010-01-01 ┆ 8.834 │
191
+ │ 2010-04-01 ┆ 8.703 │
192
+ │ 2010-07-01 ┆ 8.609 │
193
+ │ 2010-10-01 ┆ 8.452 │
194
+ │ 2011-01-01 ┆ 8.544 │
195
+ │ 2011-04-01 ┆ 8.516 │
196
+ │ 2011-07-01 ┆ 8.402 │
197
+ │ 2011-10-01 ┆ 8.268 │
198
+ │ 2012-01-01 ┆ 8.187 │
199
+ │ 2012-04-01 ┆ 8.147 │
200
+ │ 2012-07-01 ┆ 8.028 │
201
+ │ 2012-10-01 ┆ 8.033 │
202
+ │ 2013-01-01 ┆ 7.932 │
203
+ │ 2013-04-01 ┆ 7.841 │
204
+ │ 2013-07-01 ┆ 7.897 │
205
+ │ 2013-10-01 ┆ 8.049 │
206
+ │ 2014-01-01 ┆ 8.165 │
207
+ │ 2014-04-01 ┆ 8.096 │
208
+ │ 2014-07-01 ┆ 8.131 │
209
+ │ 2014-10-01 ┆ 8.17 │
210
+ │ 2015-01-01 ┆ 8.171 │
211
+ │ 2015-04-01 ┆ 8.116 │
212
+ │ 2015-07-01 ┆ 8.26 │
213
+ │ 2015-10-01 ┆ 8.249 │
214
+ │ 2016-01-01 ┆ 8.369 │
215
+ │ 2016-04-01 ┆ 8.362 │
216
+ │ 2016-07-01 ┆ 8.35 │
217
+ │ 2016-10-01 ┆ 8.48 │
218
+ │ 2017-01-01 ┆ 8.627 │
219
+ │ 2017-04-01 ┆ 8.691 │
220
+ │ 2017-07-01 ┆ 8.743 │
221
+ │ 2017-10-01 ┆ 8.882 │
222
+ │ 2018-01-01 ┆ 8.939 │
223
+ │ 2018-04-01 ┆ 8.999 │
224
+ │ 2018-07-01 ┆ 9.14 │
225
+ │ 2018-10-01 ┆ 9.124 │
226
+ │ 2019-01-01 ┆ 9.244 │
227
+ │ 2019-04-01 ┆ 9.406 │
228
+ │ 2019-07-01 ┆ 9.437 │
229
+ │ 2019-10-01 ┆ 9.557 │
230
+ │ 2020-01-01 ┆ 9.713 │
231
+ │ 2020-04-01 ┆ 9.776 │
232
+ │ 2020-07-01 ┆ 9.861 │
233
+ │ 2020-10-01 ┆ 10.043 │
234
+ │ 2021-01-01 ┆ 10.16 │
235
+ │ 2021-04-01 ┆ 10.442 │
236
+ │ 2021-07-01 ┆ 10.672 │
237
+ │ 2021-10-01 ┆ 10.93 │
238
+ │ 2022-01-01 ┆ 11.18 │
239
+ │ 2022-04-01 ┆ 11.387 │
240
+ │ 2022-07-01 ┆ 11.669 │
241
+ │ 2022-10-01 ┆ 11.923 │
242
+ │ 2023-01-01 ┆ 12.044 │
243
+ │ 2023-04-01 ┆ 12.014 │
244
+ │ 2023-07-01 ┆ 12.14 │
245
+ │ 2023-10-01 ┆ 12.252 │
246
+ │ 2024-01-01 ┆ 12.442 │
247
+ │ 2024-04-01 ┆ 12.519 │
248
+ └────────────┴────────────────────────┘
249
+ ```
26
250
 
27
- ## Development
251
+ The attributes that can be queried at this time are
28
252
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
253
+ * "Mort Debt Balance ($T)"
254
+ * "HELOC Debt Balance ($T)"
255
+ * "Car Loan Debt Balance ($T)"
256
+ * "CC Debt Balance ($T)"
257
+ * "Student Debt Balance ($T)"
258
+ * "Other Debt Balance ($T)"
259
+ * "Total Debt Balance ($T)"
260
+ * "Num Car Loan Accts (M)"
261
+ * "Num CC Accts (M)"
262
+ * "Num Mort Accts (M)"
263
+ * "Num HELOC Accts (M)"
264
+ * "Num Credit Inquiries and New Accts"
265
+ * "Num New Credit Accts Closed in 12 mo"
266
+ * "Num New Credit Accts Open after 12 mo"
267
+ * "New Mort w Riskscore <620 ($B)"
268
+ * "New Mort w Riskscore 620-659 ($B)"
269
+ * "New Mort w Riskscore 660-719 ($B)"
270
+ * "New Mort w Riskscore 720-759 ($B)"
271
+ * "New Mort w Riskscore 760+ ($B)"
272
+ * "New Mort ($B)"
273
+ * "Median Riskscore for New Mort"
274
+ * "Bottom 25%ile Riskscore for New Mort"
275
+ * "Bottom 10%ile Riskscore for New Mort"
276
+ * "New Car Loans w Riskscore <620 ($B)"
277
+ * "New Car Loans w Riskscore 620-659 ($B)"
278
+ * "New Car Loans w Riskscore 660-719 ($B)"
279
+ * "New Car Loans w Riskscore 720-759 ($B)"
280
+ * "New Car Loans w Riskscore 760+ ($B)"
281
+ * "All New Car Loans ($B)"
282
+ * "Median Riskscore for New Car Loan"
283
+ * "Bottom 25%ile Riskscore for New Car Loan"
284
+ * "Bottom 10%ile Riskscore for New Car Loan"
285
+ * "% Balances Current"
286
+ * "% Balances 30d late"
287
+ * "% Balances 60d late"
288
+ * "% Balances 90d late"
289
+ * "% Balances 120+d late"
290
+ * "% Balances Severely Impair"
291
+ * "% Consumers w Collection"
292
+ * "Avg Collection Amt"
293
+ * "Avg Total Debt Bal for 18-29 yo ($T)"
294
+ * "Avg Total Debt Bal for 30-39 yo ($T)"
295
+ * "Avg Total Debt Bal for 40-49 yo ($T)"
296
+ * "Avg Total Debt Bal for 50-59 yo ($T)"
297
+ * "Avg Total Debt Bal for 60-69 yo ($T)"
298
+ * "Avg Total Debt Bal for 70+ yo ($T)"
299
+ * "New Car Loans for 18-29 yo ($B)"
300
+ * "New Car Loans for 30-39 yo ($B)"
301
+ * "New Car Loans for 40-49 yo ($B)"
302
+ * "New Car Loans for 50-59 yo ($B)"
303
+ * "New Car Loans for 60-69 yo ($B)"
304
+ * "New Car Loans for 70+ yo ($B)"
305
+ * "New Mort for 18-29 yo ($B)"
306
+ * "New Mort for 30-39 yo ($B)"
307
+ * "New Mort for 40-49 yo ($B)"
308
+ * "New Mort for 50-59 yo ($B)"
309
+ * "New Mort for 60-69 yo ($B)"
310
+ * "New Mort for 70+ yo ($B)"
311
+ * "Qtrly % ->90d+ late for 18-29 yo"
312
+ * "Qtrly % ->90d+ late for 30-39 yo"
313
+ * "Qtrly % ->90d+ late for 40-49 yo"
314
+ * "Qtrly % ->90d+ late for 50-59 yo"
315
+ * "Qtrly % ->90d+ late for 60-69 yo"
316
+ * "Qtrly % ->90d+ late for 70+ yo"
317
+ * "Qtrly % ->90d+ late"
318
+ * "Qtrly % Mort ->90d+ late for 18-29 yo"
319
+ * "Qtrly % Mort ->90d+ late for 30-39 yo"
320
+ * "Qtrly % Mort ->90d+ late for 40-49 yo"
321
+ * "Qtrly % Mort ->90d+ late for 50-59 yo"
322
+ * "Qtrly % Mort ->90d+ late for 60-69 yo"
323
+ * "Qtrly % Mort ->90d+ late for 70+ yo"
324
+ * "Qtrly % Mort ->90d+ late"
325
+ * "Qtrly % Car Loans ->90d+ late for 18-29 yo"
326
+ * "Qtrly % Car Loans ->90d+ late for 30-39 yo"
327
+ * "Qtrly % Car Loans ->90d+ late for 40-49 yo"
328
+ * "Qtrly % Car Loans ->90d+ late for 50-59 yo"
329
+ * "Qtrly % Car Loans ->90d+ late for 60-69 yo"
330
+ * "Qtrly % Car Loans ->90d+ late for 70+ yo"
331
+ * "Qtrly % Car Loans ->90d+ late"
332
+ * "Qtrly % CC ->90d+ late for 18-29 yo"
333
+ * "Qtrly % CC ->90d+ late for 30-39 yo"
334
+ * "Qtrly % CC ->90d+ late for 40-49 yo"
335
+ * "Qtrly % CC ->90d+ late for 50-59 yo"
336
+ * "Qtrly % CC ->90d+ late for 60-69 yo"
337
+ * "Qtrly % CC ->90d+ late for 70+ yo"
338
+ * "Qtrly % CC ->90d+ late"
339
+ * "Qtrly % Student Loan ->90d+ late for 18-29 yo"
340
+ * "Qtrly % Student Loan ->90d+ late for 30-39 yo"
341
+ * "Qtrly % Student Loan ->90d+ late for 40-49 yo"
342
+ * "Qtrly % Student Loan ->90d+ late"
343
+ * "New Foreclosures for 18-29 yo (000)"
344
+ * "New Foreclosures for 30-39 yo (000)"
345
+ * "New Foreclosures for 40-49 yo (000)"
346
+ * "New Foreclosures for 50-59 yo (000)"
347
+ * "New Foreclosures for 60-69 yo (000)"
348
+ * "New Foreclosures for 70+ yo (000)"
349
+ * "New Bankruptcies for 18-29 yo (000)"
350
+ * "New Bankruptcies for 30-39 yo (000)"
351
+ * "New Bankruptcies for 40-49 yo (000)"
352
+ * "New Bankruptcies for 50-59 yo (000)"
353
+ * "New Bankruptcies for 60-69 yo (000)"
354
+ * "New Bankruptcies for 70+ yo (000)"
30
355
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
356
+ Refer to https://www.newyorkfed.org/microeconomics/hhdc/background.html and https://www.newyorkfed.org/microeconomics/hhdc for additional information about available data.
32
357
 
33
358
  ## Contributing
34
359
 
@@ -18,13 +18,13 @@ module NyFrbAsDataframe
18
18
  @tag = series
19
19
  end
20
20
 
21
- def fetch(start = nil, fin = nil)
21
+ def fetch(start: nil, fin: nil)
22
22
  df = nil
23
23
 
24
24
  SimpleXlsxReader.configuration.auto_slurp = true
25
25
 
26
26
  Tempfile.open(['foo', '.xlsx'], '/tmp', binmode: true) do |f|
27
- qtr = Date.today.year * 4 + Date.today.quarter
27
+ qtr = Date.today.year * 4 + (Date.today.month.div(3)+1)
28
28
  dta = nil
29
29
  resp = nil
30
30
 
@@ -146,8 +146,8 @@ module NyFrbAsDataframe
146
146
  tmp_df = {}; (0..(keys.length-1)).to_a.each{|i| tmp_df[keys[i]] = vals[i]}
147
147
 
148
148
  tmp_df = Polars::DataFrame.new(tmp_df)
149
- tmp_df = tmp_df.filter(Polars.col('Timestamps_') <= fin.to_date) unless start.nil?
150
- tmp_df = tmp_df.filter(Polars.col('Timestamps_') >= start.to_date) unless fin.nil?
149
+ tmp_df = tmp_df.filter(Polars.col('Timestamps_') <= fin.try(:to_date)) unless fin.nil?
150
+ tmp_df = tmp_df.filter(Polars.col('Timestamps_') >= start.try(:to_date)) unless start.nil?
151
151
  tmp_df.sort!('Timestamps_')
152
152
 
153
153
  if df.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NyFrbAsDataframe
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ny_frb_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
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-17 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: polars-df
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - ".DS_Store"
76
77
  - ".gitignore"
77
78
  - ".travis.yml"
78
79
  - CHANGELOG.md
@@ -87,7 +88,6 @@ files:
87
88
  - lib/ny_frb_as_dataframe/hhdc.rb
88
89
  - lib/ny_frb_as_dataframe/version.rb
89
90
  - ny_frb_as_dataframe.gemspec
90
- - sig/ny_frb_as_dataframe.rbs
91
91
  homepage: https://github.com/bmck/ny_frb_as_dataframe
92
92
  licenses:
93
93
  - MIT
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.4.19
113
+ rubygems_version: 3.1.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Alternative economic and financial data from the NY FRB
@@ -1,4 +0,0 @@
1
- module NyFrbAsDataframe
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end