Expand description
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.
Modules§
- audio
- WAV, BWF, RF64 and AIFF audio as a table of sample frames. The file is memory-mapped
and a chunk walker finds the format and samples; row
iis atdata_offset + i * frame_bytes, so any window decodes from its own bytes (a 20 GB recording reads a screenful). Every stated length is checked against the file before use, so a hostile header errors rather than panics or over-allocates. The row count comes from the file size, letting a still-recording file grow ([AudioSource::extend]): recorders write a placeholder data size until they stop. - candump
- CAN logs written by
candump, decoded with DBC files. - 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. - columns
- Rows built a row at a time into typed columns, handed over as a
DataFrame. - csv_
dialect - The parts of a CSV’s dialect that Polars’ reader does not have, named as the Frictionless Table Dialect names them.
- 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. - elf
- ELF files as their symbol table: what uses flash and RAM.
- excel
- Excel workbooks: the sheets of one, listed on the home screen and summed up on the Info panel.
- files
- A directory of one spec’s files,
{date}/{venue}/trades.bin: one table, the parts of each file’s path as columns. - fix
- FIX logs:
tag=valuemessages, SOH or|delimited, read into a table of one row per message. - fixed_
records - Fixed-width values read straight out of a memory map. A column is values
widthbytes wide,strideapart, fromstartinto a source;countside by side make an Array cell. Records (stride = record size) and one file per column (stride = width) share one strided decoder for format specs and NumPy;decodeis public for other packed readers (audio, CAN). Sources are kept for raw-byte viewers. Frames decode over a row index (crate::formats::row_index) on the streaming engine; an untouched view’s window reads viaFixedRecords::windowwithout an index. - framed_
records - Records not all one size, read from a memory map: length-prefixed records, variants picked by a type field, records found by a sync marker, records in compressed blocks or packet-capture payloads, and fixed records with fields read one at a time (varints, NUL-terminated text, counted groups, bit fields, deltas, checksums).
- gps
- GPS logs (NMEA 0183, GPX) as a table. Neither scans in place, so an open reads the
file once in pieces, writing rows a batch at a time to a temp Arrow IPC file (claimed
via the open’s
Writer) that the dataset scans lazily. A GPX extension field appearing late starts a new segment file with the wider schema, joined with nulls; NMEA is always one segment. Readers are incremental, so a growing log can be followed later. - hf_
splits - The splits of a Hugging Face
datasetsdirectory. - 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.
- ipc_
stream - Arrow IPC streams, the format Hugging Face
datasetscaches in: the IPC file format without theARROW1magic and footer, so Polars cannot scan it. An open converts the stream (or a directory’s stream shards) once into a temp IPC file and scans that; IPC files among the shards are scanned in place (Part). One record batch is held at a time: 0.2 GiB peak for a 3.0 GiB stream that read eagerly took 3.6 GiB. - journal
- The systemd journal as
journalctl -o jsonwrites it: NDJSON whose records carry__CURSORand__REALTIME_TIMESTAMP. - lines
- Text read as it stands: a row per line, in a
linecolumn. - members
- Files that hold several tables: a SQLite database’s tables and views, a NumPy archive’s arrays.
- midi
- Standard MIDI Files as a table of events. A hand-written parser (
MThd/MTrkchunks, variable-length deltas, running status, sysex, meta events) checks every stated length against the remaining bytes, so a hostile file errors rather than panics or over-allocates. Rows are a small eager frame made lazy; the header, track names and tempo range go to aMidiSummaryfor Info’s MIDI tab. - model_
files - SafeTensors and GGUF model files as a table of their tensors. Only the header is
read, so a 70 GB checkpoint opens like a 7 MB one. Both parsers are hand-written over
a bounded reader, checking every stated length before allocating or skipping, so a
hostile header errors rather than allocating gigabytes or panicking. Rows are a
small eager frame made lazy; metadata and totals go to a
ModelSummaryfor Info’s Model tab. - 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.
- numpy
- NumPy arrays:
.npyfiles, and.npzarchives of them. - 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.
- pushdown
- Sources that read a window of rows themselves, and sources that filter and sort.
- readers
- The readers: what datui does with a file of each format.
- 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.
- schema_
union - The schema of a dataset made of many files, which drift over time: every column any file has, from the footers the row count already reads, with one type per column:
- 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. - sqlite
- SQLite databases, read only.
- text_
formats - Text formats read into a table of their own: VCD value change dumps, FIX logs, SDF
compound files and the GPS logs of
crate::formats::gps; andDetail, every format’s tab of the Info panel. - ulog
- PX4 ULog flight logs (
.ulg). - 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.
Structs§
- Asked
- What a request for a format says, besides the path.
- BitField
- One bit field of an integer: its own column.
- Block
Index - Blocks listed in the file, so their headers are not walked.
- Blocks
- Records in blocks, each with a header and, often, compressed on its own.
- Capture
- A packet capture whose payloads hold the records.
- Checksum
- A checksum over part of each record, or of the file before its footer.
- Choice
- Where a spec was chosen from, carried to a decompressed copy’s read.
- DbcFound
- A DBC file found on the search path.
- Field
- One field of a header or a record.
- Files
- A directory of one spec’s files: each file’s path is read by
pattern. - FixFound
- A FIX dictionary found on the search path, and the copies of the same name it hides.
- Footer
- Fields at the end of the file.
- Found
- A spec found on the search path, and the copies of the same name it hides.
- Header
- A spec’s header: its fields, and its size when that is more than they take.
- Header
Values - A header, read: each named field’s value, and how many bytes the header takes; and the footer’s values, and the symbol lists fields index into.
- Lookup
- Where a symbol list is, for a field of indexes into it.
- Match
Chip - One condition of a spec’s
match, as home, Info anddatui formatsshow it (magic MKTD,version 1,glob *.bin *.dat). Chips must all hold, except that a file the glob names is not asked its magic; alternatives live inside one chip. - Matched
- The specs a file matches, by the first rule that matched any.
- Opened
- A file read through a spec: its columns, and what the read had to say.
- Path
Part - A part of a file’s path that becomes a column.
- Read
- A file read through a spec, as the open carries it to the dataset.
- Record
Type - One variant of a spec, as its documentation shows it.
- Records
- A spec’s records.
- Registry
- Every spec on the search path, first of each name first.
- Section
- A named run of the file that fields point into.
- Spec
- One format, as its spec describes it.
- Spec
Docs - What a spec says of its files, for the Documentation view: its own words and the notes its fields carry. None of it changes how a file is read.
- Spec
Error - A problem with a spec: where it is (file, line, column) and what was expected.
- Variant
- One layout a record can take, picked by the type field.
Enums§
- Amount
- A size or a count: written in the spec, or read from a field.
- Checksum
Algo - The checksums a spec can name.
- Chip
Kind - What a chip’s value is, for its color and whether plain text quotes it.
- Chosen
- How a spec was chosen for a file.
- Codec
- The codec of each block: one for all, or one a header field names.
- Compression
- How a block’s body is compressed.
- Delta
- A value stored as the change from the previous record’s.
- Encoding
- How text is stored.
- Endian
- Byte order.
- Expected
- A header value a file must hold to match:
match.where. - Framing
- How one record is told from the next.
- Layout
- How the records sit in what is opened.
- Lookup
Format - How a symbol list’s entries are told apart.
- Meaning
- What a field means beyond its stored value.
- Route
- What
routedecided about one local path. - Time
Unit Spec - The unit a
timefield counts in. - Type
- What a field’s bytes hold.
Constants§
- FORMAT_
ONLY - What a spec with no
matchsays in place of its conditions. - MAX_
FLATTEN - The most columns one field may be flattened into.
- MAX_
SIZE - The largest size a spec or a file may give one field, header or record, and the most values one field may hold. A size read from a file past this is refused rather than believed.
- MAX_
SPEC_ BYTES - The most a spec file may hold, local or remote: far more than any spec needs, and
a bound on what
--format FILEreads before it knows what it read. - MAX_
SPEC_ SAID MAX_SPEC_BYTES, as the user is told it.- PATH_
VAR - The variable the search path is extended with, after the config directory.
Traits§
- Spec
Records - The rows a spec reads, however they are framed: what the table, a window of it,
formats checkand the fuzz target read through.
Functions§
- all_
fields - Every field of the records: the common ones, then each variant’s.
- chips_
plain - Chips as one line of plain text, for the command line and the Info panel:
magic MKTD · version 1 · glob *.bin *.dat. - chosen_
words - Why
specread a file, for the Notes tab:matched by magic MKTD · version 1when its glob or its magic chose it,chosen by --format FILEotherwise. - command
datui formats, ordatui formats check SPEC [FILE]: what to print, and the exit code (non-zero when the check finds an error).- head_of
- The first
reachbytes ofpath, through its decompressor when it has one. - is_
spec_ name - What a spec name may be: namespaced, as
acme.l2feedis, so it cannot be taken for a built-in format. - path_
parts - The parts
{name}and{name:%Y%m%d}of a[files]path, in order. - read
- Read
pathwith the specchoiceholds, naming itnamedin what it says. - route
- Whether, and with which spec,
pathis read. In order:--format FILE, then--format NAME, then a glob, then magic. A file whose name or bytes say it is a format datui reads already keeps opening that way. - search_
path - The directories and files searched for specs, in order: the config directory’s
formats, then$DATUI_FORMATS_PATH, then[formats] pathfrom the config. - search_
path_ for - The search path
configasks for: the config directory’sformats, then$DATUI_FORMATS_PATH, then its[formats] path. - symbols
- The entries of a symbol list.