zip codes

steven.oldner steven.oldner at gmail.com
Mon Aug 17 09:03:52 EDT 2009


On Aug 17, 5:21 am, MRAB <pyt... at mrabarnett.plus.com> wrote:
> Sjoerd Mullender wrote:
> > Martin P. Hellwig wrote:
> >> Shailen wrote:
> >>> Is there any Python module that helps with US and foreign zip-code
> >>> lookups? I'm thinking of something that provides basic mappings of zip
> >>> to cities, city to zips, etc. Since this kind of information is so
> >>> often used for basic user-registration, I'm assuming functionality of
> >>> this sort must be available for Python. Any suggestions will be much
> >>> appreciated.
>
> >> There might be an associated can of worms here, for example in the
> >> Netherlands zip codes are actually copyrighted and require a license if
> >> you want to do something with them, on the other hand you get a nice SQL
> >> formatted db to use it. I don't know how this works in other countries
> >> but I imagine that it is likely to be generally the same.
>
> > Also in The Netherlands, ZIP codes are much more fine-grained than in
> > some other countries: ZIP code plus house number together are sufficient
> > to uniquely identify an address.  I.e. you don't need the street name.
> > E.g., my work address has ZIP code 1098 XG and house number 123, so
> > together they indicate that I work at Science Park 123, Amsterdam.
>
> > In other words, a simple city <-> ZIP mapping is not sufficient.
>
> The same comment applies to UK postcodes, which are also alphanumeric.
> My home postcode, for example, is shared with only 3 other houses, IIRC.- Hide quoted text -
>
> - Show quoted text -

Google for Zip codes.  There are some free databases of codes, but
they are dated.  USPS and 3 party vendors sell zip code databases and
lists.  The USPS APIs are a joke.  They were going to charge me for
using them.

I ended up using a 2 year old database of ZIP codes for my needs.

Hope this helps!




More information about the Python-list mailing list