Input Formats
minigate supports four input formats:
csvtsvargsvarlists
Each input row becomes one minigate pipeline instance.
Choosing a Format
Use:
argswhen each pipeline is driven directly by a positional command-line value
csvwhen you want ordinary CSV parsing, including quoted fields
tsvwhen your data is tab-separated and may contain spaces inside fields
varlistswhen row widths vary and the tail of each row is naturally a variable list
format args
format args is the simplest mode.
Each positional argument becomes one row with a single named column:
arg
Example:
minigate -f docs/source/minigate/examples/quickstart_args.pipeline alpha.txt beta.txt
Inside the pipeline file:
{arg}is validheader,codepage, anddelimiterare invalid
This format is usually the best starting point for shell-oriented batch use.
format csv
format csv reads each positional input as a CSV file using Python’s standard
CSV handling.
Example:
format csv
header true
codepage "utf-8-sig"
Behavior:
quoted CSV fields are supported
header truemakes the first row available by column nameheader falsemeans direct column access must use{#N}duplicate headers emit a warning and the rightmost matching column wins
empty files and header-only files produce zero pipelines
delimiter is invalid for csv.
format tsv
format tsv is the tab-separated counterpart to csv.
Example:
format tsv
header true
codepage "utf-8-sig"
Behavior:
fields are separated by tabs
spaces inside a field are preserved
header trueandheader falsefollow the same rules ascsvduplicate headers warn and resolve to the rightmost column
empty files and header-only files produce zero pipelines
delimiter is invalid for tsv.
format varlists
format varlists is intended for ragged rows where the number of fields may
change from row to row.
Example:
format varlists
delimiter whitespace
Typical use case:
cat cat1.jpg cat2.jpg cat3.jpg
dog dog1.jpg dog2.jpg
Key behavior:
row widths may vary
direct column access is
{#N}onlynamed columns are not available
COLUMN("...")is invalidblank lines are ignored
lines beginning with
#are plain data, not commentsempty files produce zero pipelines
This format is what enables patterns such as:
[list]
target_images {#2}, ...
varlists Delimiters
format varlists requires a delimiter statement.
delimiter whitespace
format varlists
delimiter whitespace
Rules:
one or more
U+0020spaces orU+0009tabs form one delimiterleading and trailing spaces/tabs are ignored
no empty fields are created
delimiter behavior is independent of
codepage
delimiter comma
format varlists
delimiter comma
Rules:
the delimiter is
U+002Ccommaspaces and tabs around each comma-separated field are trimmed
empty fields are invalid
leading commas, trailing commas, and repeated commas cause runtime row errors
delimiter behavior is independent of
codepage
Unlike csv, this mode does not support quoted fields.
Header Handling
Header behavior depends on format:
argsno header setting exists
the only named column is
arg
csv/tsvheader trueorheader false
varlistsheader trueis invalidheader falsemay be written explicitly, but is also the default
If header false is in effect, named references such as {sample} are not
valid. Use {#N} instead.
Codepages
codepage "..." applies to:
csvtsvvarlists
It is invalid for:
args
The default is:
codepage "utf-8-sig"
For varlists, codepage affects file decoding only. It does not change what
counts as a delimiter.
Reading from Standard Input
For file-based formats, a positional input of - means standard input.
Examples:
cat samples.tsv | minigate -f pipeline.pipeline -
printf 'cat a.jpg b.jpg\n' | minigate -f docs/source/minigate/examples/varlists.pipeline -
args is different:
its positional inputs are already the data rows
-is just another argument value there unless you choose to interpret it in your own commands
Warnings and Errors by Format
Common cases:
duplicate header in
csv/tsvwarning
column-name reference under
header falsestatic validation error
out-of-range
{#N}on a specific rowruntime row error
empty comma field in
varlistsruntime row error