Skip to main content

Crate datui_lib

Crate datui_lib 

Source

Re-exports§

pub use app::applied::Applied;
pub use cache::CacheManager;
pub use config::AppConfig;
pub use config::ColorParser;
pub use config::ConfigManager;
pub use config::QueryMode;
pub use config::Theme;
pub use config::ThemeMode;
pub use config::rgb_to_256_color;
pub use config::rgb_to_basic_ansi;
pub use error_display::ErrorKindForPython;
pub use error_display::error_for_python;
pub use export::ExportOptions;
pub use export::ExportRequest;
pub use view::SavedView;
pub use view::ViewManager;
pub use view::Views;

Modules§

analysis
Analysis of the view: the sample every tool reads, statistics, distributions, value counts and Data Quality.
app
The app around the table: the event loop and the terminal, background jobs, the overlay and the dialogs it opens, and the keys of the screens without a directory of their own.
cache
canonical
canonicalize without Windows’ \\?\ prefix.
chart
The chart view: its spec and panel, preparing the data off the UI thread, and exporting the chart as SVG, PNG or PDF.
cli
Re-export CLI definitions from the shared datui-cli crate.
clipboard
The system clipboard, reached two ways, and the shapes a copy takes.
cloud
Data that is not in a local file: object stores and their logins, HTTP, downloads and local copies.
commands
datui cache, datui views and datui man: commands that open no data.
config
error_display
User-facing error messages, matched on types (PolarsError variants, io::ErrorKind) rather than strings.
exact
A stored value as text, exactly, apart from how the table previews it.
export
Writing the view to an export file. run takes the plan to a committed file: uncompressed CSV and Parquet stream through Polars’ sink into the OutputFile; everything else (compressed CSV, JSON, NDJSON, IPC, Avro, or no streaming engine) collects and encodes. The destination changes only at commit, after the last byte, encoder finish and flush succeed. Streaming bounds the export, not the plan: a sort, group-by or join still gathers its input first.
find
Find in the table: / (or f) asks for a pattern, n and N move between matching cells. While typing, matches among rows on hand light up and are counted (3 on screen) without reading; Ctrl+G keeps matching rows as a sidebar filter. The view (query, filters, sort, shown columns) is searched as is and never changed; only the cursor moves. Searches run as jobs reading a window at a time from the buffer outward, finding only the next match, so the total is known only as far as finds have walked.
formats
Binary formats described by specs: one TOML file per format, on a search path. A spec names its format (acme.l2feed), says which files match (glob, magic, header values), and lays out header and records. Specs are data (no expressions or code: fields refer to earlier ones by name), and every size read from a file is bounded. Decoding is crate::formats::fixed_records’ for fixed-size records and crate::formats::framed_records’ otherwise; files reads a directory of one spec’s files. This module turns a spec and a file into that reader’s columns.
glyphs
Terminal glyphs, with an ASCII fallback for terminals not doing UTF-8 (SSH, a C locale), where Unicode would render as replacement boxes.
home
The home screen: pick a dataset without first knowing where it is.
inspector
The row inspector: one row’s fields, a long value read a screen at a time, drilling into nested values, and handing a value to another program.
limits
The caps of [limits], read where a reader stops. Set once from the config at startup; the defaults until then.
loading
Opening a dataset, from the request to its first rows, and its one owner.
logging
The log file, and keeping stray stderr off the screen: while the TUI runs, fd 2 points at the log, Polars warnings go through log, and non-fatal errors (cache, history) land here.
notes
What datui noticed about a dataset while doing what it was already doing. A note never costs its own request or scan (all come from footers the schema and count needed), is never styled as an alarm, and states its basis, so “in 1 of 3 files” is never read as a claim about files not looked at. One claim per note, and one function (out_of) deciding the only ratio any note states.
numfmt
Display-time number formatting: digit grouping, decimal separator, optional fixed float precision. Display only: exports, queries, filters, views and group-by keys use raw values. Runs per visible cell per frame, so it allocates nothing beyond the caller’s String: integers are written digit by digit with inline separators, NumberFormat::width_i64 measures arithmetically, and per-column decisions resolve to a CellFormatter once per column per frame.
past_calendar
Polars operations that panic on a date or datetime past the calendar’s range (a sentinel like i64::MIN + 1 microseconds): a cast to text, dt.to_string, and the date parts that go through a calendar date (dt.date with a zone, dt.month_start, dt.truncate, …). Each panics for the whole column, even when one row holds such a value.
query
sanitize
Keeping untrusted text (cells, column names, filenames, parser errors) from becoming terminal commands: \x1b]52;c;...\x07 in a cell writes the clipboard, \x1b[2J wipes the screen. ratatui’s Buffer::set_stringn drops control graphemes, but Span and Line rendering append zero-width graphemes (ESC included) to the previous cell, and crossterm prints cells unfiltered. Rather than guard every Span site, one sweep runs at the end of App::render over the finished buffer.
table
typed_value
Typed text read as a column’s own type, so a filter or Data Quality partition stays a plain col op lit comparison (comparing as text fails for dates, or casts every row, blinding Parquet statistics and SQLite to the predicate).
view
widgets

Structs§

App
Args
Command-line arguments for datui.
ConfirmationModal
ErrorModal
ExitSweep
Dropped after the app, removes what the app’s opens were still writing. See the module.
ExportProgress
An export under way, for the footer.
Flash
A completion flash (the Feedback rules’ second rung): one plain sentence on the footer, cleared by the next keypress or after two seconds, whichever comes first. Every screen’s completions go here, the home screen’s included. The home screen’s own status line beside the filter is for what a key could not do and why, which has to survive until it is read.
KeptQualitySample
Rows a sampled Data Quality run read, and what decided which rows they were: its acquisition identity. A run or a drill that names the same rows cuts these instead of reading.
OpenOptions
ReadReport
What a directory read found about itself, filled by the pass that picks files and reader and carried back for the Notes: what datui did, not what the data is (the footer notes, written later, are that).
RetainedCopy
A local copy of a dataset’s remote objects, kept for later full scans of the dataset it was fetched for.
SqliteOpen
A SQLite table opened in place, carried from the scan to the dataset.
Ticket
One started operation. Issued when it starts, carried by its worker, and handed back with its outcome.
TypedDialect
Which CSV dialect options were typed on the command line. A delimited spec’s options replace config values but not these (#651).
UnaskedDownload
A remote file downloaded without asking: one the built-in catalog lists, at most limit bytes by what the server says or, when it says nothing, by the catalog.

Enums§

AppEvent
CompressionFormat
Compression format for data files
FileFormat
A format datui reads, as --format names it.
InputMode
The screen keys go to when no overlay is open (see Overlay).
InputType
JobKind
Which kind of operation a Ticket names.
Overlay
The dialog, panel or view over the table. The one place that says which is open: keys go to it, and it is drawn over the table.
ParseStringsTarget
Which CSV string columns to trim and parse (date/datetime/time/duration/int/float). Default: all. None = disabled (e.g. –infer-types=off).
Progress
A report from a job still running.
ReadMode
How an open reads a file. See FileFormat::read_mode.
RemoteRead
How a remote object is read.
RunInput
Input for the shared run loop.
Scroll
A move through the table’s rows.
Stored
How a file sits on disk, where that changes how it is read.
Summary
What the Info panel shows of a file of a format besides its Schema tab.
WhatEnter
What Enter will do on the highlighted row, for the footer and the details pane. A prediction of App::home_open_selected; test_the_bar_says_what_enter_will_really_do keeps the two in agreement.

Constants§

APP_NAME
Application name, used for cache and config paths.
QUALITY_MEMORY_BUDGET
Memory Data Quality keeps for the session: the rows its sampled runs read and the reports they made. Past it, reports that retained rows can remake go first, then the oldest rows, then the oldest other reports; the newest of each always stays.

Functions§

ended_by_signal
The exit status when a signal ended the session run returned from: 128 + n for SIGTERM, SIGHUP or SIGINT (as datui_cli::exit), and on Windows a closed console’s status.
run
Run the TUI with file paths or an existing LazyFrame: the one event loop for the CLI and the Python binding.
run_captured
As run, but a normal quit returns the active table’s final view (the Python binding’s capture=True); None with no dataset. See App::capture_view.

Type Aliases§

EventOutcome
What App::handle did: Ok carries a follow-up event; Err returns a key that arrived while busy, untouched, for the caller to offer again when idle.