bd-offline-geocoder
Offline Bangladesh reverse geocoder for Python.
GPS → Bangladesh address parts: house, road, area/village, union/ward, thana/upazila, district, division, postal code, city.
No API key. No network. Same data as npm and Flutter.
Keywords: Bangladesh reverse geocoder, offline geocoding, upazila, thana, ward, Dhaka street, GIS Python.
from bd_offline_geocoder import BdOfflineGeocoder
geocoder = BdOfflineGeocoder.from_included_data()
result = geocoder.reverse(latitude=23.74015, longitude=90.38286)
print(result.formatted)
# House 3, Road 3, Dhanmondi, Ward No-49, Dhanmondi Thana, Dhaka 1209, Bangladesh
print(result.to_dict())
# {
# "house_number": "3",
# "road_number": "3",
# "road_name": "",
# "area_village": "Dhanmondi",
# "union_ward": "Ward No-49",
# "thana_upazila": "Dhanmondi Thana",
# "district": "Dhaka",
# "division": "Dhaka",
# "postal_code": "1209",
# "city": "Dhaka"
# }
Install
pip install bd-offline-geocoder
Python 3.9+. Zero runtime dependencies.
from_included_data() parses bundled GeoJSON once and caches the instance. Reuse it in Celery workers, FastAPI lifespan, or Gunicorn preload.
Published wheel is large (~admin polygons + Dhaka streets) because the feature is offline.
Usage
result = geocoder.reverse(latitude=23.74015, longitude=90.38286)
result.house_number # 3
result.road_number # 3
result.road_name # None unless OSM has a named street
result.area_village # Dhanmondi
result.union_ward # Ward No-49
result.thana_upazila # Dhanmondi Thana
result.district # Dhaka
result.division # Dhaka
result.postal_code # 1209
result.city # Dhaka
result.formatted
result.to_dict()
Outside Bangladesh: found is False and formatted is
This geocoder only supports locations inside Bangladesh.
Invalid / NaN coordinates raise ValueError.
Custom layers
from bd_offline_geocoder import BdOfflineGeocoder, BoundaryLayer, LayerType
layer = BoundaryLayer.from_file(
"my_localities.geojson",
id="localities",
type=LayerType.LOCALITY,
name_property_candidates=("name", "NAME"),
)
geocoder = BdOfflineGeocoder([layer])
Limits
- Nationwide: administrative polygons only (ADM4 is simplified).
- Roads / house numbers: central Dhaka OSM only; house numbers are sparse.
- Not a Google Maps replacement for every rooftop.
Links
Author: Tasfiqul Ghani. MIT code; see notices for HDX / OSM.
Metadata
Release files for bd-offline-geocoder 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bd_offline_geocoder-0.1.1.tar.gz | 29.8 MB | With provenance | Details for bd_offline_geocoder-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bd_offline_geocoder-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for bd_offline_geocoder-0.1.1-py3-none-any.whl |
Total release size: 59.7 MB
Release files / bd_offline_geocoder-0.1.1.tar.gz
| Download URL | bd_offline_geocoder-0.1.1.tar.gz |
|---|---|
| Size | 29.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06ed6ee94f751d3e79fd4ea25ac54f496087ac2c1f5f2240e66ae7f490edd597
|
|
BLAKE2b-256 checksum How to use checksums |
ac63dda0f800959c4d6c7e0dd4eee3cd828da98190289f12ce48cb02cb9c146a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.
Transparency logRelease files / bd_offline_geocoder-0.1.1-py3-none-any.whl
| Download URL | bd_offline_geocoder-0.1.1-py3-none-any.whl |
|---|---|
| Size | 29.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ae73ec5b13725f6239e7eddc47d8e8edb3eabee3c43e0d551030826706f3baa
|
|
BLAKE2b-256 checksum How to use checksums |
9cb1d6a5c520594f8f35e00a4cfaac16798f6ce888fb958a8200c2a93b4c86db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.
Transparency logSecurity for bd-offline-geocoder 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bd_offline_geocoder-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.