# {py:mod}`haniwers.v1.cli.preprocess`

```{py:module} haniwers.v1.cli.preprocess
```

```{autodoc2-docstring} haniwers.v1.cli.preprocess
:allowtitles:
```

## Module Contents

### Functions

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`_validate_input_directory <haniwers.v1.cli.preprocess._validate_input_directory>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess._validate_input_directory
    :summary:
    ```
* - {py:obj}`_discover_files <haniwers.v1.cli.preprocess._discover_files>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess._discover_files
    :summary:
    ```
* - {py:obj}`_validate_runs_csv <haniwers.v1.cli.preprocess._validate_runs_csv>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess._validate_runs_csv
    :summary:
    ```
* - {py:obj}`_get_run_info <haniwers.v1.cli.preprocess._get_run_info>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess._get_run_info
    :summary:
    ```
* - {py:obj}`raw2csv <haniwers.v1.cli.preprocess.raw2csv>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess.raw2csv
    :summary:
    ```
* - {py:obj}`raw2tmp <haniwers.v1.cli.preprocess.raw2tmp>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess.raw2tmp
    :summary:
    ```
* - {py:obj}`run2csv <haniwers.v1.cli.preprocess.run2csv>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess.run2csv
    :summary:
    ```
````

### Data

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`app <haniwers.v1.cli.preprocess.app>`
  - ```{autodoc2-docstring} haniwers.v1.cli.preprocess.app
    :summary:
    ```
````

### API

````{py:data} app
:canonical: haniwers.v1.cli.preprocess.app
:value: >
   'Typer(...)'

```{autodoc2-docstring} haniwers.v1.cli.preprocess.app
```

````

````{py:function} _validate_input_directory(read_from: str) -> pathlib.Path
:canonical: haniwers.v1.cli.preprocess._validate_input_directory

```{autodoc2-docstring} haniwers.v1.cli.preprocess._validate_input_directory
```
````

````{py:function} _discover_files(input_dir: pathlib.Path, pattern: str, verbose: bool = False) -> list[pathlib.Path]
:canonical: haniwers.v1.cli.preprocess._discover_files

```{autodoc2-docstring} haniwers.v1.cli.preprocess._discover_files
```
````

````{py:function} _validate_runs_csv(runs_csv_path: str) -> pathlib.Path
:canonical: haniwers.v1.cli.preprocess._validate_runs_csv

```{autodoc2-docstring} haniwers.v1.cli.preprocess._validate_runs_csv
```
````

````{py:function} _get_run_info(runs_csv_path: pathlib.Path, run_id: str, workspace: str) -> dict
:canonical: haniwers.v1.cli.preprocess._get_run_info

```{autodoc2-docstring} haniwers.v1.cli.preprocess._get_run_info
```
````

````{py:function} raw2csv(read_from: str = typer.Argument(..., help='Directory containing raw CSV files from detector'), save: bool = typer.Option(False, '--save', help='Save processed data to files'), interval: int = PreprocessOptions.interval, offset: int = PreprocessOptions.offset, tz: str = typer.Option('UTC+09:00', '--tz', help='Timezone string for timestamp parsing (e.g., UTC+09:00, Asia/Tokyo)', rich_help_panel='Processing Options'), pattern: str = typer.Option('*data*.csv', '--pattern', help='Glob pattern for matching input files', rich_help_panel='Processing Options'), verbose: bool = LoggerOptions.verbose) -> None
:canonical: haniwers.v1.cli.preprocess.raw2csv

```{autodoc2-docstring} haniwers.v1.cli.preprocess.raw2csv
```
````

````{py:function} raw2tmp(read_from: str = typer.Argument(..., help='Directory containing raw CSV files'), interval: int = PreprocessOptions.interval, pattern: str = typer.Option('*data*.csv', '--pattern', help='Glob pattern for matching input files', rich_help_panel='Processing Options')) -> None
:canonical: haniwers.v1.cli.preprocess.raw2tmp

```{autodoc2-docstring} haniwers.v1.cli.preprocess.raw2tmp
```
````

````{py:function} run2csv(run_id: str = typer.Argument(..., help='Run ID from runs.csv'), load_from: str = typer.Option('runs.csv', '--load_from', help='Path to runs.csv configuration exported from Google Sheets', rich_help_panel='Input Options'), workspace: str = typer.Option('.', '--workspace', help='Base workspace directory (root for relative paths in runs.csv)', rich_help_panel='Input Options'), preprocessed: str = typer.Option('.', '--preprocessed', help='Directory to save preprocessed (processed.csv.gz) files', rich_help_panel='Output Options'), resampled: str = typer.Option('.', '--resampled', help='Directory to save resampled (resampled.csv) files', rich_help_panel='Output Options'), save: bool = typer.Option(False, '--save', help='Save processed data to files'), interval: int = PreprocessOptions.interval, offset: int = PreprocessOptions.offset, tz: str = typer.Option('UTC+09:00', '--tz', help='Timezone string for timestamp parsing (e.g., UTC+09:00, Asia/Tokyo)', rich_help_panel='Processing Options'), verbose: bool = LoggerOptions.verbose) -> None
:canonical: haniwers.v1.cli.preprocess.run2csv

```{autodoc2-docstring} haniwers.v1.cli.preprocess.run2csv
```
````
