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

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.19
File Size Uploaded Provenance Actions
rustac-0.9.19.tar.gz 461.6 kB Without provenance Details for rustac-0.9.19.tar.gz

Built distributions (wheels)

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

Total release size: 395.1 MB

Release files / rustac-0.9.19.tar.gz

Download URL rustac-0.9.19.tar.gz
Size 461.6 kB
Tags Source
SHA-256 checksum
How to use checksums
06f675b64e4e404aa8105ba3e28cfd8a4c62b0787eff0d8604854199f141843d
BLAKE2b-256 checksum
How to use checksums
12ac19d8511aefd96893414372581b710097a1badde8f22f2956005bfcc7c7ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

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

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

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

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

Download URL rustac-0.9.19-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
f43e50e0d8aac027a7b848210dc34e53fef7d444722f5742482ed5ee7f7d2251
BLAKE2b-256 checksum
How to use checksums
4399f4975a69163da02c2d2c216dc8061f529d94b59e2b68cbc59c373b6f1beb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-cp311-abi3-musllinux_1_2_i686.whl
Size 41.7 MB
Tags CPython 3.11 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
0342a8fb69cffc470fbfb23c97ca72b588d4cf5f207bf48199bb5438757cce94
BLAKE2b-256 checksum
How to use checksums
cc2629e333a461323997c280ef0667a7699af415483e878f83b7640f19bece4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
ecfbd5bc65abc617c1e1262655645d667165c922a39de7212827d85674e0965c
BLAKE2b-256 checksum
How to use checksums
c408000f05cad26280f99d7880b1d7d62fcbcc5e53cf6e694094b97ebc670f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
e95b7aba9f3c7c19a6cf4c95d78f20f297f4b5424c7a50749ec32645d6eff60a
BLAKE2b-256 checksum
How to use checksums
dbdcc86e9af3d1f42a418f6630d842a7c685704c8b2b6b8566a7e0b7fb32639c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
25161f4c2a6dba8744fe6c330ac1547a0660eff705fe1e00a44f714e6ec0f5b8
BLAKE2b-256 checksum
How to use checksums
dead06e286ada14be30c6032bd89919d315b329ea5fc47a4fb1a02aa0aadaf2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
7c45dd4541e2433d0165ed14ef235666a55de6ca72dbfd1ac3cd34d4e9bce08c
BLAKE2b-256 checksum
How to use checksums
f70f9a1702b97290413ce4af173a7652844b40cae16f68bd8c50e27ed30b4164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
5a1190c55cc89e977005728e028d8a5fa49c8e8f538eab731c6b9583548bfd60
BLAKE2b-256 checksum
How to use checksums
34ede170182e2b4e7ae32f82ab493b96408349603dc83c89ae4efa6afc56c260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
5dc01b199fd02c06ee5b6808a21644ce90f1d7765800c7fef2cd458b23445747
BLAKE2b-256 checksum
How to use checksums
eedc80e3755ef850ac197d894cff9df6d960784a53ecb11bc1555938dd3ba81d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
4465d2ec06f89f7e650d944c8d56659637cceafd4b7b0382e49401b630b7e9cc
BLAKE2b-256 checksum
How to use checksums
58764a8e6d83b9a73ce1e45d4e4cbff36760ce8821a653fc65463f2867b8504f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

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

Download URL rustac-0.9.19-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
f38b3b47da62cb73d6f75b4b57ab41c60a559989d491dd7d71b4545facfed0f7
BLAKE2b-256 checksum
How to use checksums
1de6b50091b140a4629a575fff9bbee489c25024b605940609ce3c65ea5c4e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.16.0

Security for rustac 0.9.19

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