narwhals

Write dataframe-agnostic Python code that runs across multiple backends.

118|10|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/anam-org/metaxy --skill narwhals
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: narwhals
Source: https://github.com/anam-org/metaxy/tree/main/.claude/skills/narwhals
Command: npx skills add https://github.com/anam-org/metaxy --skill narwhals

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Narwhals enables writing dataframe-agnostic code that works across multiple Python dataframe libraries, eliminating backend-specific silos and reducing maintenance overhead.

Core Features & Use Cases

  • Backend-agnostic DataFrame API: write once, run on pandas, polars, cuDF, and more.
  • Full static typing support: type-checked Narwhals code across backends.
  • Easy adoption: wrap library functions with @narwhalify for automatic conversions.

Quick Start

Install Narwhals with pip install narwhals. Then import narwhals as nw and annotate functions with @nw.narwhalify to enable cross-backend compatibility.

Frequently Asked Questions about narwhals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write dataframe-agnostic code that works across pandas and polars?▼

Dataframe-agnostic code runs across pandas and polars by using the Narwhals library to provide a unified API. You wrap library functions with the @narwhalify decorator to enable automatic conversions between native DataFrames.

What is the best way to support multiple dataframe backends without duplicating data pipeline logic?▼

Supporting multiple dataframe backends without duplicating logic requires a backend-agnostic DataFrame API. Narwhals eliminates backend-specific silos by allowing you to write code once that runs on pandas, polars, and cuDF.

Can I use static typing with dataframe-agnostic code across different backends?▼

Static typing works with dataframe-agnostic code across backends using Narwhals. It provides full static typing support so your type-checked Narwhals code remains compatible across pandas, polars, and other supported libraries.

How do I make my existing pandas data analysis function compatible with polars?▼

To make existing pandas functions compatible with polars, install Narwhals via pip and import it as nw. Annotate your functions with @nw.narwhalify to enable cross-backend compatibility and automatic native DataFrame conversion.

Does Narwhals work with cuDF for feature engineering in data pipelines?▼

Narwhals works with cuDF for feature engineering tasks in data pipelines. It provides a backend-agnostic DataFrame API designed for data analysis where code must run seamlessly across pandas, polars, and cuDF environments.

Why do I need to maintain separate codebases for different Python dataframe libraries?▼

Maintaining separate codebases for different dataframe libraries creates maintenance overhead and backend-specific silos. Narwhals solves this by enabling developers to write dataframe-agnostic Python code that runs across multiple backends without duplication.