pygeohash

Python module for interacting with geohashes

Python MIT
173 Stars
25 Forks
0 Issues

Languages

Python 88.7% C 8.6% Makefile 2.7%

Recent Activity

Last 12 weeks

Top Contributors

Recent Releases

Project Info

Created
January 7, 2016
Last Updated
December 9, 2025
License
MIT
Default Branch
master

About This Project

PyGeoHash is a Python library for working with geohashes, providing encoding, decoding, and distance calculations. It’s designed to be fast, simple, and Pythonic.

Features

  • Encode/Decode: Convert latitude/longitude to geohash and back
  • Distance Calculations: Calculate distances between geohashes
  • Neighbor Finding: Find adjacent geohashes in any direction
  • Type Hints: Full type annotation support for modern Python development

Installation

pip install pygeohash

Quick Start

import pygeohash as pgh

# Encode a location
geohash = pgh.encode(42.6, -5.6)
# Returns: 'ezs42e44yx96'

# Decode a geohash
lat, lon = pgh.decode('ezs42')
# Returns: (42.6, -5.6)

# Get neighbors
neighbors = pgh.neighbors('ezs42')

Related Posts