Skip to content

Add US County Provider#2383

Open
ylub wants to merge 2 commits into
joke2k:masterfrom
ylub:add-us-county-provider
Open

Add US County Provider#2383
ylub wants to merge 2 commits into
joke2k:masterfrom
ylub:add-us-county-provider

Conversation

@ylub

@ylub ylub commented Jun 1, 2026

Copy link
Copy Markdown

What does this change

Adds U.S. county support to the en_US address provider:

  • county()
  • county_by_state()
  • county_with_state()

Includes counties and county equivalents such as Louisiana parishes and Alaska boroughs.

What was wrong

Faker’s en_US address provider currently has states, cities, ZIP codes, and street addresses, but no way to generate county names.

How this fixes it

Adds county data and provider methods for generating counties, optionally by state.

Data source: U.S. Census Bureau ANSI/FIPS county reference data

AI Assistance Disclosure (REQUIRED)

I used ChatGPT for help with Git/GitHub workflow, pull request setup, and repository navigation. I reviewed and verified the code myself.

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have run make lint Note: make lint requires python3.11 locally; I ran Ruff on the changed Python files, and all checks passed.
  • I have run the relevant tests

@ylub

ylub commented Jun 4, 2026

Copy link
Copy Markdown
Author

@joke2k If you like this idea and it is approved for Faker, I would also look into adding other countries and various levels of administrative regions, as they differ from one country to the next, such as states and districts for de_DE and de_AT, and regions and departments for fr_FR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant