Skip to content

Commit

Permalink
hard code fpl API values
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebPena committed Dec 19, 2024
1 parent ab9e6c7 commit 3b72e1e
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion programs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,41 @@

class FplCache(Cache):
expire_time = 60 * 60 * 24 # 24 hours
default = {}
default = {
"2023": {
1: 14_580,
2: 19_720,
3: 24_860,
4: 30_000,
5: 35_140,
6: 40_280,
7: 45_420,
8: 50_560,
"additional": 5_140,
},
"2024": {
1: 15_060,
2: 20_440,
3: 25_820,
4: 31_200,
5: 36_580,
6: 41_960,
7: 47_340,
8: 52_720,
"additional": 5_380,
},
"2025": {
1: 15_060,
2: 20_440,
3: 25_820,
4: 31_200,
5: 36_580,
6: 41_960,
7: 47_340,
8: 52_720,
"additional": 5_380,
},
}
api_url = "https://aspe.hhs.gov/topics/poverty-economic-mobility/poverty-guidelines/api/"
max_household_size = 8

Expand Down Expand Up @@ -58,6 +92,10 @@ def _fpl_url(self, year: str, household_size: str):
"""
The URL to request the FPL for a year and household size
"""
# NOTE: This made it work, but I am worried that it will break if the API changes back.
# if household_size == '1':
# return self.api_url + year

return self.api_url + year + "/us/" + household_size


Expand Down

0 comments on commit 3b72e1e

Please sign in to comment.