Compare LIHTC projects and reported units by county in Python
Compare historical HUD project records, reported low-income units and source status for selected counties.
Compare reported tax-credit housing projects by county
A housing researcher wants to compare the LIHTC project records and reported low-income units in Durham, Mecklenburg and Wake counties, North Carolina. The prepared file connects each HUD project record to its supplied county geography and keeps service years, unit counts and monitoring flags together.
Download properties.csv below. It is a genuine subset of the purchased table: all 388 project records assigned to these three counties in the source’s 2020 geography, with every column unchanged. The Python code below selects projects with reported service years from 1987 through 2024. The county choices are illustrative; no project data are invented.
The full $29 edition contains 55,345 HUD project records, 161,715 building/address rows and eight documented CSV tables. It is HUD’s 2024 source edition, revised May 28, 2026, with unknown and later-year source records retained explicitly. Inspect the full download.
Code example
Place properties.csv in your working directory. The code runs in a notebook cell, IPython or a script using Python’s standard library. County and project identifiers remain text.
Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.
import csv
from collections import defaultdict
# Genuine county selections; replace these with counties for your analysis.
counties = {'37063': 'Durham, NC', '37119': 'Mecklenburg, NC', '37183': 'Wake, NC'}
with open('properties.csv', encoding='utf-8', newline='') as f:
projects = list(csv.DictReader(f))
if len({r['hud_id'] for r in projects}) != len(projects):
raise ValueError('Expected one row per HUD project record.')
selected = defaultdict(list)
for row in projects:
county = row['county_fips_2020']
if county in counties and row['service_year_status'] == 'within_1987_2024':
selected[county].append(row)
results = []
for county, name in counties.items():
rows = selected[county]
reported = [int(r['li_units']) for r in rows if r['li_units'] != '']
results.append({
'county_fips': county,
'county': name,
'project_records': len(rows),
'reported_low_income_units': sum(reported) if reported else '',
'missing_unit_records': sum(r['li_units'] == '' for r in rows),
'no_longer_monitored_records': sum(r['nonprog'] == '1' for r in rows),
'resyndicated_records': sum(r['resyndication_cd'] == '1' for r in rows),
})
print('Reported LIHTC projects placed in service in 1987–2024; 2020 county geography')
print('County | Project records | Reported low-income units | Missing units | No longer monitored | Resyndicated')
for row in results:
units = f"{row['reported_low_income_units']:,}" if row['reported_low_income_units'] != '' else 'not reported'
print(f"{row['county']} | {row['project_records']} | {units} | "
f"{row['missing_unit_records']} | {row['no_longer_monitored_records']} | {row['resyndicated_records']}")
Analysis of the output
Reported LIHTC projects placed in service in 1987–2024; 2020 county geography
County | Project records | Reported low-income units | Missing units | No longer monitored | Resyndicated
Durham, NC | 43 | 3,436 | 0 | 5 | 3
Mecklenburg, NC | 93 | 8,431 | 0 | 0 | 1
Wake, NC | 136 | 8,936 | 0 | 4 | 11
Wake has 136 project records and 8,936 reported low-income units in the selected cohort, compared with Mecklenburg’s 93 records and 8,431 units. The prepared fields let you compare the project records and their reported units without first decoding HUD’s workbook or reconstructing its geography.
The missing-unit column is zero for these selections, so every selected project contributes a reported low-income-unit count. In other counties, blank unit counts remain missing rather than becoming zero. The full source also contains inconsistent unit counts; consult quality_flags.csv before relying on individual projects.
The last two columns qualify the interpretation. Wake has four records reported no longer monitored and eleven marked as resyndications. A monitoring flag does not establish whether a property remains affordable; blank does not establish active monitoring. Resyndications and project phases can also make summed project units differ from the count of distinct physical units. These totals describe the retained historical records, not apartments currently available.
Using the full dataset
Extract the purchased ZIP and replace the sample properties.csv with the full table. The code runs unchanged. Edit counties to select your locations. Records without a usable 2020 county code cannot enter this county comparison; no older geography is silently substituted. An empty result is not proof that a county has never had LIHTC activity.
To study another geography vintage, select one of 1990, 2000, 2010 or 2020 from property_geographies.csv and join on hud_id. The vintages describe the same project records; do not combine their totals. county_summary.csv supplies prepared summaries with the same dated cohort, reported-unit sums and missing counts.
Join building_addresses.csv on hud_id when you need the supplied building addresses. This can multiply rows. Keep project-level unit totals separate, and use source_row to identify each original address record. Repeated building identifiers and exact source copies are retained and flagged.
The example uses the reported li_units field. HUD’s replacement field li_unitr is separately documented and can differ; ACD does not substitute it for a missing or inconsistent reported value. No current compliance status, expiration date or tenant eligibility is inferred.
The construction and housing markets collection adds county housing estimates, permits and program benchmarks. Review geography and periods before combining them. Public Housing/Section 8 income limits are separate from the MTSP limits used by LIHTC projects.
Sources and versions
HUD provides the original LIHTC database and dictionary free. ACD retained the project and building workbooks, original dictionary and source evidence on November 11, 2026 UTC. The source’s 2024 edition and May 28, 2026 revision date are distinct from that capture and ACD’s processing revision.
ACD adds documented CSV tables, explicit project/address relationships, reviewed labels, geography coverage, quality flags and this tested example. Read the source and preparation record, including retained dictionary discrepancies. Processing improvements and documented publisher corrections to this purchased edition are included; new source editions may be separate purchases.
Example checked November 11, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.