Skip to main content

s2rst — Python bindings

Python bindings for s2rst, a Rust port of Google's S2 Geometry library.

S2 is a library for spherical geometry — geometry on the surface of a sphere. This package exposes the core S2 types (points, cells, caps, polygons, ...) to Python through a thin PyO3 wrapper.

Install

The package is built with maturin:

pip install maturin
maturin develop --release

(or, for a release wheel: maturin build --release).

Quick example

import s2rst

# Create a point on the sphere from latitude/longitude (in degrees).
ll = s2rst.LatLng.from_degrees(37.7749, -122.4194)
p = ll.to_point()

# Find the leaf cell containing the point.
cell = s2rst.CellId.from_point(p)
print(cell.to_token())           # e.g. "808f7c"
print(cell.level())              # 30 (leaf)

# Walk up to a coarser level.
parent = cell.parent_at_level(10)
print(parent.to_debug_string())  # face/childpath form

# Build a circular cap (disc) of 10 km angular radius around the point.
radius = s2rst.Angle.from_radians(10.0 / 6371.0)   # 10 km / earth radius
cap = s2rst.Cap.from_center_angle(p, radius)
print(cap.area())                                   # steradians

Type checking

The package ships PEP 561 type stubs (py.typed + _core.pyi) and is recognised as a typed package by mypy and pyright.

License

Licensed under the Apache License, Version 2.0.

s2rst is an independent port and is not affiliated with, endorsed by, or sponsored by Google.

Metadata

Release files for s2rst 0.5.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 s2rst 0.5.1
File Size Uploaded Provenance Actions
s2rst-0.5.1.tar.gz 1.2 MB Without provenance Details for s2rst-0.5.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for s2rst 0.5.1
File Actions
s2rst-0.5.1-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for s2rst-0.5.1-cp39-abi3-win_arm64.whl
s2rst-0.5.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for s2rst-0.5.1-cp39-abi3-win_amd64.whl
s2rst-0.5.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for s2rst-0.5.1-cp39-abi3-musllinux_1_2_x86_64.whl
s2rst-0.5.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for s2rst-0.5.1-cp39-abi3-musllinux_1_2_aarch64.whl
s2rst-0.5.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for s2rst-0.5.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
s2rst-0.5.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for s2rst-0.5.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
s2rst-0.5.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for s2rst-0.5.1-cp39-abi3-macosx_11_0_arm64.whl
s2rst-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for s2rst-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 13.5 MB

Release files / s2rst-0.5.1.tar.gz

Download URL s2rst-0.5.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
98a71de85b33bd20ae3206359036b3b18b92c1d57d67cf1813f872f1f1587d9c
BLAKE2b-256 checksum
How to use checksums
d953214eb97153fb1dcf9156025771afc4b18165ec6a18140579a5f0d55526fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-win_arm64.whl

Download URL s2rst-0.5.1-cp39-abi3-win_arm64.whl
Size 1.3 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ebf2809f859644fa85e96aa9734c0936948d64a9d3ee62d020a2ed9a798a3d5c
BLAKE2b-256 checksum
How to use checksums
271fb6421f6e3c23fbcfcaf44a0011c059cd6e24f8da81b9e4fe1d4a8608c18d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-win_amd64.whl

Download URL s2rst-0.5.1-cp39-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ddb2601e0f3bcba474b847804124413832d06ced111027762c323cc4d959878a
BLAKE2b-256 checksum
How to use checksums
500606e11671f44d74e6d57480f1b5e70f2d01f68e6bdec811a91f3070f4439b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL s2rst-0.5.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.8 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ea79a4f9e457f52fef882404a42b3abe7e8a646052fb385fa75f7165e9c6141d
BLAKE2b-256 checksum
How to use checksums
5a17ab7c98d26ae4da3320d8564d14b259aa057d9b03ce65fcbafdb9b5243e62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL s2rst-0.5.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.7 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
25e27a9df09bd9a4a88eee9797cec98078c434f179159a5859c1786f138b801f
BLAKE2b-256 checksum
How to use checksums
728e66ed606497dd5c5a03304e14d35ab26c36366e71558ac4cd816f9c593274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL s2rst-0.5.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c82995000a92690786e37d29c53e94d2f8db540ddafece81ac8396353a897382
BLAKE2b-256 checksum
How to use checksums
bf82e1688edc0daa876acaac0db683063e8fa6345623090da81e226beb6eb4ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL s2rst-0.5.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f2b53d23733544a6a11083329444d21081f9cec3c20783994f14fc6f8ec4c6ae
BLAKE2b-256 checksum
How to use checksums
26660cd88696170af33970dd3d333b22e095e9e3da280c33cf2a1232aab632c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL s2rst-0.5.1-cp39-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
49c24061b53abafefd84ff095e6e1294834e2a1f797959132760a52775061d79
BLAKE2b-256 checksum
How to use checksums
cdd1b972c32437fa4e18e7ef87e164f8e71ec67d7c95f85f6dd82689b9ba9d18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / s2rst-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL s2rst-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4db4eb62151be7ecbcc83d3666453cfb9c0080423c350925033d5385c5e3871f
BLAKE2b-256 checksum
How to use checksums
78e183ebf106745c2eb316edab4d3b493476f1bc0d836e958e564bba6d59a413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for s2rst 0.5.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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