majortom
An implementation of the ESA Major Tom Grid.
The hot path (generate_grid_cells, cell_from_id, migrate_cell_id) is
implemented in Rust via majortom-rs
and exposed through a PyO3 extension (majortom_eg._native). The public Python
API (shapely polygons, generators) is unchanged.
Installation
Pre-built wheels (manylinux / macOS / Windows):
pip install majortom_eg
From a source checkout (requires a Rust toolchain). Clone or symlink
majortom-rs to
vendor/majortom-rs:
mkdir -p vendor
ln -sfn ../../majortom-rs vendor/majortom-rs # sibling checkout under ../majortom-rs
uv sync
uv run maturin develop --release
Usage
import shapely.geometry
from shapely.io import to_geojson
from majortom_eg import MajorTomGrid, GridCell
# generate an overlapping grid with cells of 320m square
grid = MajorTomGrid(d=320, overlap=True)
# polygon 1/10 of a degree square
my_aoi = shapely.geometry.Polygon(((0., 0.), (0., 0.1), (0.1, 0.1), (0.1, 0.), (0., 0.)))
# iterate of cells returned from generator
for cell in grid.generate_grid_cells(my_aoi):
# do something with cells
print(f'cell id is {cell.id()}')
print(f'cell geom is {to_geojson(cell.geom)}')
Performance
Benchmarks in benches/grid_bench.py (same AOIs as majortom-rs), after
switching the core to Rust (shapely polygons are built lazily on .geom access):
| AOI | Cells (overlap) | Pure Python (before) | Rust-backed Python |
|---|---|---|---|
| Southampton | 225 | ~7.1 ms | ~0.15 ms (~45×) |
| 1° × 1° Maryland | 187,626 | ~5.7 s | ~135 ms (~40×) |
cell_from_id |
— | ~315 µs | ~0.5 µs |
Raw Rust (majortom-rs criterion) is still faster (~12 ms for the 1° case) because
it never crosses the FFI / Python object boundary; the wrap is the right default
for Python callers.
uv run python benches/grid_bench.py
License
majortom is distributed under the terms of the MIT license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file majortom_eg-1.1.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: majortom_eg-1.1.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 203.5 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739a45d4c5c5535967770c40f780e76970ce6c7f1c9ed25b33a18e3d4d9607dc
|
|
| MD5 |
e810df110ffd159e4e6a1726431537a1
|
|
| BLAKE2b-256 |
6c40ec14ef173eb9b9b77b0fa0ab0c038bdfb24c02a79624c89801e72a8e5e88
|
Provenance
The following attestation bundles were made for majortom_eg-1.1.0-cp38-abi3-win_amd64.whl:
Publisher:
publish.yaml on earth-genome/majortom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
majortom_eg-1.1.0-cp38-abi3-win_amd64.whl -
Subject digest:
739a45d4c5c5535967770c40f780e76970ce6c7f1c9ed25b33a18e3d4d9607dc - Sigstore transparency entry: 2409357166
- Sigstore integration time:
-
Permalink:
earth-genome/majortom@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/earth-genome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 366.1 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47f351cbef08ce57be85448dbe37d4d7954082eafa894aadac9103f7382cad81
|
|
| MD5 |
a8dfaf5df4456d26630c4cbcc77fc590
|
|
| BLAKE2b-256 |
b1969a8181e0725cffaacb12e38e81f2844168b37c3671f7947af11ae396c462
|
Provenance
The following attestation bundles were made for majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yaml on earth-genome/majortom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
47f351cbef08ce57be85448dbe37d4d7954082eafa894aadac9103f7382cad81 - Sigstore transparency entry: 2409357023
- Sigstore integration time:
-
Permalink:
earth-genome/majortom@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/earth-genome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 364.2 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78ed76ba96495734a3f91bd7d637fbd3f7e5aa895260a294dbc066f480c5da1b
|
|
| MD5 |
c2fbad818d45ff2dc12f185b304b9dcd
|
|
| BLAKE2b-256 |
c3316a49811b6df824440fc3f4caff88af626959c493b327c5ebda023af1dec5
|
Provenance
The following attestation bundles were made for majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yaml on earth-genome/majortom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
78ed76ba96495734a3f91bd7d637fbd3f7e5aa895260a294dbc066f480c5da1b - Sigstore transparency entry: 2409356794
- Sigstore integration time:
-
Permalink:
earth-genome/majortom@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/earth-genome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 626.5 kB
- Tags: CPython 3.8+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9792b11c77579e16d709199920c8f164bd323275300f7b80f57988702faec4e5
|
|
| MD5 |
1745c7f5f88e6b44d627b460ffad7df0
|
|
| BLAKE2b-256 |
d650e08ba7778f413bde3f15510bf68caf677155d03dadf437dbd0d2442765d3
|
Provenance
The following attestation bundles were made for majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:
Publisher:
publish.yaml on earth-genome/majortom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
9792b11c77579e16d709199920c8f164bd323275300f7b80f57988702faec4e5 - Sigstore transparency entry: 2409357277
- Sigstore integration time:
-
Permalink:
earth-genome/majortom@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/earth-genome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2d3db6cf748f9820e0a2134052d46e8ae0a178f3 -
Trigger Event:
push
-
Statement type: