New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flatbread

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatbread

Pandas extension for aggregation and tabular display

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

Flatbread

Flatbread is a Python library that extends pandas with tabulation features. It makes it easy to create and display summary tables with totals, subtotals, percentages, and aggregations.

Flatbread can be accessed in DataFrames and Series using the pita accessor.

It uses the wc-simple-table dataviewer web component to display tables in a notebook: check out some examples.

Key Features

  • Add row and column totals/subtotals to DataFrames and Series
  • Calculate and format percentages with proper rounding
  • Preserve data types and index structures
  • Table display in Jupyter notebooks

Quick Example

import pandas as pd
import flatbread

df = pd.DataFrame(...)

# Add totals and percentages
result = (
    df
    .pita.add_totals()           # Add grand totals
    .pita.add_subtotals(level=0) # Add subtotals by first index level
    .pita.add_percentages()      # Add percentage columns
)

# Display with interactive viewer
result.pita.configure_display(
    locale="en-US",
    show_hover=True,
    section_levels=1
)

Installation

pip install flatbread

Main Features

  • Totals: Add row/column totals with add_totals()
  • Subtotals: Add subtotals by index level with add_subtotals()
  • Percentages: Add percentage calculations with add_percentages()
  • Aggregation: Custom aggregations with add_agg()
  • Display: Table viewer with rich formatting options

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc