pandas-flavor
The easy way to write your own Pandas flavor
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-flavoruv
uv add pandas-flavorpoetry
poetry add pandas-flavorInstalling 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
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
pyjanitorExtends pandas DataFrames with method-chainable…
permissive · top 15,000 on PyPI
swifterSwifter applies functions to DataFrames and…
unclear · top 5,000 on PyPI
sphinx-autosummary-accessorsA Sphinx extension that generates proper…
permissive · top 15,000 on PyPI
awkward-pandasExtends pandas DataFrames to store and…
permissive · top 15,000 on PyPI
Pint-PandasPint-Pandas adds physical unit support to…
permissive · top 15,000 on PyPI
pyspark-pandasProvides tools for distributing Pandas…
unclear · top 5,000 on PyPI
ipfnIterative proportional fitting algorithm that…
permissive · top 15,000 on PyPI
pandasqlpandasql lets you query pandas DataFrames using…
unclear · top 5,000 on PyPI
qpdQPD translates SQL SELECT statements into…
permissive · top 15,000 on PyPI
cualleeCuallee provides a dataframe-agnostic API to…
permissive · top 15,000 on PyPI