Skip to main content

Python module for interacting with geohashes

Project description

[![Coverage Status](]( ![travis status](

Pygeohash is a Python module that provides functions for decoding and encoding geohashes to and from latitude and longitude coordinates, and doing basic calculations and approximations with them.

It is based off of Leonard Norrgård’s [geohash]( module, but aims to add more functionality while supporting python 3 as well.


To use pygeohash:

import pygeohash as pgh

pgh.encode(42.6, -5.6) # >>> ‘ezs42e44yx96’

pgh.encode(42.6, -5.6, precision=5) # >>> ‘ezs42’

pgh.decode(‘ezs42’) # >>> (‘42.6’, ‘-5.6’)

pgh.geohash_approximate_distance(‘bcd3u’, ‘bc83n’) # >>> 625441


Pygeohash has no requirements outside of the python stdlib, and aims to keep it that way if at all possible. To install:

pip install pygeohash


A portion of this codebase (, is from Leonard Norrgard’s module, which carries the following license:

Copyright (C) 2015 [Leonard Norrgard](

Geohash is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Geohash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Geohash. If not, see [](

This derivative work likewise carries the same license:

Copyright (C) 2015 [Will McGinnis](

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeohash-1.2.0.tar.gz (5.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page