Python package for the geonames.org postcode databases
geonames_postcode is a Python package to make geonames.org postcode databases accessible in Python. It provides a command line tool to fetch, preprocess, and store the data in a Python file per country. In the result very fast (in-memory) queries by postcodes and names are available using just a few MB per country. Some helper functions are part of the package to solve common tasks like getting distances and finding postcodes nearby.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.