Metadata-Version: 2.4
Name: cutepandas
Version: 0.4.1
Summary: Qt item models, filter proxies and widgets for pandas DataFrames
Keywords: dataframe,gui,model-view,multiindex,pandas,pyqt6,pyside6,qt,table,widgets
Author: phil65
Author-email: phil65 <philipptemminghoff@googlemail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Typing :: Typed
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.0
Requires-Dist: prettyqt>=1.59
Requires-Dist: docutils ; extra == 'addons'
Requires-Dist: orjson ; extra == 'addons'
Requires-Dist: polars>=1.0 ; extra == 'polars'
Requires-Dist: pyqt6 ; extra == 'pyqt6'
Requires-Dist: pyqt6-charts ; extra == 'pyqt6'
Requires-Dist: pyqt6-webengine ; extra == 'pyqt6'
Requires-Dist: pyqt6-qscintilla ; extra == 'pyqt6'
Requires-Dist: pyside6 ; extra == 'pyside6'
Requires-Python: >=3.12
Project-URL: Documentation, https://phil65.github.io/cutepandas/
Project-URL: Homepage, https://github.com/phil65/cutepandas
Project-URL: Issues, https://github.com/phil65/cutepandas/issues
Project-URL: Source, https://github.com/phil65/cutepandas
Provides-Extra: addons
Provides-Extra: polars
Provides-Extra: pyqt6
Provides-Extra: pyside6
Description-Content-Type: text/markdown

# CutePandas: Pandas models and widgets for Qt

[![PyPI License](https://img.shields.io/pypi/l/cutepandas.svg)](https://pypi.org/project/cutepandas/)
[![Package status](https://img.shields.io/pypi/status/cutepandas.svg)](https://pypi.org/project/cutepandas/)
[![Python version](https://img.shields.io/pypi/pyversions/cutepandas.svg)](https://pypi.org/project/cutepandas/)
[![Build](https://github.com/phil65/cutepandas/actions/workflows/build.yml/badge.svg)](https://github.com/phil65/cutepandas/actions/workflows/build.yml)

**CutePandas** provides Qt item models, fast filter proxies and ready-made widgets for
displaying pandas DataFrames in Qt applications, including MultiIndex rows and columns.
It is built on [prettyqt](https://github.com/phil65/prettyqt) and works with PySide6 or PyQt6.

Documentation: https://phil65.github.io/cutepandas/

## Installation

A Qt binding is required, pick one via an extra:

```sh
pip install "cutepandas[pyside6]"
# or
pip install "cutepandas[pyqt6]"
```

## Quickstart

```python
import pandas as pd
from prettyqt import widgets

from cutepandas import pandasmodels, pandaswidgets

app = widgets.app()
df = pd.DataFrame({"name": ["apple", "banana", "cherry"], "price": [1.2, 0.5, 3.0]})

# Composite viewer: data table plus synced row/column headers (MultiIndex aware)
viewer = pandaswidgets.DataFrameViewer(df)
viewer.show()

# Or use the models directly with any view, here with a fast string filter
model = pandasmodels.PandasDataFrameModel(df)
proxy = pandasmodels.PandasStringColumnFilterProxyModel()
proxy.setSourceModel(model)
proxy.set_filter_column(0)
proxy.set_search_term("b")  # rows whose "name" starts with "b"
table = widgets.TableView()
table.set_model(proxy)
table.show()

app.exec()
```

## Features

- **Models**: `PandasDataFrameModel` (cells, MultiIndex levels joined by a configurable
  separator), `VerticalHeaderModel` / `HorizontalHeaderModel` (one cell per index level),
  `PandasColumnListModel`, `PandasIndexListModel`, `PandasCategoryListModel`.
- **Filter proxies** that filter with NumPy boolean indexes instead of per-cell Python
  calls, which is much faster than `QSortFilterProxyModel` on large frames:
  `PandasStringColumnFilterProxyModel`, `PandasMultiStringColumnFilterProxyModel`,
  `PandasEvalFilterProxyModel` (filter with a `DataFrame.eval` expression).
- **Widgets**: `DataFrameViewer` (data and header tables kept in sync, spans for
  MultiIndex), `DataFrameWidget` (viewer with docks for index, columns, categories and
  `df.attrs`), `DataFrameListWidget` and `DataFrameManagerWidget` for several DataFrames.
- Optional `PolarsDataFrameModel` in `cutepandas.pandasmodels.polarsdataframemodel`
  (install the `polars` extra).

## Development

```sh
uv sync --all-extras
uv run pytest
uv run ruff check . && uv run ty check
```

## License

[MIT](https://github.com/phil65/cutepandas/blob/main/LICENSE)
