Compare county business openings, closures and job flows in Python

Look up business openings and closures, then compare gross job gains and losses with the net flow for real county selections.

Compare business turnover and job flows across counties

You are preparing a regional economic brief and want to compare business openings, closures and job flows. Net job creation tells part of the story. The jobs gained at opening and expanding locations, and those lost at closing and contracting locations, show how much activity sits behind that net result.

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 observations are invented.

Download county_years.csv into your working folder. It is a genuine subset of the paid product: all 138 annual records for those three counties, from 1978 through 2023, with all 59 fields retained. The full $29 download covers 144,624 county/year records across 3,144 counties and county equivalents, plus six companion tables. Inspect the complete coverage and fields.

Code example

This example uses Python’s standard library and runs in a notebook cell, IPython or a script. It selects 2023 and looks up each county using both 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.

Python 3.10+ · Jupyter, IPython or a script
"""Compare real county selections using the sample or the complete purchased CSV."""
import csv
from pathlib import Path

counties = [
    {'county_fips': '37183'},  # Wake County, North Carolina
    {'county_fips': '37063'},  # Durham County, North Carolina
    {'county_fips': '06075'},  # San Francisco County, California
]
year = '2023'
with Path('county_years.csv').open(encoding='utf-8', newline='') as source:
    reference = {(row['county_fips'], row['year']): row for row in csv.DictReader(source)}

results = []
for selection in counties:
    row = reference.get((selection['county_fips'], year))
    result = dict(county_fips=selection['county_fips'], year=year)
    if row is None:
        result.update(county_name='', openings='', closures='', jobs_gained='', jobs_lost='',
                      net_jobs='', net_job_rate_percent='', status='outside_reference')
    else:
        fields = {'openings':'estabs_entry', 'closures':'estabs_exit', 'jobs_gained':'job_creation',
                  'jobs_lost':'job_destruction', 'net_jobs':'net_job_creation',
                  'net_job_rate_percent':'net_job_creation_rate'}
        result['county_name'] = row['geography_name']
        for label, field in fields.items():
            result[label] = row[field] if not row[field+'_flag'] else '['+row[field+'_flag']+']'
        result['status'] = 'flagged_measure' if any(row[f+'_flag'] for f in fields.values()) else 'reported'
    results.append(result)

for row in results:
    print(f"{row['county_name'] or row['county_fips']} | {row['year']} | "
          f"openings {row['openings']} | closures {row['closures']} | "
          f"jobs +{row['jobs_gained']} / −{row['jobs_lost']} | "
          f"net {row['net_jobs']} ({row['net_job_rate_percent']}%) | {row['status']}")

Replace counties with your own county codes or load that column from a CSV. Keep leading zeros: San Francisco is 06075. Change year to use another year in the sample. Counties outside these three require the complete purchased table.

Analysis of the output

Wake County, North Carolina | 2023 | openings 3604 | closures 2881 | jobs +83334 / −60668 | net 22666 (4.201%) | reported
Durham County, North Carolina | 2023 | openings 786 | closures 660 | jobs +27380 / −17955 | net 9425 (4.223%) | reported
San Francisco County, California | 2023 | openings 3115 | closures 3145 | jobs +117468 / −98701 | net 18767 (2.536%) | reported

Wake County has 3,604 establishment openings and 2,881 closures in the 2023 record. Those counts describe employer-business locations, not company registrations. One firm may operate several locations.

The job-flow measures include both new and continuing locations. Wake gains 83,334 jobs through openings and expansions and loses 60,668 through closures and contractions, producing a net gain of 22,666. This is useful context for a county brief: the net figure alone would conceal most of the movement.

Wake’s net job creation rate is 4.201%, close to Durham’s 4.223%, despite their different absolute gains. San Francisco’s net gain is 18,767 jobs at 2.536%. The published rates use the BDS employment denominator, which averages the comparison-period employment levels; they are not obtained by dividing net jobs by the current employment stock.

The 2023 flow compares payroll periods including March 12, 2022 and March 12, 2023. It is not January–December hiring, and jobs are not unique workers. The 2020 flow similarly does not describe the full pandemic year.

A bracketed flag such as [D] means the source did not supply a usable numeric value for that measure. D is disclosure suppression, S quality suppression, X structural missingness/zero and N an unavailable rate. Preserve the flag instead of substituting zero. An absent county/year stays in the result as outside_reference.

Connect business turnover to a local economic profile

County Business Patterns adds industry detail for 2023, while this BDS product covers all industries combined. QCEW adds workplace employment and average wages; LAUS history adds resident labor-force and unemployment trends. Check periods, geographic definitions and populations before combining them. These totals are not interchangeable, and none of these joins provides a firm-level history.

Choose the right dataset for businesses, employment and wages →

Using the full dataset

Extract the purchased ZIP and replace the sample with the complete county_years.csv. The code runs unchanged. All history uses 2023 geography, including Connecticut’s nine planning regions. County FIPS and year uniquely identify each row.

benchmark_years.csv keeps state totals, the national total and statewide-unallocated xx999 records separate. Those unallocated records are not counties and are not full state totals. Use the published benchmarks rather than summing firm counts across counties.

The other tables provide geography labels, source/year coverage, source-record accounting, measure definitions and 20 one-job source arithmetic differences. Values in the main table remain exactly as published; the discrepancies are diagnostics, not corrections. Dictionaries explain every field.

Sources and versions

Source: U.S. Census Bureau Business Dynamics Statistics, 2023 edition, released September 25, 2025 and retained by ACD October 25, 2026. The 1978–2023 observations belong to one revised source history. They are not 46 original-as-published annual releases.

The codebook explains establishment, firm, job-flow and rate definitions. The release notes explain consistent geography. The methodology page currently warns that its description awaits an update for a later disclosure-policy change; the package retains the source context reviewed for this edition.

The preparation record separates source coverage 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 25, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.