narwhals
Extremely lightweight compatibility layer between dataframe libraries
Decision gist · record as of 2026-08-14
Yes. Narwhals is production-ready (Development Status 5), has zero runtime dependencies, active maintenance, no known vulnerabilities, and is already adopted by major projects like scikit-learn, Plotly, and Bokeh. Install it if you maintain a dataframe-consuming library or need to write code that works across multiple backends without forcing users to convert data.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Installation is straightforward with no runtime dependencies—the package only uses what the user provides.
- Active maintenance with a release 32 days ago and 1696 GitHub stars indicates solid community adoption and ongoing support.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use Narwhals in commercial and proprietary projects without restriction or obligation to share modifications.
last release 2026-07-13 (32 days) · last repo commit 2026-08-13 · 1,696 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 152,552,686 downloads/mo, #265 on PyPI
Alternatives
Verify before relying
pip install narwhals
import narwhals as nw
from narwhals.typing import IntoFrameT
def agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
return (
nw.from_native(df_native)
.with_columns(new_col=nw.col("existing") * 2)
.to_native()
)- Whether the subset of Polars API supported covers your specific use case (documentation lists available functions but real-world coverage varies).
- Performance overhead characteristics for your particular dataframe size and operation patterns (documentation mentions negligible overhead but actual impact depends on workload).
What it is and what it does
Narwhals is a zero-dependency wrapper that translates a subset of the Polars API into calls against multiple dataframe backends. You wrap your input dataframe with `nw.from_native()`, write operations using Polars-style expressions, and unwrap the result with `to_native()` to get back the original library's object. This lets library authors and data engineers support pandas, Polars, cuDF, Modin, PyArrow, and others without depending on any of them or forcing users to convert between formats.
The package is designed for library maintainers who want dataframe-agnostic code paths without bloating their dependency tree. It handles both eager and lazy evaluation, supports Polars' expression syntax, and preserves the input library's type system and behavior—so a pandas user gets pandas back, a Polars user gets Polars back, and GPU compute on cuDF stays on GPU.
Use it for
- Write a data transformation function in a library that works with any dataframe backend without adding dependencies.
- Build a visualization or analysis tool that accepts pandas, Polars, or DuckDB tables interchangeably.
- Create a data validation or preprocessing pipeline that runs natively on the user's chosen dataframe library.
- Support both eager pandas workflows and lazy Polars/Dask workflows from the same function signature.
- Migrate a pandas-only library to support Polars without rewriting core logic or maintaining two code paths.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Narwhals is production-ready (Development Status 5), has zero runtime dependencies, active maintenance, no known vulnerabilities, and is already adopted by major projects like scikit-learn, Plotly, and Bokeh. Install it if you maintain a dataframe-consuming library or need to write code that works across multiple backends without forcing users to convert data.
Install
narwhals on PyPI
Before you install
Installation is straightforward with no runtime dependencies—the package only uses what the user provides. Active maintenance with a release 32 days ago and 1696 GitHub stars indicates solid community adoption and ongoing support.
Requires Python 3.10 or later.
License in practice
MIT license is permissive; you can use Narwhals in commercial and proprietary projects without restriction or obligation to share modifications.
Quickstart
pip install narwhals
import narwhals as nw
from narwhals.typing import IntoFrameT
def agnostic_function(df_native: IntoFrameT) -> IntoFrameT:
return (
nw.from_native(df_native)
.with_columns(new_col=nw.col("existing") * 2)
.to_native()
)
Verify before relying
- Whether the subset of Polars API supported covers your specific use case (documentation lists available functions but real-world coverage varies).
- Performance overhead characteristics for your particular dataframe size and operation patterns (documentation mentions negligible overhead but actual impact depends on workload).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 152,552,686 / month, #265 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 2 - BetaTyping :: Typed |
Evidence: narwhals-2.24.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pandas polars compatibility”
- narwhalsNarwhals provides a lightweight compatibility layer that lets you…
- dataframe-api-compatProvides a lightweight compatibility layer that lets you write…
- iso-week-dateParses and manipulates ISO Week date strings in YYYY-WNN and…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Provides a lightweight compatibility layer that lets you write dataframe code once and run it against pandas, Polars, or any other library implementing the Python Dataframe API Standard.
However, maintenance is dormant (no commits since April 2024), so verify that the standard implementation covers your actual use cases and that the libraries you…
Percentify provides one-call exploratory statistics and data-quality diagnostics for pandas and Polars DataFrames, ranking issues worst-first with suggested fixes.
Renders Pandas and Polars DataFrames as interactive, sortable, filterable tables in Jupyter notebooks and web applications without adding runtime dependencies.
Install it if you work with DataFrames in notebooks or web apps and want interactive table display without extra configuration.
Modin is a drop-in replacement for pandas that distributes DataFrame operations across multiple CPU cores, enabling faster execution on larger datasets that would otherwise exhaust memory or run slowly with single-threaded pandas.
However, the 316-day gap since the last release suggests slower maintenance cadence; verify that your specific pandas operations are fully supported before committing…
Polars Cloud extends the Polars DataFrame library to run queries on distributed remote infrastructure, allowing you to scale computations beyond a single machine while using the same Polars API.
However, it is extremely new (0.10.0, released 11 days ago) with a 'Planning' development status, so treat it as early-stage software.
DataComPy compares two DataFrames across Pandas, Polars, Spark, and Snowflake, reporting differences in rows and columns with configurable matching tolerance and structured output for programmatic access.
Install it if you need to compare tabular data programmatically or generate detailed difference reports.
See also ibis-framework · feather-format · cuallee · coola