Back to browse
GitHub Repository

Statically type-safe DataFrame abstraction layer for Python.

3 starsPython

Colnade – Type-Safe DataFrames for Python

by jwde·Mar 1, 2026·3 points·1 comment

AI Analysis

●●●BangerBig BrainSolve My ProblemWizardry

Type-safe DataFrames without plugins: catch column typos in your editor, not production.

Strengths
  • Zero plugins or code generation—pure Python using descriptor protocol and generics
  • Catches schema mismatches at lint time across multiple backends with unified API
  • Handles output schema binding for select/agg via explicit cast_schema, solving Python's type inference limits
Weaknesses
  • Early-stage project (1 star, appears brand new); runtime behavior and performance unproven in production
  • Requires explicit schema rebinding for transformations, adding friction vs. Polars' native type inference
Target Audience

Python data engineers and analysts using DataFrames at scale who want static type safety

Similar To

Polars (native type system) · SQLAlchemy ORM (declarative schema mapping) · Ibis (DataFrame abstraction layer)

Post Description

Colnade is an expression-building and translation layer that sits on top of DataFrame backends like Polars, Dask, and Pandas to provide lint-time safety.

Colnade replaces string-based column references with typed class attributes:

```

import colnade as cn

class Users(cn.Schema):

name: cn.Column[cn.Utf8]

age: cn.Column[cn.UInt64]

score: cn.Column[cn.Float64]

# 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: colnade.com Source: https://github.com/jwde/colnade

Similar Projects

DataMid

DataFrame Library Nobody Asked For

Yet another DataFrame library competing against established tools like Polars.

Bold Bet
NavodPeiris
2018d ago