Skip to content

Narwhals

Extremely lightweight compatibility layer between Polars, pandas, and more.

Seamlessly support both, without depending on either!

  • 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

Who's this for?

Anyone wishing to write a library/application/service which consumes dataframes, and wishing to make it completely dataframe-agnostic.

Let's get started!