Skip to main content

Geodude

Python 3.8+ PyPI version License: MIT Code style: Ruff

Geodude calculates GeoHashes for batches of latitude and longitude coordinates in Python. It supports precisions from 1 to 12 characters and validates coordinates and input lengths.

Install

python -m pip install geodude

Geodude supports Python 3.8 and newer.

Quick start

Pass latitude and longitude values in matching lists. Coordinates use decimal degrees, with latitude first and longitude second.

from geodude import calculate_geohashes

lats = [37.7749, 40.7128, 51.5074]  # San Francisco, New York, London
lons = [-122.4194, -74.0060, -0.1278]

hashes = calculate_geohashes(lats, lons, precision=5)
print(hashes)
# ['9q8yy', 'dr5re', 'gcpvj']

Precision controls the number of characters in each hash. A longer hash identifies a smaller geographic area:

sf_lat, sf_lon = [37.7749], [-122.4194]

print(calculate_geohashes(sf_lat, sf_lon, precision=3))  # ['9q8']
print(calculate_geohashes(sf_lat, sf_lon, precision=7))  # ['9q8yyk8']

API

calculate_geohashes(lats, lons, precision)

Returns a list of GeoHash strings, one for each latitude/longitude pair.

  • lats: latitudes in decimal degrees, from -90 to 90.
  • lons: longitudes in decimal degrees, from -180 to 180.
  • precision: integer from 1 to 12, inclusive.

Latitude and longitude lists must have the same length. Invalid coordinates, a precision outside the supported range, or a precision that is not an integer raise ValueError. With valid precision, two empty lists return an empty list.

Development

Clone the repository and install the development dependencies:

git clone https://github.com/eddiethedean/geodude.git
cd geodude
python -m pip install -e '.[dev]'

Run the test suite, coverage report, and code checks with:

python -m pytest
python -m pytest --cov=geodude --cov-report=html
python -m mypy src tests
python -m ruff check src tests
python -m ruff format --check src tests

Pytest markers are available for selecting test groups: integration, performance, and slow. For example, run only integration tests with python -m pytest -m integration.

Bug reports and contributions are welcome via GitHub Issues and Pull Requests.

License

Geodude is released under the MIT License.

Metadata

Release files for geodude 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geodude 0.1.1
File Size Uploaded
geodude-0.1.1.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for geodude 0.1.1
File Interpreter ABI Platform
geodude-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / geodude-0.1.1.tar.gz

Download URL geodude-0.1.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f6bd9ade15c79ee42e53c769219bacf8ab9180510323bc746e208f67fc616e65
BLAKE2b-256 checksum
How to use checksums
277a585a14661b1ba5ded4d4b5b6ec17e928365e0be636048b3d47232414ae2b
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 Oct 2, 2026.

Transparency log

Release files / geodude-0.1.1-py3-none-any.whl

Download URL geodude-0.1.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eed7e00d560d7b0bbc65276efce97e9676c1944c08afa9cc107c9cf29794fe7a
BLAKE2b-256 checksum
How to use checksums
31ff0c5eb7375abfac8ee8753c5c02bd3f16ca19617934bc46af11e7acd42bcf
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 Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page