pgeocode
Postal code geocoding
Decision gist · record as of 2026-08-14
Yes, if you need offline postal code geocoding for one of the 83 supported countries and can accept dormant maintenance. The low install friction, permissive license, and lack of security vulnerabilities make it safe to use. However, verify that GeoNames data is current for your use case and be prepared to fork or patch if bugs arise, since the maintainer is not actively releasing updates.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Data is downloaded on first use to ~/.cache/pgeocode (configurable via PGEOCODE_DATA_DIR environment variable).
- Installation is straightforward with low friction—a pure Python wheel with three common dependencies (requests, numpy, pandas).
License · maintenance · safety
BSD (permissive) — Distributed under the permissive 3-clause BSD license, so you can use, modify, and redistribute it freely in commercial or private projects without copyleft obligations.
last release 2024-04-13 (853 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,579,390 downloads/mo, #3,742 on PyPI
Alternatives
Verify before relying
pip install pgeocode
import pgeocode
nomi = pgeocode.Nominatim('fr')
result = nomi.query_postal_code("75013")
print(result)- Whether the GeoNames data source remains accessible and current for all 83 supported countries.
- Performance characteristics and memory footprint for large batch queries across multiple postal codes.
- Whether fuzzy matching and location search work reliably across non-Latin scripts or special characters.
What it is and what it does
pgeocode is a Python library that performs offline geocoding by postal code using data from the GeoNames database. It converts postal codes into geographic coordinates (latitude/longitude), place names, and administrative subdivisions (state, county, community) for 83 countries. The library also supports reverse queries—finding postal codes by place name with fuzzy matching—and computing distances between postal codes.
The package wraps GeoNames data into pandas DataFrames, making results easy to filter and analyze. It depends on requests to download data, numpy for numerical operations, and pandas for tabular results. Queries are performed offline after initial data download, so repeated lookups are fast. However, the package only supports queries within a single country at a time, and maintenance has been dormant for over two years.
Use it for
- Batch geocoding a list of postal codes to coordinates for mapping or geospatial analysis without external API calls.
- Finding the nearest city or administrative region for a given postal code in logistics or address validation workflows.
- Computing distances between postal codes for delivery route planning or proximity analysis.
- Fuzzy-matching place names to postal codes when user input is misspelled or incomplete.
- Building offline geocoding pipelines in data processing workflows where external APIs are unavailable or too slow.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need offline postal code geocoding for one of the 83 supported countries and can accept dormant maintenance.
The low install friction, permissive license, and lack of security vulnerabilities make it safe to use. However, verify that GeoNames data is current for your use case and be prepared to fork or patch if bugs arise, since the maintainer is not actively releasing updates.
Install
pgeocode on PyPI
Before you install
Installation is straightforward with low friction—a pure Python wheel with three common dependencies (requests, numpy, pandas). However, the package is dormant: last released 853 days ago with no recent commits visible, so expect no active maintenance or bug fixes.
Requires Python 3.10 or later. Data is downloaded on first use to ~/.cache/pgeocode (configurable via PGEOCODE_DATA_DIR environment variable).
License in practice
Distributed under the permissive 3-clause BSD license, so you can use, modify, and redistribute it freely in commercial or private projects without copyleft obligations.
Quickstart
pip install pgeocode
import pgeocode
nomi = pgeocode.Nominatim('fr')
result = nomi.query_postal_code("75013")
print(result)
Verify before relying
- Whether the GeoNames data source remains accessible and current for all 83 supported countries.
- Performance characteristics and memory footprint for large batch queries across multiple postal codes.
- Whether fuzzy matching and location search work reliably across non-Latin scripts or special characters.
Package facts
| License | BSD permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesrequestsnumpypandas |
| Maintenance | Dormant 853 days since the last release |
| First released | |
| Downloads | 1,579,390 / month, #3,742 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development |
Evidence: pgeocode-0.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “postal code to coordinates”
- pgeocodepgeocode queries postal codes to retrieve GPS coordinates, place…
- pypostalcodeLooks up Canadian postal codes to retrieve city, province, geographic…
- uszipcodeProvides programmable access to a database of 42,724 US zipcodes with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also pypostalcode · reverse-geocode · reverse_geocoder · pyzipcode · geonamescache · pycountry · isocodes · geocoder · pygeohash · country_list