Skip to content

Flatbread

Flatbread is a pandas extension for tabulation — totals, subtotals, percentages, differences, and more. It registers a pita accessor on DataFrames and Series.

import pandas as pd
import flatbread

result = (
    pd.read_json("docs/examples/sightings.json")
    .pivot_table(
        index=["class", "species"],
        columns="season",
        values="count",
        aggfunc="sum",
    )
    .pita.add_subtotals(axis=0, level=0)
    .pita.add_totals()
    .pita.add_percentages(axis=0, interleaf=True)
)

Installation

pip install flatbread

Guide

  • Getting Started — install, import, basic pipeline
  • Aggregation — totals, subtotals, custom aggregations, sorting
  • Panels — percentages, differences, percentage change, interleaving
  • Configuration — config files, layering, runtime overrides
  • Formatting — format presets, manual formatting, pattern matching
  • Display & Export — table styling, Excel export

API Reference