Compare county business applications in Python
Look up county application counts and annual changes, with reporting-week and geography context.
Compare application activity across counties
You are preparing a regional economic brief and want to see how business application activity differs across markets. This example looks up the latest annual count for three counties and compares it with the previous year. It uses Census Business Formation Statistics (BFS): filtered applications for an Employer Identification Number, rather than a count of businesses that actually opened.
The optional input.csv selects Wake County and Durham County in North Carolina and San Francisco County in California. The same real county codes appear in the counties list in the Python code below. No application observations are invented.
Download county_years.csv into your working folder. This is a genuine subset of the paid product: all 63 annual records for those three counties, from 2005 through 2025, with all 21 fields retained. The full $29 download contains 66,276 county/year records and four companion tables. Inspect the full coverage, fields and limitations.
Code example
The code uses Python’s standard library and runs in a notebook cell, IPython or a script. It selects the 2025 reporting year and looks up each county using its FIPS code and year.
Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.
"""Compare selected counties using the sample or the complete purchased CSV."""
import csv
from pathlib import Path
counties = [
{'county_fips': '37183'}, # Wake County, NC
{'county_fips': '37063'}, # Durham County, NC
{'county_fips': '06075'}, # San Francisco County, CA
]
year = '2025'
reference = {}
with Path('county_years.csv').open(encoding='utf-8', newline='') as source:
for row in csv.DictReader(source):
key = (row['county_fips'], row['year'])
if key in reference:
raise ValueError(f'Duplicate county/year: {key}')
reference[key] = row
results = []
for selection in counties:
row = reference.get((selection['county_fips'], year))
if row is None:
result = dict(county_fips=selection['county_fips'], county_name='', year=year,
applications='', prior_applications='', change_pct='', weeks='',
period_comparison='', status='outside_reference')
else:
result = dict(county_fips=row['county_fips'], county_name=row['county_name'], year=year,
applications=row['applications'], prior_applications=row['prior_applications'],
change_pct=row['applications_change_pct'], weeks=row['weeks'],
period_comparison=row['period_comparison'], status=row['comparison_status'])
results.append(result)
for result in results:
print(f"{result['county_name'] or result['county_fips']} | {result['year']} | "
f"applications {result['applications'] or 'unavailable'} | "
f"prior {result['prior_applications'] or 'unavailable'} | "
f"change {result['change_pct'] or 'unavailable'}% | "
f"{result['weeks']} weeks | {result['period_comparison']} | {result['status']}")
Replace counties with your own codes or load that column from a CSV. Keep leading zeros: San Francisco is 06075. Change year to examine another year in the sample; counties outside these three require the full purchased table.
Analysis of the output
Wake County | 2025 | applications 28887 | prior 25456 | change 13.48% | 53 weeks | different_weeks | calculated
Durham County | 2025 | applications 6533 | prior 5732 | change 13.97% | 53 weeks | different_weeks | calculated
San Francisco County | 2025 | applications 20682 | prior 18749 | change 10.31% | 53 weeks | different_weeks | calculated
Wake County has 28,887 reported applications in 2025, compared with 25,456 in 2024: an arithmetic increase of 13.48%. Durham has 6,533, and San Francisco has 20,682. These counts can add context to a local market brief, while the percentage changes describe movement relative to each county’s own prior count. They do not adjust for population or establish a ranking of entrepreneurship.
All three lines show different_weeks. The 2025 reporting period has 53 weeks, from December 29, 2024 through January 3, 2026. The 2024 period has 52 weeks. The percentage is calculated from the published counts without normalizing for that extra week. It should not be described as an equal-duration growth comparison. Census also reported an EIN application-system outage affecting the final reporting week of 2025.
Applications are an indicator of intent to start a business, not a count of actual openings or new employers. The source counts include disclosure-protection noise and calibration. A published zero is retained as zero; a blank remains unavailable. Percentage change is blank when the prior count is zero or unavailable. The code preserves an absent county/year as outside_reference, so a failed lookup does not silently remove an input.
Connect applications to a wider business profile
County Business Dynamics adds observed employer-location openings, closures and job flows, while County Business Patterns adds employer industry detail and Nonemployer Statistics adds businesses without paid employees. These are complementary measures with different populations and periods. Applications cannot be converted into actual openings by joining these aggregate tables.
Using the full dataset
Extract the purchased ZIP and replace the sample with its complete county_years.csv. The code runs unchanged. The table includes all 3,156 historical source codes across 21 years, including 275 unavailable cells; 3,144 codes have a numeric count in 2025.
Geography is not harmonized. Connecticut switches from counties to planning regions, and other county codes and boundaries change. Our annual arithmetic compares adjacent years for the same code and does not bridge missing years or allocate between codes. Even an unchanged code can have a boundary change. Review Census geographic changes before interpreting a long trend or joining a product that uses a fixed geographic vintage. Source labels are retained, rather than reconstructed for each historical year.
geographies.csv summarizes numeric coverage by source code. periods.csv supplies reporting dates and week counts; 2005 dates are blank because the retained dictionary does not specify them. coverage.csv separates numeric, zero and blank cells by year, and source_row_status.csv accounts for every original data row. Field and table dictionaries document their keys and units.
Sources and versions
Source: U.S. Census Bureau annual county Business Formation Statistics, June 10, 2026 release, retained by ACD October 31, 2026. The 2005–2025 observations belong to one revised history, not 21 original-as-published annual releases.
The county dictionary defines reporting periods; the methodology explains application filtering and disclosure protection. The preparation record separates source changes from ACD processing.
Same-source processing improvements are included for purchasers; genuinely new source editions may be sold separately. No automatic refresh is promised. Original government files are free. ACD sells preparation, documentation, validation and delivery.
Example checked October 31, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.