Panama Postal is a pure-Python toolkit for working with the Panama postal code system. Given a code likeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/kass507/panama-postal/llms.txt
Use this file to discover all available pages before exploring further.
ACC99-PJ42W, it instantly returns precise GPS coordinates, the responsible postal office (estafeta), and the full political subdivision hierarchy — all without calling any external service.
Quickstart
Decode your first postal code and get GPS coordinates in under two minutes.
Installation
Clone the repo and set up optional GeoJSON data files.
Postal System Guide
Understand Panama’s 4-level geospatial grid and how codes are structured.
API Reference
Full reference for
decode, encode, validate, and all lookup classes.What Panama Postal Does
Panama’s postal system encodes geographic coordinates into a compact alphanumeric code using a hierarchical grid anchored at (10°N, 83.5°W). Panama Postal reverse-engineered this algorithm to give you:Decode
Convert any postal code to latitude/longitude with ~3.3 m precision.
Encode
Turn GPS coordinates back into the geographic body of a postal code.
Validate
Check format correctness and confirm coordinates fall inside Panama.
Estafeta Lookup
Find the postal office, zone code, and coverage area for any point.
Political Division
Resolve province, district, corregimiento, village, and neighborhood.
CLI Tool
Interactive and batch-mode command-line interface with color output.
Key Properties
Panama Postal has zero external dependencies — it runs on Python 3.10+ using only the standard library. No
pip install required.- Bit-for-bit accurate — the decoding algorithm was reverse-engineered from the official JavaScript bundle and verified against ~1,000 real codes.
- Offline capable — download the optional GeoJSON files from the official government site once, and all lookups run entirely locally.
- Hybrid fallback — when local GeoJSON files are absent, the library transparently falls back to the official API endpoint.
- MIT licensed — free for personal and educational use.