Skip to content

Commit 3d72bd7

Browse files
authored
Add HHS ACF LIHEAP FY2023 source package (#44)
1 parent 1eb30e2 commit 3d72bd7

5 files changed

Lines changed: 138 additions & 22 deletions

File tree

arch/source_package.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@
115115
"federal-reserve-z1-household-net-worth": Path(
116116
"federal_reserve/z1_household_net_worth"
117117
),
118+
"hhs-acf-liheap-fy2023-national-profile": Path(
119+
"hhs_acf_liheap/fy2023_national_profile"
120+
),
118121
"hhs-acf-liheap-fy2024-national-profile": Path(
119122
"hhs_acf_liheap/fy2024_national_profile"
120123
),
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
source: HHS ACF Office of Community Services
2+
dataset: LIHEAP FY2023 National Profile (All States)
3+
vintage: FY 2023
4+
retrieved: 2026-05-11
5+
notes: >-
6+
Full publisher PDF downloaded from the HHS ACF LIHEAP Performance Management
7+
site and parsed with the Arch PDF document-number parser.
8+
files:
9+
2023:
10+
filename: acf_liheap_fy2023_all_states_national_profile.pdf
11+
sha256: 91def56c2a2621d6899180e05a82e9d42419b64f535e1bc610145aac9ee3895f
12+
source_url: https://liheappm.acf.gov/sites/default/files/private/congress/profiles/2023/FY2023AllStates%28National%29Profile-508Compliant.pdf
13+
source_table: LIHEAP FY2023 National Profile (All States)
14+
size_bytes: 125199
15+
storage:
16+
r2:
17+
provider: r2
18+
bucket: arch-raw
19+
key: raw/hhs_acf_liheap/hhs-acf-liheap-fy2023-national-profile/2023/91def56c2a2621d6899180e05a82e9d42419b64f535e1bc610145aac9ee3895f/acf_liheap_fy2023_all_states_national_profile.pdf
20+
uri: r2://arch-raw/raw/hhs_acf_liheap/hhs-acf-liheap-fy2023-national-profile/2023/91def56c2a2621d6899180e05a82e9d42419b64f535e1bc610145aac9ee3895f/acf_liheap_fy2023_all_states_national_profile.pdf
21+
source_id: hhs_acf_liheap
22+
package_id: hhs-acf-liheap-fy2023-national-profile
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
schema_version: arch.source_package.v1
2+
package_id: hhs-acf-liheap-fy2023-national-profile
3+
label: HHS ACF LIHEAP FY2023 National Profile
4+
artifact:
5+
source_name: hhs_acf_liheap
6+
source_table: LIHEAP FY2023 National Profile (All States)
7+
resource_package: db
8+
resource_directory: data/hhs_acf_liheap/fy2023_national_profile
9+
manifest: manifest.yaml
10+
vintage: fiscal_year_2023
11+
extracted_at: "2026-05-11"
12+
extraction_method: pypdf text-line number extraction from full publisher PDF
13+
parser: pdf_text_numbers
14+
record_sets:
15+
- record_set_id: hhs_acf_liheap.fy2023.national_profile
16+
record_set_spec_id: hhs_acf_liheap.national_profile.v1
17+
source_record_id_prefix: hhs_acf_liheap.fy2023.national_profile
18+
sheet_name: document_numbers
19+
period_type: fiscal_year
20+
period: 2023
21+
geography_id: 0100000US
22+
geography_level: country
23+
geography_name: United States
24+
geography_vintage: 2020_census
25+
entity: household
26+
entity_role: recipient_household
27+
domain: liheap_state_programs
28+
groupby_dimension: program
29+
rows:
30+
- value_id: state_programs
31+
label: State programs
32+
ordinal: 0
33+
row_number: 5
34+
expected_row_header_column: C
35+
expected_row_header: "5,939,605"
36+
filters:
37+
program: liheap
38+
administering_entity: state_programs
39+
constraints:
40+
- variable: program
41+
operator: "=="
42+
value: liheap
43+
label: LIHEAP
44+
- variable: administering_entity
45+
operator: "=="
46+
value: state_programs
47+
label: State programs
48+
guard_cells:
49+
- column: A
50+
expected_value: 1
51+
label: PDF page number
52+
- column: B
53+
expected_value: 13
54+
label: PDF extracted line number
55+
- column: D
56+
expected_value: "5,939,605"
57+
label: source number text
58+
- column: F
59+
expected_value: Total Households Served by State Programs 5,939,605 State Maximum Income Eligibility Requirements for
60+
label: nearby PDF text context
61+
table_record_kind: total
62+
measures:
63+
- measure_id: households_served
64+
label: Total households served by state programs
65+
ordinal: 0
66+
column: E
67+
source_column_id: numeric_value
68+
expected_column_header_row: 1
69+
expected_column_header: numeric_value
70+
concept: hhs_acf_liheap.households_served_by_state_programs
71+
unit: count
72+
aggregation: count
73+
expected_cell_type: number

tests/test_arch_source_package.py

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -973,43 +973,61 @@ def test_cms_medicare_trustees_package_builds_part_b_premium_fact():
973973
assert values_by_record[record_id].measure.unit == "usd"
974974

975975

976-
def test_hhs_acf_liheap_package_builds_household_count_fact():
977-
package = load_source_package("hhs-acf-liheap-fy2024-national-profile")
978-
cells = package.build_source_cells(2024)
979-
records = package.build_source_records(2024, cells=cells)
980-
facts = package.build_facts(2024, cells=cells)
976+
@pytest.mark.parametrize(
977+
("source", "year", "cell_count", "households", "addresses", "source_file"),
978+
[
979+
(
980+
"hhs-acf-liheap-fy2023-national-profile",
981+
2023,
982+
360,
983+
5_939_605,
984+
("E5", "E1", "A5", "B5", "D5", "F5"),
985+
"acf_liheap_fy2023_all_states_national_profile.pdf",
986+
),
987+
(
988+
"hhs-acf-liheap-fy2024-national-profile",
989+
2024,
990+
348,
991+
5_876_646,
992+
("E3", "E1", "A3", "B3", "D3", "F3"),
993+
"acf_liheap_fy2024_all_states_national_profile.pdf",
994+
),
995+
],
996+
)
997+
def test_hhs_acf_liheap_package_builds_household_count_fact(
998+
source,
999+
year,
1000+
cell_count,
1001+
households,
1002+
addresses,
1003+
source_file,
1004+
):
1005+
package = load_source_package(source)
1006+
cells = package.build_source_cells(year)
1007+
records = package.build_source_records(year, cells=cells)
1008+
facts = package.build_facts(year, cells=cells)
9811009
values_by_record = {fact.source_record_id: fact for fact in facts}
9821010

983-
assert package.package_id == "hhs-acf-liheap-fy2024-national-profile"
1011+
assert package.package_id == source
9841012
assert validate_source_cells(cells).valid
9851013
assert validate_facts(facts).valid
986-
assert len(cells) == 348
1014+
assert len(cells) == cell_count
9871015
assert len(facts) == 1
9881016
assert all(fact.source.raw_r2_uri for fact in facts)
9891017

9901018
record_id = (
991-
"hhs_acf_liheap.fy2024.national_profile."
1019+
f"hhs_acf_liheap.fy{year}.national_profile."
9921020
"state_programs.households_served"
9931021
)
994-
assert records[0].source_cell_addresses == (
995-
"E3",
996-
"E1",
997-
"A3",
998-
"B3",
999-
"D3",
1000-
"F3",
1001-
)
1002-
assert values_by_record[record_id].value == 5_876_646
1022+
assert records[0].source_cell_addresses == addresses
1023+
assert values_by_record[record_id].value == households
10031024
assert values_by_record[record_id].measure.concept == (
10041025
"hhs_acf_liheap.households_served_by_state_programs"
10051026
)
1006-
assert values_by_record[record_id].period.value == 2024
1027+
assert values_by_record[record_id].period.value == year
10071028
assert values_by_record[record_id].geography.id == "0100000US"
10081029
assert values_by_record[record_id].entity.name == "household"
1009-
assert (
1010-
values_by_record[record_id].source.source_file
1011-
== "acf_liheap_fy2024_all_states_national_profile.pdf"
1012-
)
1030+
assert values_by_record[record_id].source.source_file == source_file
10131031
assert values_by_record[record_id].constraints
10141032

10151033

0 commit comments

Comments
 (0)