Module
pixano.cli.data
Pixano data import/export CLI (spec §9) — a thin shell over the shared io core.
Functions
def
export_command
(data_dir, dataset, destination, format, media, include_record_field)
→ None Export a dataset from the library (JSONL v2 output re-imports identically).
| Parameter | Type | Default |
|---|---|---|
data_dir | Path | typer.Argument(..., exists=True, file_okay=False, help='Pixano data directory.') |
dataset | str | typer.Argument(..., help='Dataset name or id in the library.') |
destination | Path | typer.Argument(..., help='Destination directory.') |
format | str | typer.Option('pixano_jsonl', '--format', help='Export format.') |
media | str | typer.Option('files', '--media', help='files (dump embedded bytes) or uris (write URIs verbatim).') |
include_record_field | list[str] | typer.Option([], '--include-record-field', help='Include a Record base field in exported JSONL attrs (repeatable). Choices: status, created_at, updated_at, comment.') |
def
fix_creation_dates
(data_dir)
→ None Fill empty ``creation_date`` fields of all datasets by using their oldest record timestamp.
| Parameter | Type | Default |
|---|---|---|
data_dir | Path | typer.Argument(..., exists=True, file_okay=False, help='Path to data directory.') |
def
formats_command
()
→ None List the registered data formats.
def
import_command
(data_dir, source, format, spec_file, name, workspace, mode, media, namespace, episodes, max_frames, dry_run, yes, importer_spec, info_py)
→ None Import a dataset: analyze, confirm the plan, then ingest atomically.
| Parameter | Type | Default |
|---|---|---|
data_dir | Path | typer.Argument(..., exists=True, file_okay=False, help='Pixano data directory.') |
source | str | typer.Argument(..., help='Source directory, or a Hugging Face dataset id (org/name).') |
format | str | typer.Option('auto', '--format', help='Data format (auto = detect).') |
spec_file | Optional[Path] | typer.Option(None, '--spec', exists=True, dir_okay=False, help='dataset.yaml import spec (default: <source>/dataset.yaml).') |
name | str | typer.Option('', '--name', help='Target dataset name (overrides the spec).') |
workspace | str | typer.Option('', '--workspace', help='Workspace preset (image, video, image_vqa, ...).') |
mode | str | typer.Option('create', '--mode', help='create, overwrite, or add.') |
media | Optional[str] | typer.Option(None, '--media', help='Media storage: embed (default) or uri.') |
namespace | Optional[str] | typer.Option(None, '--namespace', help='Id namespace (default: source identity).') |
episodes | Optional[str] | typer.Option(None, '--episodes', help="LeRobot: episode subset, e.g. '0:4' or '1,3'.") |
max_frames | Optional[int] | typer.Option(None, '--max-frames', help='LeRobot: cap extracted frames per episode (uniform stride).') |
dry_run | bool | typer.Option(False, '--dry-run', help='Analyze and print the plan without importing.') |
yes | bool | typer.Option(False, '--yes', '-y', help='Skip the plan confirmation prompt.') |
importer_spec | Optional[str] | typer.Option(None, '--importer', help="Advanced: custom importer as 'path/to/file.py:ClassName'.") |
info_py | Optional[str] | typer.Option(None, '--info-py', help="Advanced: DatasetInfo as 'path/to/file.py:attribute'.") |
def
jobs_command
(data_dir, action, job_id)
→ None Inspect the shared import/export job store (the same one the GUI polls).
| Parameter | Type | Default |
|---|---|---|
data_dir | Path | typer.Argument(..., exists=True, file_okay=False, help='Pixano data directory.') |
action | str | typer.Argument('list', help='list, show, cancel, resume, or rollback.') |
job_id | str | typer.Argument('', help='Job id (for show/cancel).') |
def
optimize_dataset
(data_dir, dataset)
→ None Index the standard filter columns and compact a dataset (fast filtered pagination).
| Parameter | Type | Default |
|---|---|---|
data_dir | Path | typer.Argument(..., help='Pixano data directory.') |
dataset | str | typer.Argument(..., help='Dataset name (library folder name).') |