Metadata-Version: 2.4
Name: raster-expr
Version: 0.1.0a1
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Typing :: Typed
Summary: Per-pixel raster expressions, compiled to GPU shaders for client-side visualization.
Author-email: Kyle Barron <kyle@developmentseed.org>
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# raster-expr

Per-pixel raster expressions, compiled to GPU shaders for client-side visualization.

This package is the Python client of [raster-expr](https://github.com/developmentseed/raster-expr). It is a binding to the Rust crate `raster-expr-core`, so Python builds the same program types that the browser compiles.

Build an expression, and write its program to bytes:

```python
import raster_expr as rx

nir = rx.input("nir")
red = rx.input("red")
program = rx.Program(nir + red + 1.0)
data = program.serialize()
```

The line that builds an expression that is not valid raises the error. For example, `nir + True` raises a `TypeError`, because a `bool` is not a number here.

This version has one kind of input, a `float32` plane over the tile, so an input needs only its name. A later version declares more for an input: its storage data type, its axes, its nodata value and its mask. `dev-docs/specs/2026-11-20_inputs-as-arrays.md` has that design.

This version has two operators: addition (`a + b`) and negation (`-a`). The API is provisional.

