pypostalcode
Radius searches on Canadian postal codes, location data
What it is and what it does
pypostalcode is a Canadian postal code database and lookup tool. It provides fast lookups of Forward Sortation Area (FSA) codes to retrieve associated city, province, geographic coordinates, and timezone data. The package also supports radius-based searches to find all postal codes within a specified distance in kilometers from a given FSA code.
The package has no runtime dependencies and installs cleanly as a pure Python wheel. It was last updated in June 2021 and is no longer actively maintained, so the underlying postal code data may not reflect recent changes to Canadian postal code assignments or geographic boundaries.
Use it for:
- Look up city and province information for a Canadian postal code in an application or data pipeline.
- Find all postal codes within a radius to support location-based filtering or geographic queries.
- Retrieve geographic coordinates and timezone for a postal code to support mapping or scheduling features.
- Validate or enrich Canadian address data with postal code lookups in batch processing.
- Support geolocation features in a web or mobile application serving Canadian users.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Looks up Canadian postal codes to retrieve city, province, geographic coordinates, and timezone information, and finds postal codes within a specified radius.
Yes, if you need Canadian postal code lookups and can accept that the data is frozen as of June 2021. The package is stable, has no dependencies, and installs easily. However, if you require current postal code data or active maintenance, you should verify the database currency against Canada Post's current FSA assignments before relying on it in production.
Install
pypostalcode on PyPI
pip
pip install pypostalcodeuv
uv add pypostalcodepoetry
poetry add pypostalcodeInstalling pypostalcode
Before you install
Installation is straightforward with no runtime dependencies. The package is abandoned as of June 2021 with no recent maintenance, so expect no updates or bug fixes.
License in practice
MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install pypostalcode
from pypostalcode import PostalCodeDatabase
pcdb = PostalCodeDatabase()
location = pcdb['V5K']
print(location.city, location.province, location.latitude, location.longitude)
Verify before relying
- Whether the postal code database is current or reflects changes to Canadian postal codes since the last 2021 release.
- Compatibility with modern Python versions, as the package specifies no explicit Python version requirement.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,882 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 196,048/month — #9,799 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pypostalcode-0.4.1-py3-none-any.whl
Keywords: Canada, postal, code, distance, geonames
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
pgeocodepgeocode queries postal codes to retrieve GPS…
permissive · top 5,000 on PyPI
pyzipcodeProvides local lookup of US ZIP code…
permissive · top 15,000 on PyPI
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
pyap2Pyap2 detects and parses postal addresses from…
permissive · top 15,000 on PyPI
stats-canFetches Statistics Canada data through the Web…
copyleft · top 15,000 on PyPI
uszipcodeProvides programmable access to a database of…
permissive · top 5,000 on PyPI
pyapPyap detects and parses postal addresses from…
permissive · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
zipcodesQuery and validate U.S. zipcodes with embedded…
permissive · top 15,000 on PyPI
postalPython bindings to libpostal, a C library for…
permissive · top 15,000 on PyPI