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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rustac-0.9.16.tar.gz (457.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rustac-0.9.16-cp311-abi3-win_amd64.whl (26.5 MB view details)

Uploaded CPython 3.11+Windows x86-64

rustac-0.9.16-cp311-abi3-win32.whl (23.7 MB view details)

Uploaded CPython 3.11+Windows x86

rustac-0.9.16-cp311-abi3-musllinux_1_2_x86_64.whl (37.2 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

rustac-0.9.16-cp311-abi3-musllinux_1_2_i686.whl (39.5 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

rustac-0.9.16-cp311-abi3-musllinux_1_2_armv7l.whl (34.6 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARMv7l

rustac-0.9.16-cp311-abi3-musllinux_1_2_aarch64.whl (34.5 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

rustac-0.9.16-cp311-abi3-manylinux_2_28_x86_64.whl (31.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

rustac-0.9.16-cp311-abi3-manylinux_2_28_ppc64le.whl (34.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ppc64le

rustac-0.9.16-cp311-abi3-manylinux_2_28_armv7l.whl (26.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARMv7l

rustac-0.9.16-cp311-abi3-manylinux_2_28_aarch64.whl (28.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

rustac-0.9.16-cp311-abi3-macosx_11_0_arm64.whl (26.2 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rustac-0.9.16-cp311-abi3-macosx_10_12_x86_64.whl (27.9 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file rustac-0.9.16.tar.gz.

File metadata

  • Download URL: rustac-0.9.16.tar.gz
  • Upload date:
  • Size: 457.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rustac-0.9.16.tar.gz
Algorithm Hash digest
SHA256 8841bcc27236e0de99dd82978df0fa6528a4f2b30fc4dab83d2ff7803aa8e68d
MD5 797d80b0edbff8d931fc86b9fda3140a
BLAKE2b-256 ba93f7359020292612b4c7d84742a8a06e201e6b64396cad50493ad98d173c0f

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: rustac-0.9.16-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 26.5 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rustac-0.9.16-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3597edcbe347fd60a939cacf6207e4f0d6b8f2bd4de91f72f8a61579b00b407
MD5 8b4da43fba58f1d803d7f10e80dd5259
BLAKE2b-256 3865c4dcb5c6687084fe8360504873d5af3fd6dc5e197bf6d7f3af8fc7642537

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-win32.whl.

File metadata

  • Download URL: rustac-0.9.16-cp311-abi3-win32.whl
  • Upload date:
  • Size: 23.7 MB
  • Tags: CPython 3.11+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rustac-0.9.16-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 2fa5c049b831788fdcd9a656cbecbe0f5bdbc32c9f4c60492ae8c8b5119a45f7
MD5 7c35cc18d17e6cd37ea2881ff8abc462
BLAKE2b-256 234b992ab9b02e6aa2e0215da0f76c278dbdf8e06733bed12d165589575e3bc7

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cd8e009e38eb148977f3aa7dec42fb983afa784fb1b80f5bd1f487bb02b551b4
MD5 01bd18368dfdc04a351e7fe2d1a80a43
BLAKE2b-256 ad2f5f23df505f168910248ece410ed7003410e5c711c5ac44a0f363c723c354

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2f6f16ce687dc68a5eb86e5bf57f6fc3ddc283469aecf19d4f06fdfa31c5a45a
MD5 84b6aea5dbbe1523b0162903e29e8a4f
BLAKE2b-256 d84495fd448ef493673b2b19817d6f6d156da86e24c01951230d9dc3fe8943a8

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 f2702b9c644f100089c2d2392fc1350b890f5ab709a060b86e2380e002dd8c37
MD5 bde3fda202fc22f879432252280e3061
BLAKE2b-256 6359b0be9798f539121a8c0ada3ae8cf9dd2a8637ff853d4c468691092d1f186

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1bb7602dddf9ecfec2bd47aba28758e631c82ec35a318f5151cc7217c620a3b8
MD5 c7668e1291d03e3834e0f5cb21bd1789
BLAKE2b-256 ff6e68a32db546e9c1184742089551874ca9e453afc6bd0a18dc1c8dca2a0254

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 54eef87594be21efad7db89e1b4706298eb30af480219542fcc0902eeff4ca8f
MD5 2a3d43e8a4b24a015ce9d154544ff469
BLAKE2b-256 59f1bee6034c86e11cf55a4d59a543fbd1184e69126ed562883ed647cf83f977

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 ed9b33174528fe223fee05c931ec5f3ec897de9475a017d86d1de6b12f1be964
MD5 44ccd9c707982aa75cdc201a53ac424f
BLAKE2b-256 bc18877e0693c92a7ab860cae4f815a39faec74a4ea3f044cb7ed1f2e8d7fb8b

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 288aee625d809867bfb9a2005921b914cf001e12cc1b39c225c8fb64d24852ee
MD5 244ac0b558c80bdb878184681e61c5b3
BLAKE2b-256 dc48148299f8dd985a4e1e8534f25132928e4c4f35df9cf4efdc742d98638ee9

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6625515f7bea911d579576403fd7437860d219a0c3c18d6b444ae6e5f1b0658a
MD5 09ba323f760360396ed7f62d4f9a2f40
BLAKE2b-256 db6dd9010207a05e3a2cc29697fac8f583dfe5a98e6d3980e2bbca2eeac904f7

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 738529e01f1bbf73284faf16627a7356b165438fa3ae72ecb03062b36e5706f7
MD5 ac7f8813f34b7ef53357e8924b2810ef
BLAKE2b-256 34dcd8d7b9d5487c5392804b16c93c1b9f65e8b8667d57d46fed30f5d41e4120

See more details on using hashes here.

File details

Details for the file rustac-0.9.16-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rustac-0.9.16-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 978ec859ff357246705934e843d9e77339bbf6073ec7ab8677c2c72d45b44ce9
MD5 5f7e4c6595aca7208f3f0e76afb94baf
BLAKE2b-256 037935c70eee3af6a5226a7322f401985ee0a403384add6abd75b8ca9cc2405f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page