skillfed

pandas-flavor

The easy way to write your own Pandas flavor

pandas-flavor v0.8.1 1.1M downloads/30d#4,380 on PyPI309
Permissive license MIT Active released

What it is and what it does

Pandas Flavor provides decorators to register custom methods and accessors on Pandas objects—DataFrames, Series, and GroupBy—without forking or modifying Pandas itself. Instead of writing utility functions that operate on Pandas objects from the outside, you use decorators like `@register_dataframe_method` or `@register_dataframe_accessor` to attach your functions directly to the object, so they appear as native methods or namespaced accessor attributes.

The package originated to backport Pandas' extension API to older versions, but has evolved into a tool for building domain-specific Pandas extensions. It is used by projects like pyjanitor and pdvega to add specialized data-cleaning and visualization methods. The library handles the subtle work of creating accessor classes that mimic method behavior, preserving docstrings and call semantics, so your custom code integrates cleanly into Pandas workflows.

Use it for:

  • Build a data-cleaning library that adds methods like `.clean_column_names()` or `.remove_duplicates()` directly to DataFrames.
  • Create domain-specific accessors (e.g., `.bio.translate()` for bioinformatics) that namespace related methods without polluting the DataFrame API.
  • Extend GroupBy objects with custom aggregation or transformation methods for specialized analytics workflows.
  • Develop internal company data tools that add proprietary methods to Pandas objects for consistent, discoverable APIs.
  • Register Series methods for specialized data types or transformations (e.g., `.text.clean()` for text processing).

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Registers custom methods and accessors on Pandas DataFrames, Series, and GroupBy objects, extending Pandas with domain-specific functionality without modifying Pandas itself.

Yes. The package is actively maintained, has no known vulnerabilities, imposes minimal install friction, and solves a real problem: extending Pandas cleanly without monkeypatching or external wrapper functions. Use it if you are building a Pandas-based library or tool that needs to add custom methods or accessors. The MIT license carries no restrictions.

Install

pandas-flavor on PyPI

pip

pip install pandas-flavor

uv

uv add pandas-flavor

poetry

poetry add pandas-flavor

Installing pandas-flavor

Before you install

Low friction installation with a pure Python wheel. Active maintenance (last commit 2026-06-08, 265 days since release) and broad Python support (3.9–3.12, CPython and PyPy). Depends only on pandas and xarray, both widely available.

License in practice

MIT license (permissive) imposes no restrictions on use, modification, or redistribution in proprietary or open-source projects.

Quickstart

pip install pandas-flavor

import pandas as pd
import pandas_flavor as pf

@pf.register_dataframe_method
def my_method(df, col, value):
    return df[df[col] == value]

df = pd.DataFrame({'x': [10, 20], 'y': [0, 2]})
df.my_method('x', 10)

Requires Python 3.10 or later.

Verify before relying

  • Whether xarray is a required runtime dependency or an optional feature; the fact sheet lists it but does not clarify its role.
  • Scope and stability of the tracing feature introduced in 0.5.0 and how it integrates with method registration.
  • Whether backwards compatibility with Pandas <0.23 is still actively maintained or was a historical feature.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pandas, xarray
Maintenance actively maintained — 265 days since the last release
Last repo commit
First released
Downloads 1,089,726/month — #4,380 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pandas_flavor-0.8.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

pandas extension decoratorscustom pandas methodspandas accessor registrationextend pandas dataframepandas monkeypatch alternativepandas plugin systemdataframe custom methods
pandas-extensiondecorator-pattern

More Application Frameworks packages