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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| s2rst-0.5.2.tar.gz | 1.2 MB | Without provenance | Details for s2rst-0.5.2.tar.gz |
Built distributions (wheels)
Total release size: 13.5 MB
Release files / s2rst-0.5.2.tar.gz
| Download URL | s2rst-0.5.2.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
007c18f2522ac21142c8b43e4b646e21fbf19d2ee340056abed7c0622baa8533
|
|
BLAKE2b-256 checksum How to use checksums |
93f1e493a5a1d2285fe0354fe4e66f04ad1d3f329f11e00d38867ecb05fe97ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-win_arm64.whl
| Download URL | s2rst-0.5.2-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7c6df4daae7e9a0b0038a71adee919d4fd8044ad629dcac20e8136596c213f55
|
|
BLAKE2b-256 checksum How to use checksums |
fd89d559db474d9fd6b577d5bec02440a6c5d45376bc213b7e6198187208ded1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-win_amd64.whl
| Download URL | s2rst-0.5.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ac39e662c3d3c32ad3dbab31f08aff9012b7096205038718137eccd05452082a
|
|
BLAKE2b-256 checksum How to use checksums |
999dcb0f5c056d7ef28610db5a55316a7dc157e854d7e906fcd8bb00f89d976d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | s2rst-0.5.2-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 |
b356f5a691ceab9995bbb17186047f443e62343e0b9eb2e3391fe578421cf198
|
|
BLAKE2b-256 checksum How to use checksums |
bbcd23d8efd50b9d3ce7a4abc85c7d9805f85a47bcebdd5d752f4433ef5998ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | s2rst-0.5.2-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 |
d70ca0b61b2664aa1cab8af3f75ccbc00d532cf84c6f58b6d8cc142b47896a35
|
|
BLAKE2b-256 checksum How to use checksums |
3c3aef63b1a7001b076ad55f16c02471e809409203f3b583ff4b03bc379d4c94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | s2rst-0.5.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_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 |
453bc9c397600eaf5bf270ad19b4edd514d71cbb96b3828fae014a30897ba2b8
|
|
BLAKE2b-256 checksum How to use checksums |
8976272c2d098889e699122c0079f5dc1ab092ce84838c328e6c699c40033983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | s2rst-0.5.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
13f4a4dc458f02b82223c5c9ce21b0dfd92a503793a2ee1f29e03cd52e9b95e2
|
|
BLAKE2b-256 checksum How to use checksums |
78f64d5fd2bd6baba3aaf36c3b834eaa2fe5972f760f0c33ce351e7fd2868477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | s2rst-0.5.2-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 |
5b85ff92874a8a57fe02f4f93ce6a311efc2ef1f8f04e2dbeec3590b46fce7c7
|
|
BLAKE2b-256 checksum How to use checksums |
b7a89e50c93175ea2edfacc4036dc0f5b95f29118265cebf7b3a98e08675900a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | s2rst-0.5.2-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 |
c46ed200cf3cde36a7fdf4e98a43f4de23ba8c4c13a7ca44865ccce71c579eca
|
|
BLAKE2b-256 checksum How to use checksums |
f0f51d7e5ee1ea91c8c85d03554a9ab78125c52fa21e07fd78bedbded115643a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2
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.