Skip to content

stac-utils/rustac

rustac

GitHub Workflow Status Crates.io Contributor Covenant

rustac logo

The power of Rust for the STAC ecosystem

rustac is a monorepo of Rust crates for the SpatioTemporal Asset Catalog (STAC) specification. We have a Python package derived from rustac in its own repository, rustac-py. For more on the difference between rustac and rustac-py, see our docs.

Command line interface

Our command line interface (CLI) can query STAC APIs, validate STAC, and more. Install:

python -m pip install rustac
# or
cargo install rustac

Then:

# Search
$ 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 1000 \
    items.parquet

# Translate formats
$ rustac translate items.parquet items.ndjson
$ rustac translate items.ndjson items.json

# Migrate STAC versions
$ rustac translate item-v1.0.json item-v1.1.json --migrate

# Search stac-geoparquet (no API server required)
$ rustac search items.parquet

# Server
$ rustac serve items.parquet  # Opens a STAC API server on http://localhost:7822

# Validate
$ rustac validate item.json

Crates

This monorepo contains several crates:

Crate Description Badges
stac Core data structures docs.rs
Crates.io
stac-io Input and output docs.rs
Crates.io
stac-extensions Basic support for STAC extensions docs.rs
Crates.io
stac-server STAC API server with multiple backends docs.rs
Crates.io
pgstac Bindings for pgstac docs.rs
Crates.io
stac-duckdb Search stac-geoparquet with duckdb docs.rs
Crates.io
stac-validate JSON schema validation docs.rs
Crates.io
stac-wasm WebAssembly bindings for Arrow to STAC conversions npm
rustac Command line interface docs.rs
Crates.io

They're all related:

graph TD
    stac --> stac-io
    stac --> stac-extensions
    stac --> pgstac
    stac --> stac-duckdb
    stac --> stac-server
    pgstac -.-> stac-server
    stac-duckdb -.-> stac-server
    stac --> rustac
    stac-io --> rustac
    stac-duckdb --> rustac
    stac-server --> rustac
Loading

Note

There's one additional crate in crates, stac-derive. This is not published and is for internal use only.

Development

See CONTRIBUTING.md for information about contributing to this project. See RELEASING.md for a checklist to use when releasing a new version.

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 is dual-licensed under both the MIT license and the Apache license (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

Contributors 13

Languages