Skip to main content

Crate datui_lib

Crate datui_lib 

Source

Re-exports§

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_modal
audio
WAV, BWF, RF64 and AIFF audio, read as a table of sample frames.
avro_types
Columns cast to types Polars’ Avro writer can hold, for an Avro export only.
aws_profiles
AWS profiles, read from the files the AWS CLI and SDKs share.
azure
Azure Blob Storage: logins, finding storage accounts, and listing what is in them.
cache
candump
CAN logs written by candump, decoded with DBC files.
canonical
canonicalize without Windows’ \\?\ prefix.
catalog
Catalogs: named datasets, local or remote, one TOML file each.
chart_data
Prepare chart data from a LazyFrame: read the chart’s columns, then turn them into points, bins or statistics.
chart_export
Chart export: the chart is drawn once as SVG, in the bundled font (IBM Plex Sans, under the SIL Open Font License, in assets/fonts), then written as SVG with its text as outlines, rasterized to PNG, or written as PDF from the same outlines (chart_pdf). The same figure comes out the same on every machine; text the bundled font lacks falls back to a system font.
chart_export_modal
Chart export dialog: where, in what format, style and size, with what legend, and the words around the chart. Its keys are the shared form keys (crate::form).
chart_modal
Chart view state: the chart’s spec and the panel that edits it.
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_browse
Finding the object stores this machine can already read, and listing what is in them.
cloud_command
Running the commands other tools provide for credentials: aws, a profile’s credential_process, and later gcloud and az.
cloud_env
Cloud variables from [cloud] env_files, beside the real environment.
cloud_sources
Every object store datui can read, as a list of sources rather than one of each kind.
codebook
A catalog dataset’s documentation: what its columns mean, in their publisher’s words.
column_types
A column’s declared type: one vocabulary for the type row, a delimited spec’s [columns], the typing of text columns, and a column retyped in the table.
commands
datui cache, datui views and datui man: commands that open no data.
config
config_command
datui config: write the default file, list the files read, list every key.
context_menu
The menu a right click on a table cell opens: the keys that act on a cell, each line naming its key. A line chosen closes the menu and presses its key, so the menu does exactly what typing the key does. A menu is not a dialog: a click anywhere else closes it.
copy_modal
Copy dialog state: scope × format, a column for the cell scope, and the header toggle, with the last choices kept for the session so a repeat copy is y Enter. The Python scope copies the view’s pipeline as code rather than its rows.
csv_dialect
The parts of a CSV’s dialect that Polars’ reader does not have, named as the Frictionless Table Dialect names them.
data_quality
dataflash
ArduPilot DataFlash logs (.bin).
dbc
DBC files: what the frames of a CAN bus mean.
delimited_spec
Format specs of kind = "delimited": the reading options for a family of CSV-like files, with header rows that have roles (names, units), a metadata line, and a few derived columns.
discover
Dataset discovery for the home screen.
distribution_fit
Fitting a column’s values to each candidate distribution, and testing each fit.
download
Remote files downloaded to local ones, and standard input spooled to one.
elf
ELF files as their symbol table: what uses flash and RAM.
error_display
User-facing error message formatting.
event_pump
The main loop, minus the terminal.
exact
A stored value as text, exactly, apart from how the table previews it.
excel
Excel workbooks: the sheets of one, listed on the home screen and summed up on the Info panel.
export
Writing the view to an export file.
export_modal
Export modal state and focus management.
external_open
A value handed to another program: the inspector’s o.
filter_modal
The Filters tab: one row per statement, and a three-step inline editor — column via Picker, operator via a short Picker, value as text.
find
Find in the table: / (or f) asks for a pattern, n and N move between the cells that hold it.
fix
FIX logs: tag=value messages, SOH or | delimited, read into a table of one row per message.
fixed_records
Fixed-width values read straight out of a memory map.
follow
Following a file that is still being written, as tail -f does: --follow and t at the table.
form
One focus convention for every form and dialog.
formats
Binary formats described by specs: one TOML file per format, found on a search path.
framed_records
Records that are not all one size, read from a memory map: length-prefixed records, variants a type field picks, records found by a sync marker, records in compressed blocks or in the payloads of a packet capture, and fixed records with fields that are read one at a time (varints, NUL-terminated text, counted groups, bit fields, deltas, checksums).
fuzzy
Fuzzy matching, scored the way fzf scores it.
gcloud
Google Cloud logins through gcloud, and the projects a login can see.
glyphs
Terminal glyphs, with an ASCII fallback.
gps
GPS logs: NMEA 0183 and GPX, read into a table.
help
The help overlay: one screen’s keys from the key registry (datui_cli::keys), grouped by task, the keys of every screen last.
hex_view
The hex view: any local file as its bytes, a row of them at a time.
hf_splits
The splits of a Hugging Face datasets directory.
home
The home screen: datui’s answer to “I want to look at my data”, before you have had to answer “where is it, exactly”.
home_preview
The home screen’s ROWS preview: the first rows of the selected file, read the way the open reads them and handed to the open as its first page (#547 M4).
indexed
Tables of records an index found: the messages of one type in a flight log, the frames of one CAN message in a candump.
inspector_bytes
What a binary value holds, told from its first bytes, and the text in it where that is cheap to get: UTF-8 stored as bytes, or gzip and zstd of text. Nothing here runs or renders what it finds; decompression stops at DECODE_MAX bytes of output, whatever the input claims.
inspector_drill
Drilling into a nested value from the row inspector: a struct’s fields, a list’s items, or the objects and arrays of JSON stored as text.
inspector_modal
Row inspector state: which field is focused and which are listed, where the focus is (the list or the value), the find text, the value’s view and where it is read to, the row compared with, and the fields read for this row that the table’s rows do not hold.
inspector_reader
The inspector’s value reader: a long value read a screen at a time.
intent_modal
The form Data Quality Setup opens on one column to declare what it must hold: part of the key, required, read as a number, an allowed set, a range. It stages into Setup’s draft, which only Run reads with.
ipc_stream
Arrow IPC streams: the format Hugging Face datasets writes its cache in.
journal
The systemd journal as journalctl -o json writes it: NDJSON whose records carry __CURSOR and __REALTIME_TIMESTAMP.
lines
Text read as it stands: a row per line, in a line column.
link_open
A documentation link handed to the system’s browser: o in the Documentation view.
local_copy
A local copy of a remote dataset’s objects, for Data Quality’s full scan.
locality
Where a dataset physically lives, and what that implies about opening it.
logging
The log file, and keeping stray stderr off the screen.
measurements
What opening a dataset cost, measured rather than guessed.
members
Files that hold several tables: a SQLite database’s tables and views, a NumPy archive’s arrays.
midi
Standard MIDI Files, read as a table of their events.
model_files
SafeTensors and GGUF model files, read as a table of their tensors.
nested_json
List, array and struct cells as JSON text, for the destinations that hold one value per field: a CSV export and every clipboard copy. JSON rather than the table’s own rendering ([1, 2], {1,"a"}) because it keeps struct field names and reads back with any JSON parser, Polars’ str.json_decode included.
notes
What datui noticed about a dataset while doing what it was already doing.
nul_tail
A text file that ends in a run of NUL bytes ends where the run starts. Loggers that preallocate a file at a fixed size and never write past their last line leave the rest as NULs, which a CSV reader would take as one last row of junk text.
numfmt
Display-time number formatting: digit grouping (thousands separators), decimal separator choice, and optional fixed float precision.
numpy
NumPy arrays: .npy files, and .npz archives of them.
output_file
A file written whole or not at all.
parquet_footer
What a Parquet file’s footer says besides its rows: its row groups, each column’s compression and statistics, and who wrote it.
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.
pivot_melt_modal
Pivot & Melt builder state: a form of rows, each edited through one Picker scoped to that row alone, and the live preview of the spec it stages. The spec is echoed live; Enter applies it.
pointer
The mouse: what a click, a drag or a turn of the wheel means where it lands.
pushdown
Sources that read a window of rows themselves, and sources that filter and sort.
python_script
Copy as Python: the view as a Python Polars script.
quality_export
A Data Quality report written to a file: the measurements on screen, the setup they were measured with, and the source they were measured on. Built from the results in memory; writing one reads nothing from the data.
quality_intent
Declared column intent for Data Quality: what a column must hold, said by the user, measured on the rows a run reads anyway.
quality_report
Data Quality results read as a report: what is likely wrong, what depends on intent, and which columns have nothing to report.
quality_trends
Trends and gaps: a report’s segments in order, pooled into the bars a terminal has room for, and the time windows a study said to expect checked against the segments a run counted. Built from the measurements a run kept: nothing here reads.
query
retype_modal
A column’s type changed in the table, and a datetime made from columns: the same names, formats and rules a delimited spec’s [columns] takes (crate::column_types), as a view step before the filters.
row_index
Lazy frames decoded over a row index, for readers whose rows sit at places worked out from the row number: audio frames, fixed records, and the like.
s3_tools
S3-compatible servers other tools already know about: the MinIO client’s aliases, MC_HOST_<alias>, and s3cmd’s config.
sample_modal
The Sample form: the one place an analysis’s rows are chosen, for every tool. It edits a copy of the shared Sample; Enter applies it, Esc discards it.
sampling
The one sampler every analysis tool reads through: which rows (a scope), how they are picked (a method), how many, and the seed. Describe, Distribution, Correlation and Data Quality all take their rows from read, so a sample means the same thing whichever tool shows it.
sanitize
Keeping untrusted text from becoming terminal commands.
schema_union
The schema of a dataset made of many files.
sdf
SDF (structure-data format) compound files, read into a table: one row per record, with the molecule’s name, its atom and bond counts, and every data item (> <FIELD>) as a column.
search
Recursive search for datasets below a directory.
sort_filter_modal
The Sort & Filter sidebar: what is in effect first — the sorts and the filters, each a row to flip, edit, reorder or remove, and a row to add one — and the Columns tab beside it, every per-column property in one list. One form (crate::form): the tab bar is its first field, and every entry is a field.
sort_modal
source
Input source detection for local paths vs remote URLs (S3, GCS, HTTP/HTTPS).
sql_group
What a SQL GROUP BY result was grouped from, read from the statement itself, so Enter on a row of the result can show the rows behind it.
sqlite
SQLite databases, read only.
startup
What run reads before it can build the app, read behind the first frame.
statistics
stdin
Data piped in: cmd | datui and datui -.
table_sample
The sample as a step of the view: drawn into memory a chunk at a time, while the table shows the rows kept so far.
table_switch
T at the table: the other tables of the source on screen, to open one in its place. Listed from what the open already holds (a workbook’s or a database’s tab of the Info panel, a spec’s record types, a cache’s splits), so nothing is read to list them; opening one is an open of the file with --table, as home’s row for it is.
tee
--tee FILE: standard input recorded to a file the user keeps, while it is viewed.
terminal_input
The one reader of the terminal.
text_formats
Text formats read into a table of their own: VCD value change dumps, FIX logs and SDF compound files, beside the GPS logs of crate::gps.
themes
Named themes: the two built in, and every *.toml in the config directory’s themes/, each a set of theme.colors slots named by its file. theme.dark and theme.light pick one per mode; theme.colors lies over whichever is in use.
typed_value
Text typed as a value for a column, read as the column’s own type.
ulog
PX4 ULog flight logs (.ulg).
user_agent
The User-Agent header on every request datui makes: ureq’s, and the object stores’ (ours and the ones Polars builds for a scan).
value_counts
Value counts: how many rows of the view hold each value of one column, and a summary of the column, from one read of that column.
value_counts_modal
State of the Value Counts screen: which column, the counts read for the view, the order, the cursor, and the count in flight.
vcd
VCD (value change dump) files from HDL simulators and logic analyzers, read into a long table: one row per value change of each signal.
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 control bar: the file, its phase, and the bytes written once writing has started.
Flash
A completion flash (the Feedback rules’ second rung): one plain sentence on the control bar, 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 read of a directory found out about itself on the way through.
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
Re-export compression format and file format from CLI module Compression format for data files
FileFormat
Re-export compression format and file format from CLI module A format datui reads, as --format names it.
InputMode
InputType
JobKind
Which kind of operation a Ticket names.
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
Re-export compression format and file format from CLI module How an open reads a file. See FileFormat::read_mode.
RemoteRead
Re-export compression format and file format from CLI module How a remote object is read.
RunInput
Input for the shared run loop: open from file paths or from an existing LazyFrame (e.g. Python binding).
Stored
Re-export compression format and file format from CLI module How a file sits on disk, where that changes how it is read.
Summary
Re-export compression format and file format from CLI module What the Info panel shows of a file of a format besides its Schema tab.
WhatEnter
What Enter will do on the highlighted row.

Constants§

APP_NAME
Application name used for cache directory and other app-specific 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 for the binary when a signal ended the session run returned from: 128 + n for SIGTERM, SIGHUP or SIGINT, as if it had not been caught (the statuses of datui_cli::exit), and on Windows the status a console process closed by its window ends with.
run
Run the TUI with either file paths or an existing LazyFrame. Single event loop used by the CLI and the Python binding.
run_captured
As run, but a normal quit hands back the active table’s final view for the caller to keep working with (the Python binding’s capture=True). None when no dataset was open at quit. See App::capture_view for what is refused and why.

Type Aliases§

EventOutcome
What App::handle did with an event: Ok carries the follow-up event to send, if any; Err returns a key that arrived while the app was busy. Nothing was done with that key and it was not dropped: the caller keeps it and offers it again once the app is idle.