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.

[!TIP] We pronounce rustac "ruh-stac".

[!NOTE] Until 2025-04-17, this package was named stacrs. See this RFC for context on the name change.

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

[!WARNING] Building DuckDB bundled takes a long while.

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

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.17
File Size Uploaded
rustac-0.9.17.tar.gz 460.1 kB Details

Built distributions (wheels)

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

Total release size: 382.8 MB

Release files / rustac-0.9.17.tar.gz

Download URL rustac-0.9.17.tar.gz
Size 460.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd65e922e52f277d38f500f3e43fb7c76ea7ffb5d1209bc29a74a5c4754caf4d
BLAKE2b-256 checksum
How to use checksums
9600dfd09a5eb0681af8ed8136d52eb6056def889df33ef1db530419d0d33e1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-win_amd64.whl
Size 27.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
499599ff2f6f54fac5dbc025b98e764a04588e9b153baae2affc1cd68ec0cb30
BLAKE2b-256 checksum
How to use checksums
754b020856cd4f2ce85cc7077f5e84805f50307094196def58be6b462a440a63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-win32.whl
Size 24.6 MB
Tags CPython 3.11 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
0eccaedcdf133c6318f8b8ab7e4af63184a9a8369b6259e8529119c3e6043c1c
BLAKE2b-256 checksum
How to use checksums
d7f67080228e61fc85efdf60c4753ddde267afe2947080359e37a4a6075ab2aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-musllinux_1_2_x86_64.whl
Size 38.2 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
bd60f7551100eef0ddf3d6f138a2f1049c757ecd375a88001846e7d1e76644b2
BLAKE2b-256 checksum
How to use checksums
65c02ae4c215202c2941ba7c40da9027cf34f0569760dbe2d59f1225912e4352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-musllinux_1_2_i686.whl
Size 40.5 MB
Tags CPython 3.11 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
57a687f2d80e2218d907cf5b17a34dd8663c9128fa8f6f3123fd61ed7d3f9475
BLAKE2b-256 checksum
How to use checksums
cc84cbec9a7a89413c5d181011ad5117dfdf728abd1011ec8ca82abb4edbaf45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-musllinux_1_2_armv7l.whl
Size 35.4 MB
Tags CPython 3.11 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
c9cc83d9bc1380900b91f7a2841f21a22067acad3039c03b94574947f28dd680
BLAKE2b-256 checksum
How to use checksums
417d2980696da86613b8fe65a0c8505dca2a3e99ef27e23fcd304705d1e63a16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-musllinux_1_2_aarch64.whl
Size 35.4 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
72fa6c9096a1850c5e07f546954e345f7d5a79aa39386e5dd7563c32405af8df
BLAKE2b-256 checksum
How to use checksums
4e74fd4c252d52f3ba0e5e1beb2f9dd5665cd4c1903ff5c072c9e3ef126df5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-manylinux_2_28_x86_64.whl
Size 32.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d4846bda2f150e73e3600c8a19ff9d013b11714aaf90fd3494eb4429bf6928a7
BLAKE2b-256 checksum
How to use checksums
8044799f69cfc09deca638fd08a3f58cb4405a6b9b76f3add121908b66f31325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-manylinux_2_28_ppc64le.whl
Size 35.8 MB
Tags CPython 3.11 Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
8ca0627cf58da1ba0be43b5be70a66abeea1172212d8062969f0d03a9aba95a4
BLAKE2b-256 checksum
How to use checksums
d1df2941858d190d4a8fa63fad9a67e3d627bfb88716d79dea310af94af3c4e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-manylinux_2_28_armv7l.whl
Size 27.7 MB
Tags CPython 3.11 Linux glibc 2.28+ ARMv7l abi3
SHA-256 checksum
How to use checksums
cb4de4fe181b78bd9aa2834a6bd6460fc01c1fc800b0c681a87fb357004511e7
BLAKE2b-256 checksum
How to use checksums
99b2a09273d5d3a27377ef11153e98b1713647a381eacfd70124f80303ed7055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-manylinux_2_28_aarch64.whl
Size 28.9 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
f14ed91cd7c2a879d97bea589bd5a69768075bd80d69a348bd4e0ed8deed55f0
BLAKE2b-256 checksum
How to use checksums
5ec0bd29ef33f5bb95bb9e442d4745d8cb89e0a0739a219f9f556d9ddce87484
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-macosx_11_0_arm64.whl
Size 27.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3bda15586db94be086bf492ddec17c5c1bac3dc5fd603076edea6c8ae4436332
BLAKE2b-256 checksum
How to use checksums
de86cae59c7628b2d6a0caa400280815054d3b4264d6b9602234dd056129280e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

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

Download URL rustac-0.9.17-cp311-abi3-macosx_10_12_x86_64.whl
Size 28.9 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f3e1885d44497bc553405343a69ac21cb9371311dae1ae63349a520d006d5e25
BLAKE2b-256 checksum
How to use checksums
80767eaa45d16c8b17d520a665bc80566288dcb57ca5dc848bd168378f8d2d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.14.1

Release history Release notifications | RSS feed

This release

0.9.17 This release

13 release files

0.9.8

11 release files

0.9.7

11 release files

0.9.6

11 release files

0.9.2

11 release files

0.9.1

11 release files

0.9.0

11 release files

0.8.4

11 release files

0.8.2

12 release files

0.8.1

12 release files

0.8.0

13 release files

0.7.2

5 release files

0.7.1

5 release files

0.7.0

5 release files

0.6.0

9 release files

0.0.1

2 release files

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