DataFrameLy
raw JSON → 2.9.1 verified Mon Apr 27 auth: no python
A declarative, Polars-native data frame validation library for Python 3.10+. Current version 2.9.1, released April 2026. Active development with monthly releases.
pip install dataframely Common errors
error AttributeError: module 'dataframely' has no attribute 'infer_schema' ↓
cause `infer_schema` was removed from the top-level module's `__all__` in v2.9.1.
fix
Use
dy.infer_schema instead of relying on wildcard import. Ensure you have import dataframely as dy. error PolarsSchemaValidationError: Column 'email' not found in DataFrame ↓
cause `validate` removes columns not in the schema unless `strict=False` is passed.
fix
Add missing columns to schema or pass
strict=False to keep extra columns. error TypeError: unsupported operand type(s) for +: 'Decimal' and 'float' ↓
cause Using float values for Decimal type constraints before v2.7.0.
fix
Upgrade to dataframely >=2.7.0 or use integer values for Decimal constraints.
Warnings
breaking Infer_schema was removed from top-level __all__ in v2.9.1. If you imported `infer_schema` via `from dataframely import *`, it will no longer be available. Use `dy.infer_schema` explicitly. ↓
fix Replace `from dataframely import *` with `import dataframely as dy` and use `dy.infer_schema`.
gotcha `validate` and `filter` remove columns not in the schema by default. If your DataFrame has extra columns, they will be silently dropped. ↓
fix Use `strict=False` parameter to keep extra columns, or define them in the schema.
deprecated The `dy.Decimal` type constraint only accepts integers in some versions (fixed in v2.7.0). If you used float values, upgrade to >=2.7.0. ↓
fix Upgrade to v2.7.0+ or use integer values for Decimal constraints.
Imports
- dy wrong
from dataframely import *correctimport dataframely as dy - Column wrong
from dataframely.column import Columncorrectfrom dataframely import Column - Schema wrong
from dataframely.schema import Schemacorrectfrom dataframely import Schema
Quickstart
import polars as pl
import dataframely as dy
# Define a schema
schema = dy.Schema({
"name": dy.String(),
"age": dy.Int32(),
"email": dy.String().email(),
})
# Validate a DataFrame
df = pl.DataFrame({
"name": ["Alice", "Bob"],
"age": [30, 25],
"email": ["alice@example.com", "bob@example.com"],
})
result = schema.validate(df)
print(result.valid) # True
print(result.errors) # []