Narwhals is an extremely lightweight and extensible compatibility layer between
dataframe libraries!
- Full API support: cuDF, Modin, pandas, Polars, PyArrow
- Interchange-level support: Ibis, Vaex, anything else which implements the
DataFrame Interchange Protocol
Seamlessly support all, without depending on any!
- Just use a subset of the Polars API, no need to learn anything new
- Zero dependencies, Narwhals only uses what the user passes in so your library
can stay lightweight
- Separate lazy and eager APIs, use expressions
- Support pandas' complicated type system and index, without either getting in
the way
- 100% branch coverage, tested against pandas and Polars nightly builds
- Negligible overhead, see overhead
- Let your IDE help you thanks to full static typing, see typing
- Perfect backwards compatibility policy, see stable api for how to opt-in
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above. NOTE: This is a Python port. Instead of py312-narwhals listed in the above command, you can pick from the names under the Packages section.
===> The following configuration options are available for py312-narwhals-2.26.0:
DASK=off: Dask DataFrame support
DUCKDB=off: DuckDB API support
MODIN=off: Modin API support
PANDAS=off: Pandas API support
POLARS=off: Polars API support
PYARROW=off: PyArrow API support
SKLEARN=off: Scikit-learn for testing
SQL=off: SQL query LazyFrame support
SQLFRAME=off: SQLFrame support
===> Use 'make config' to modify these settings