trailpack.cli ============= .. py:module:: trailpack.cli .. autoapi-nested-parse:: Command-line interface for Trailpack. Provides commands for data processing, validation, and project management. Attributes ---------- .. autoapisummary:: trailpack.cli.app trailpack.cli.console Functions --------- .. autoapisummary:: trailpack.cli.check trailpack.cli.init trailpack.cli.main trailpack.cli.process trailpack.cli.ui trailpack.cli.validate trailpack.cli.version_callback Module Contents --------------- .. py:function:: check(parquet_file: pathlib.Path = typer.Argument(..., help='Path to Parquet file to check')) Check existing Parquet file for standard compliance. Reads the Parquet file, extracts metadata, validates against Trailpack standard, and displays quality level. .. rubric:: Example trailpack check my-dataset.parquet .. py:function:: init(project_name: str = typer.Argument(..., help='Name of the project to initialize'), directory: Optional[pathlib.Path] = typer.Option(None, '--dir', '-d', help='Directory to create project in (default: current)')) Initialize a new Trailpack project structure. Creates a directory with example configs, data folder, and README with instructions. .. rubric:: Example trailpack init my-dataset trailpack init my-dataset --dir ~/projects .. py:function:: main(version: bool = typer.Option(None, '--version', '-v', callback=version_callback, is_eager=True, help='Show version and exit')) Trailpack - Dataset standardization tool. Interactive UI for mapping data to ontologies and creating Frictionless Data Packages for LCA and sustainability research. .. py:function:: process(data: pathlib.Path = typer.Option(..., '--data', '-d', help='Path to data file (Excel, CSV)'), sheet: str = typer.Option(None, '--sheet', '-s', help='Sheet name (for Excel files)'), mapping: pathlib.Path = typer.Option(..., '--mapping', '-m', help='Path to mapping config JSON'), metadata: pathlib.Path = typer.Option(..., '--metadata', '-M', help='Path to metadata config JSON'), output: pathlib.Path = typer.Option(..., '--output', '-o', help='Output Parquet file path'), validate_standard: bool = typer.Option(True, '--validate/--no-validate', help='Validate against Trailpack standard')) Process data file with configs to create a Frictionless Data Package. Reads data, applies column mappings, validates against standard, and exports to Parquet format with embedded metadata. .. rubric:: Example trailpack process \ --data inventory.xlsx \ --sheet "Sheet1" \ --mapping mapping.json \ --metadata metadata.json \ --output clean-data.parquet .. py:function:: ui(port: int = typer.Option(8501, '--port', '-p', help='Port to run Streamlit on'), host: str = typer.Option('localhost', '--host', help='Host to bind to')) Launch the Streamlit UI for interactive data mapping. Opens a browser at localhost:8501 with the full interactive interface for mapping columns to ontologies and exporting data packages. .. rubric:: Example trailpack ui trailpack ui --port 8080 .. py:function:: validate(data: pathlib.Path = typer.Option(..., '--data', '-d', help='Path to data file (Excel, CSV)'), sheet: str = typer.Option(None, '--sheet', '-s', help='Sheet name (for Excel files)'), mapping: pathlib.Path = typer.Option(..., '--mapping', '-m', help='Path to mapping config JSON'), metadata: pathlib.Path = typer.Option(..., '--metadata', '-M', help='Path to metadata config JSON')) Validate data and configs without creating output (dry-run). Checks data quality, type consistency, and standard compliance without writing any files. .. rubric:: Example trailpack validate \ --data inventory.xlsx \ --mapping mapping.json \ --metadata metadata.json .. py:function:: version_callback(value: bool) Print version and exit. .. py:data:: app .. py:data:: console