Skip to main content

A Polars-native DataFrame styling tool for HTML visualization

Project description

Polarise

Polarise

Style your data to explore. Style your results to present.

A Polars-native DataFrame styling tool for HTML visualization

  • Fast, expressive styling with a clean, chainable API
  • Turn Polars DataFrames into clear, expressive HTML views
  • Style using native Polars expressions
  • Built for data inspection, debugging, and exploration
  • Ready for reports, presentations, and sharing

Documentation

Full documentation: https://egayer.github.io/polarise/


Installation

pip install polarise

Quickstart

import polars as pl
import polarise

df = pl.DataFrame({
    "date": ["2024-01-01", "2024-01-02", "2024-01-03", "2024-01-04"],
    "region": ["EU", "EU", "US", "US"],
    "sales": [120, 85, 210, 250],
    "profit": [20, -15, 45, 55]
})

(
    df.style()
      .highlight_when(
          in_col="date",
          when=pl.col("profit") < 0,
          then_fill="alert_orange"
      )
      .gradient("sales", cmap="greens")
      .bar("profit", fill_pos="alert_green", fill_neg="alert_orange")
      .fashion_zebra()
      .show()
)

Where Polarise fits

Polarise is inspired by the styling capabilities of pandas, but built for a Polars workflow.

While Great Tables provides a rich and highly customizable system for building publication-quality tables, it comes with a more structured and declarative approach.

Polarise takes a different path:

  • Lightweight and fast
  • Fully aligned with Polars expressions
  • Designed for quick inspection and clean presentation

It started as a simple tool to explore Polars DataFrames visually, and grew into a practical way to produce clear, styled HTML tables for reports and sharing — with optional LaTeX export for simple use cases.

At a glance

Feature pandas Styler Great Tables Polarise
Ecosystem pandas Polars Polars
Philosophy Flexible, built-in Rich, declarative Lightweight, expressive
Best for General styling Publication workflows Inspection & quick presentation
Syntax pandas-based Table grammar Polars expressions
Complexity Medium High Low
Speed (iteration) Medium Slower Fast

License

This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.

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

polarise-1.1.0.tar.gz (83.6 kB view details)

Uploaded Source

Built Distribution

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

polarise-1.1.0-py3-none-any.whl (88.9 kB view details)

Uploaded Python 3

File details

Details for the file polarise-1.1.0.tar.gz.

File metadata

  • Download URL: polarise-1.1.0.tar.gz
  • Upload date:
  • Size: 83.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for polarise-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7f21b12883bcbd51cb0698b9fd51477b74e78e6e92d3b0cd34eeebccefae86d7
MD5 ce68f6265f66724bcf7680c28e6b49f0
BLAKE2b-256 c6a8e3f7ed24cc39d21515a019515a0b5a9e4f9c7d9835f42da01f61be4448b2

See more details on using hashes here.

File details

Details for the file polarise-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: polarise-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 88.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for polarise-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7786fe45f6862d51b34a2b8a0c014c0b35cc33134072d51654e1f93aacb75cc0
MD5 792d31265ed813472ff94a8bbe4a6c09
BLAKE2b-256 1ab46700cceca5d85ca3ecfe8b07ac9592f7f1e7b93c58b105488baaf46fca15

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