Skip to main content

majortom

PyPI - Version PyPI - Python Version


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.

Metadata

Release files for majortom-eg 1.1.0

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

Built distributions (wheels)

Table of built distributions (wheels) for majortom-eg 1.1.0
File Actions
majortom_eg-1.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for majortom_eg-1.1.0-cp38-abi3-win_amd64.whl
majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.8 abi3 macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 Details for majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Total release size: 1.6 MB

Release files / majortom_eg-1.1.0-cp38-abi3-win_amd64.whl

Download URL majortom_eg-1.1.0-cp38-abi3-win_amd64.whl
Size 203.5 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
739a45d4c5c5535967770c40f780e76970ce6c7f1c9ed25b33a18e3d4d9607dc
BLAKE2b-256 checksum
How to use checksums
6c40ec14ef173eb9b9b77b0fa0ab0c038bdfb24c02a79624c89801e72a8e5e88
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 10, 2026.

Transparency log

Release files / majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 366.1 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
47f351cbef08ce57be85448dbe37d4d7954082eafa894aadac9103f7382cad81
BLAKE2b-256 checksum
How to use checksums
b1969a8181e0725cffaacb12e38e81f2844168b37c3671f7947af11ae396c462
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 10, 2026.

Transparency log

Release files / majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL majortom_eg-1.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 364.2 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
78ed76ba96495734a3f91bd7d637fbd3f7e5aa895260a294dbc066f480c5da1b
BLAKE2b-256 checksum
How to use checksums
c3316a49811b6df824440fc3f4caff88af626959c493b327c5ebda023af1dec5
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 10, 2026.

Transparency log

Release files / majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL majortom_eg-1.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 626.5 kB
Tags CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9792b11c77579e16d709199920c8f164bd323275300f7b80f57988702faec4e5
BLAKE2b-256 checksum
How to use checksums
d650e08ba7778f413bde3f15510bf68caf677155d03dadf437dbd0d2442765d3
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 10, 2026.

Transparency log

Security for majortom-eg 1.1.0

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

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for majortom_eg-1.1.0-cp38-abi3-win_amd64.whl

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 10, 2026.

Transparency log

A 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.

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