Skip to main content

rustac

GitHub Workflow Status GitHub Workflow Status PyPI - Version Conda forge PyPI - License Contributor Covenant

The rustac logo

The power of Rust for the Python STAC ecosystem.

Why?

Q: We already have PySTAC, so why rustac?

A: rustac can

If you don't need those things, rustac probably isn't for you — use pystac and its friend, pystac-client.

Installation

rustac has zero required dependencies. Install via pip:

# basic
python -m pip install rustac

# support arrow tables
python -m pip install 'rustac[arrow]'

Or via conda:

conda install conda-forge::rustac

From source

You'll need Rust. By default, rustac wants to find DuckDB on your system:

brew install duckdb  # if you're using Homebrew ... if not, get DuckDB another way
python -m pip install -U git+https://github.com/stac-utils/rustac-py

If you don't want to (or can't) install DuckDB, can build DuckDB as a "bundled" build (warning: it takes a while):

MATURIN_PEP517_ARGS="--features=duckdb-bundled" python -m pip install -U git+https://github.com/stac-utils/rustac-py

Usage

import asyncio
import rustac

async def main() -> None:
    # Search a STAC API
    items = await rustac.search(
        "https://landsatlook.usgs.gov/stac-server",
        collections="landsat-c2l2-sr",
        intersects={"type": "Point", "coordinates": [-105.119, 40.173]},
        sortby="-properties.datetime",
        max_items=100,
    )

    # If you installed with `pystac[arrow]`:
    from geopandas import GeoDataFrame

    table = rustac.to_arrow(items)
    data_frame = GeoDataFrame.from_arrow(table)
    items = rustac.from_arrow(data_frame.to_arrow())

    # Write items to a stac-geoparquet file
    await rustac.write("/tmp/items.parquet", items)

    # Read items from a stac-geoparquet file as an item collection
    item_collection = await rustac.read("/tmp/items.parquet")

    # Use `search_to` for better performance if you know you'll be writing the items
    # to a file
    await rustac.search_to(
        "/tmp/items.parquet",
        "https://landsatlook.usgs.gov/stac-server",
        collections="landsat-c2l2-sr",
        intersects={"type": "Point", "coordinates": [-105.119, 40.173]},
        sortby="-properties.datetime",
        max_items=100,
    )

asyncio.run(main())

See the documentation for details. In particular, our examples demonstrate some of the more interesting features.

Command line interface (CLI)

rustac comes with a CLI:

rustac -h

stac-geoparquet

rustac replicates much of the behavior in the stac-geoparquet library, and even uses some of the same Rust dependencies. We believe there are a couple of issues with stac-geoparquet that make rustac a worthy replacement:

  • The stac-geoparquet repo includes Python dependencies
  • It doesn't have a nice one-shot API for reading and writing
  • It includes some leftover code and logic from its genesis as a tool for the Microsoft Planetary Computer

We test to ensure compatibility between the two libraries, and we intend to consolidate to a single "stac-geoparquet" library at some point in the future.

Development

Get Rust, uv, and (optionally) libduckdb. Then:

git clone git@github.com:stac-utils/rustac-py.git
cd rustac-py
scripts/test

See CONTRIBUTING.md for more information about contributing to this project.

DuckDB

By default, this package expects libduckdb to be present on your system. If you get this sort of error when building:

  = note: ld: library 'duckdb' not found

Set your DUCKDB_LIB_DIR to point to your libduckdb. If you're using homebrew, that might look like this:

export DUCKDB_LIB_DIR=/opt/homebrew/lib

Alternatively, you can use the duckdb-bundled feature to build DuckDB bindings into the Rust library:

maturin dev --uv -F duckdb-bundled && pytest

Docs

If you want to run an off-cycle docs update (e.g. if you fixed something and want to post it without having to make a new release):

mike deploy [version] latest --push

Acknowledgements

We'd like to thank @jkeifer, @parksjr, and @Xenocide122 (all from @Element84) for creating the rustac logo from an AI-generated image from this prompt:

There is a library for working with STAC metadata that is written in rust called rustac: https://github.com/stac-utils/rustac. That name sounds like the word "rustic", and is meant to envoke (sic) an image of "a cabin and a glass of neat whisky".

License

rustac-py is dual-licensed under both the MIT license and the Apache license (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

Metadata

Release files for rustac 0.9.18

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

Source distribution (sdist)

Source distribution for rustac 0.9.18
File Size Uploaded Provenance Actions
rustac-0.9.18.tar.gz 460.3 kB Without provenance Details for rustac-0.9.18.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rustac 0.9.18
File Actions
rustac-0.9.18-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for rustac-0.9.18-cp311-abi3-win_amd64.whl
rustac-0.9.18-cp311-abi3-win32.whl CPython 3.11 abi3 Windows x86-32 Details for rustac-0.9.18-cp311-abi3-win32.whl
rustac-0.9.18-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for rustac-0.9.18-cp311-abi3-musllinux_1_2_x86_64.whl
rustac-0.9.18-cp311-abi3-musllinux_1_2_i686.whl CPython 3.11 abi3 Linux musl 1.2+ x86-32 Details for rustac-0.9.18-cp311-abi3-musllinux_1_2_i686.whl
rustac-0.9.18-cp311-abi3-musllinux_1_2_armv7l.whl CPython 3.11 abi3 Linux musl 1.2+ ARMv7l Details for rustac-0.9.18-cp311-abi3-musllinux_1_2_armv7l.whl
rustac-0.9.18-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for rustac-0.9.18-cp311-abi3-musllinux_1_2_aarch64.whl
rustac-0.9.18-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for rustac-0.9.18-cp311-abi3-manylinux_2_28_x86_64.whl
rustac-0.9.18-cp311-abi3-manylinux_2_28_ppc64le.whl CPython 3.11 abi3 Linux glibc 2.28+ PowerPC 64-le Details for rustac-0.9.18-cp311-abi3-manylinux_2_28_ppc64le.whl
rustac-0.9.18-cp311-abi3-manylinux_2_28_armv7l.whl CPython 3.11 abi3 Linux glibc 2.28+ ARMv7l Details for rustac-0.9.18-cp311-abi3-manylinux_2_28_armv7l.whl
rustac-0.9.18-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for rustac-0.9.18-cp311-abi3-manylinux_2_28_aarch64.whl
rustac-0.9.18-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for rustac-0.9.18-cp311-abi3-macosx_11_0_arm64.whl
rustac-0.9.18-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for rustac-0.9.18-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 395.2 MB

Release files / rustac-0.9.18.tar.gz

Download URL rustac-0.9.18.tar.gz
Size 460.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2cd51d0aee8397b3b45ed152a98ee590966539cb019f2da82cdd88028ac7f024
BLAKE2b-256 checksum
How to use checksums
d017d90abbe8e331431b90a5cb417cfd50f8db64aeb6faab2695c1f2cd101244
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-win_amd64.whl

Download URL rustac-0.9.18-cp311-abi3-win_amd64.whl
Size 28.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
794a858c04f968b7016300ba8a815c74a49fe6bbabe986394a83942cfb910351
BLAKE2b-256 checksum
How to use checksums
e53ffe7539da49af6198bb4aae09ad65f57b18ddceae32d38ffbf7d5c5ae0b41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-win32.whl

Download URL rustac-0.9.18-cp311-abi3-win32.whl
Size 25.5 MB
Tags CPython 3.11 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
20e439fc2f84d2517517b93e37eedd862c76e264ba3f8c22294869b5a2118513
BLAKE2b-256 checksum
How to use checksums
f8bfdb5004da7aa10b04ce5374671279a1053bead38f3defa82db08f8c5b7715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL rustac-0.9.18-cp311-abi3-musllinux_1_2_x86_64.whl
Size 39.3 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
72a5592cbdda86cd0756e0adf426ab874d2e2ee7772567f332e5d15a3ef76d75
BLAKE2b-256 checksum
How to use checksums
d21e893a0ecd66fac3d2ec1d876df5da8bdb308d3fe639763651a0aae6db6a67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-musllinux_1_2_i686.whl

Download URL rustac-0.9.18-cp311-abi3-musllinux_1_2_i686.whl
Size 41.8 MB
Tags CPython 3.11 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
ff19ca73061dc860113fd2484d6ff533a5e5c221f506bfe26ca618d3232c5e2d
BLAKE2b-256 checksum
How to use checksums
c74161e83218ee5deeccc1beed4478382bd3f7e7b798749fe3a337b43314d8dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-musllinux_1_2_armv7l.whl

Download URL rustac-0.9.18-cp311-abi3-musllinux_1_2_armv7l.whl
Size 36.5 MB
Tags CPython 3.11 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
b11535308584531443b2218327acf08f7ddabc19573ac68d0c77d1fcf4730df8
BLAKE2b-256 checksum
How to use checksums
ff56db76d80ab241a7c0e974433224bc9a8d9f9ca44f42d6b90ec2d4f8aab415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL rustac-0.9.18-cp311-abi3-musllinux_1_2_aarch64.whl
Size 36.4 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
90978d73962794d4291689e255ccaa69d645150ec07dec43bff088e919d96ea3
BLAKE2b-256 checksum
How to use checksums
0e7f126b65d28693bfe2780595825b8696b82e69c2b582bb85ed4d635d82b9a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL rustac-0.9.18-cp311-abi3-manylinux_2_28_x86_64.whl
Size 33.5 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b44b34bea0164ab31817276da8bffab8cbbafac82132b911130a59d1fa473d83
BLAKE2b-256 checksum
How to use checksums
c9a7b89f9730c1237fb759354ca91096c2f91e633c508584f181869fe72bbb26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-manylinux_2_28_ppc64le.whl

Download URL rustac-0.9.18-cp311-abi3-manylinux_2_28_ppc64le.whl
Size 36.8 MB
Tags CPython 3.11 Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
4266b7842eda2d1034f287216e58c39a3ce445df4ca83c10ad63f06bbdeef32b
BLAKE2b-256 checksum
How to use checksums
50bd069347d24e5d542e40ef1fd6fb216cbc87d563e85b45ffff9cfd73495262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-manylinux_2_28_armv7l.whl

Download URL rustac-0.9.18-cp311-abi3-manylinux_2_28_armv7l.whl
Size 28.7 MB
Tags CPython 3.11 Linux glibc 2.28+ ARMv7l abi3
SHA-256 checksum
How to use checksums
afab35e7e69f393010b8a303cbc6abc8160e87d99835ae6a347506b5438ce478
BLAKE2b-256 checksum
How to use checksums
e43559b0e1d8d3dc4406d5e85aa855b145b2ce01191ad638b390184378032ec1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL rustac-0.9.18-cp311-abi3-manylinux_2_28_aarch64.whl
Size 29.9 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
400f245171ef96653e83d695d6cf63031ed1aed2440ecfd88314d9f37ae8b90f
BLAKE2b-256 checksum
How to use checksums
1ee03a68a627cce1e08fe74235e788c69937867dc8b50f8e71c030e48f5a02b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-macosx_11_0_arm64.whl

Download URL rustac-0.9.18-cp311-abi3-macosx_11_0_arm64.whl
Size 28.0 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fd9a86dd27dfd4d12ae8b83c42beffa0bcc583f929cc370611f15b8343315889
BLAKE2b-256 checksum
How to use checksums
38c94842211c65fa1c01620c5d153854e9938ac70654d44386f7ef4e77e3c346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / rustac-0.9.18-cp311-abi3-macosx_10_12_x86_64.whl

Download URL rustac-0.9.18-cp311-abi3-macosx_10_12_x86_64.whl
Size 29.8 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
72c647a310cb18817b8725aad32d2207cec91c8e386a2ead7d30734054f51f3d
BLAKE2b-256 checksum
How to use checksums
c2d9fc94b3d151ae92ea65c5f6979ae59310d61b8c5031f06857243cdc74712f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Security for rustac 0.9.18

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.

Release history Release notifications | RSS feed

This release

0.9.18 This release

13 release files No provenance

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