Colnade replaces string-based column references with typed class attributes:
```
import colnade as cn
class Users(cn.Schema):
name: cn.Column[cn.Utf8] = cn.Field(pattern=r"^[a-zA-Z\s\-']+$")
age: cn.Column[cn.UInt64] = cn.Field(ge=0, le=150)
score: cn.Column[cn.Float64] = cn.Field(ge=0, le=100)
# Users.naem → type error in your editor# Users.name.sum() → type error (string column)
df.filter(Users.age > 25).sort(Users.score.desc())
```
Colnade is pure Python with no plugins. Backend adapters for Polars, Pandas, and Dask are included today, and the protocol is open to support other backends.
For schema-modifying operations like `select` and `agg`, Python's type system can't infer output schemas- Colnade handles this with explicit re-binding (`cast_schema`) and optional runtime validation, along with Pydantic-style `Field` constraints for domain invariants.
I started building this because time and time again I've found DataFrame operations to be the weakest part of data science & ML projects from a type safety standpoint.
The project is still quite new so the API is likely to continue to evolve quickly, but I'd love any feedback!
Docs: https://colnade.com/
Source: https://github.com/jwde/colnade