Expand description
A flyer’s own logger, read by a column mapping or a record layout stated in a JSON file: what
hpr analyze and the Python package take (ADR-276;
M7.1d2, your own logger from the command line and Python).
generic::read_with, records::read and capture::read read a log by a mapping or a
layout a program builds. This module reads the mapping or layout from the JSON file a person
writes, and the log’s bytes by it, so that the command line, Python and a Rust program read
one file into one record:
- A mapping file is a
Mappingas JSON: how a table’s columns are read, and which one is the primary track, if one is (Mapping::primary).header_mappinggives the one a table’s header states, to edit. Its schema isschema/cli/analyze-mapping.schema.json. - A layout file is a
Layout: each field of a record, its name stating its unit as a table’s header does, the byte order, and for a serial console’s capture, the block the records are in. Its schema isschema/cli/analyze-layout.schema.json. - A FIP header file is a
FipHeader: the header line a Featherweight Raven’s FIP export lost when it was pasted into a workbook below none, and the columns a table pasted over it covers (ADR-274), read byread_by_fip_header. Its schema isschema/cli/analyze-fip-header.schema.json.
Refusals. A file is refused naming the field it fails by its path in the JSON, such as
columns[2].unit, with its line and column, and a key the schema doesn’t name is refused
too, so that a misspelled one isn’t silently left out. A file is at most MAX_FILE_BYTES.
What the JSON can’t check, such as a unit that doesn’t measure its column’s quantity, the
reader refuses when it reads the log, naming the column.
A workbook. A mapping reads a table from an .xlsx workbook’s sheet, its cells as the
workbook stores them (workbook::sheets), when the caller names the sheet, from 0. A
workbook read with no sheet named is refused, its sheets listed, rather than one picked.
Structs§
- FipHeader
- A header stated for a Featherweight Raven’s FIP export that lost its own when it was pasted into a workbook below none (ADR-274): the export’s header line, and the columns a table pasted over the export covers.
- Layout
- A record layout as its file states it: the fields of a record, their byte order, and for a serial console’s capture, the block the records are in.
Constants§
- MAX_
FILE_ BYTES - The most bytes a mapping or a layout file may hold, 1 MiB:
generic::MAX_COLUMNScolumns or fields, each with a name of hundreds of characters, take a few tens of kilobytes.
Functions§
- fip_
header_ from_ json - Reads a FIP header file’s JSON.
- header_
mapping - What a table’s header states, as a mapping to edit, with a note on each column it leaves
kept as written, saying why (
generic::header_reading).sheetnames a spreadsheet’s workbook’s sheet,.xlsxor.xls, from 0;Nonefor a text file, or a workbook of one sheet. - json_
text - A mapping’s or a layout’s file as text: UTF-8, a byte-order mark dropped, or UTF-16 with its
byte-order mark, as Windows PowerShell 5.1 writes what
>sends to a file;Nonefor any other bytes, among them UTF-16 with no mark, whose zero bytes no JSON text holds. - layout_
from_ json - Reads a layout file’s JSON.
- mapping_
from_ json - Reads a mapping file’s JSON.
- read_
by_ fip_ header - Reads a Raven FIP export under the header stated for it (
raven::read_rows_around): the file as text, or the sheetsheetof a spreadsheet’s workbook, from 0, its cells as the workbook stores them; with no sheet chosen, a workbook’s one sheet. - read_
by_ layout - Reads binary records by a layout (
records::read), or a serial console’s capture of them, the block the layout names (capture::read). - read_
by_ mapping - Reads a table by a mapping, as
generic::read_withdoes: from a text file, or from the sheetsheet, from 0, of a spreadsheet’s workbook,.xlsxor.xls, or its one sheet.