Skip to content

allenjhyang/zip2fips

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zip2fips

At work, we keep certain location information indexed by zipcode. Recently, I wanted to feed that data into something that worked with 5-digit FIPS county codes, and was unable to find an easily-parsed table that mapped, however roughly, from one to the other. The best I could find was the CDC's County Cross Reference files, but I realized I needed to do quite a bit of parsing before they were really useful to me. I figured it might be of use to someone else, so here it is.

The fetch_source script downloads the zip files and makes the one "cleanup" change required, to line 1794315 of zipcty4, which originally was missing GA as the state abbreviation.

makejson.py constructs the json dictionary from zip code to county code from the zipcty files. The output is in zip2fips.json.

The state_fips.json file was made by hand, where "by hand" means I copy-and-pasted this table and manipulated it in Emacs.

About

Mapping of ZIP codes to FIPS county codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published