Skip to main content

Pretty-print pandas DataFrames as styled interactive HTML tables in your browser

Project description

dfpretty

Pretty-print pandas DataFrames as styled interactive HTML tables — with theme switcher and Excel-like column filters.

Opens a standalone browser window (no Jupyter required).

from dfpretty import pretty
pretty(df, theme="tableau", title="Sales Q1")

themes preview


Installation

# pip
pip install dfpretty

# conda (once on conda-forge)
conda install -c conda-forge dfpretty

Usage

import pandas as pd
from dfpretty import pretty

df = pd.read_csv("data.csv")

pretty(df)                                        # dark theme, opens browser
pretty(df, theme="tableau", title="My Table")     # Tableau style
pretty(df, theme="terminal")                      # green-on-black
pretty(df, locale="de-DE")                        # German number formatting
pretty(df, save="report.html", open_browser=False) # save without opening

Parameters

Parameter Type Default Description
df pd.DataFrame DataFrame to display
title str "DataFrame" Title in the top bar
theme str "dark" Initial colour theme
locale str "en-US" BCP-47 locale for number formatting
save str | Path | None None Save HTML to this path
open_browser bool True Open browser automatically

Returns: Path — path to the generated HTML file.


Themes

Themes can be switched live in the browser via the buttons in the top bar.

Name Style
dark Deep blue-slate, blue accents
tableau Cream background, charcoal header, orange accent — Tableau-inspired
light Clean white, indigo accents
terminal Black, green-on-black Matrix style
notion Soft white, editorial typography

Features

  • Column filters — click ▾ on any column header to filter by value (Excel-style)
  • Global search — filter across all columns at once
  • Sort — click any column name to sort ↑ ↓
  • Number formatting — integers and floats formatted with locale-aware separators
  • Theme switcher — switch themes live without reopening
  • Save to file — export a standalone HTML report

Development

git clone https://github.com/YOUR_USERNAME/dfpretty
cd dfpretty
pip install -e ".[dev]"
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dfpretty-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dfpretty-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file dfpretty-0.1.0.tar.gz.

File metadata

  • Download URL: dfpretty-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for dfpretty-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f66138084568f95235d57ffd0dad3771570645d12a70c91de4bb45188a8c8c36
MD5 50a090447cf42fcf96d75c8b9d7c4b79
BLAKE2b-256 aaf8f955a219664db16b30c31e4e4c34e27fee66db793828871ee92b7c980f84

See more details on using hashes here.

File details

Details for the file dfpretty-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dfpretty-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for dfpretty-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60493ca92a798d3c0b27302da3de5495f5f0e525abddbd48abb5ed688de61c2a
MD5 02d1c4690978c18bb03acc2ec70d8d45
BLAKE2b-256 63e807c879423cd578c207ee8158157c81f310ebbd31dbacadc81986311c6000

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page