Skip to main content

View Polars LazyFrames and DataFrames in the terminal with datui

Project description

datui Python package

View Polars LazyFrames or DataFrames in the terminal with the datui TUI. The package provides datui.view(lf) / datui.view(df) and the datui CLI command (when the bundled binary is present or datui is on PATH). Data is passed via LazyFrame.serialize(format="json") for compatibility across Polars versions. Binary serialization is only used as a fallback when JSON is not available.

Install

From PyPI (stable):

pip install datui "polars>=0.20"

From the repo (development):

From the python/ directory, with a venv activated:

# Requires maturin: pip install maturin
cd python && maturin develop
pip install "polars>=0.20"

Usage

View a LazyFrame or DataFrame in the TUI:

import polars as pl
import datui

# From a LazyFrame (e.g. scan)
lf = pl.scan_csv("data.csv")
datui.view(lf)

# From a DataFrame (converted to LazyFrame internally)
df = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
datui.view(df)

Press q to exit the TUI and return to Python.

Run the CLI from Python (e.g. datui file.csv):

If you installed via pip, the datui command is available and runs the bundled CLI. From a development install, it uses the datui binary on your PATH (e.g. from cargo build at the repo root).

Options (for datui.view)

  • debug=False: Enable debug overlay.
  • row_numbers=False: Show row numbers in the table.

Configuration (theme, etc.) uses the same config as the CLI: ~/.config/datui/config.toml.

Low-level API

  • datui.view_from_json(json_str, *, debug=False, row_numbers=False) accepts a JSON string from LazyFrame.serialize(format="json"). This is the path used by view() and works across Polars versions.
  • datui.view_from_bytes(data, *, debug=False, row_numbers=False) accepts bytes from LazyFrame.serialize() (binary). Use only when you already have binary data; format compatibility with the extension is not guaranteed across Polars versions.

Run tests

From the repo root (with the package installed, e.g. after cd python && maturin develop):

pytest python/tests/ -v

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

datui-0.2.21-cp314-cp314-manylinux_2_39_x86_64.whl (52.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

File details

Details for the file datui-0.2.21-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for datui-0.2.21-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a9fdfa9169be0b20119d9300a3b0de262f4eb9e965ed529033edc6a0645412cb
MD5 f36e3569a845dd901b39b1a263e23e76
BLAKE2b-256 8e713dc9f57c94e7414170874508b1cc1af2fdb7853a683f3507526744930b5c

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