python-us icon indicating copy to clipboard operation
python-us copied to clipboard

Extending to Zipcode lookup?

Open dchess opened this issue 3 years ago • 2 comments

Would there be interest in adding a zipcode lookup functionality for this package? That would mean extending the data beyond just state level and return city, state, county, timezone, lat/long for a given zipcode.

I'd be open to submitting a PR if that would be welcome.

dchess avatar Mar 25 '22 01:03 dchess

So, no way here? Seems like there is no maintained library to get states by zip code for python

paxapy avatar Jul 23 '24 07:07 paxapy

Geographically speaking, zip codes are an odd construct. We quite often treat them as though they are geographical entities. They are not. In fact, a zip code is defined by the USPS as being a list of address ranges. That is all.

So, there are assumptions one might make. One might think that zip codes are geographically contiguous. This is not true. One might assume that zip codes do not cross boundaries. But they do. I think they mostly stay within a county, but not always. And there are other boundaries that you might think a zip code would not cross. But they do not really follow those rules.

So, one cannot make an authoritative map of a zip code. Because the authority does not think they are a thing that can be mapped. Using a zip code outside of the context of sending mail is a tricky thing, even if we do it all of the time.

rkiddy avatar Jun 20 '25 19:06 rkiddy