# luxonis_parser

Python API: `luxonis_ml.data.parsers.luxonis_parser`

## Classes

### LuxonisParser

Detect a dataset format and dispatch to the matching parser.

The parser accepts local paths, remote paths supported by
[LuxonisFileSystem](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/utils/filesystem.md),
ZIP archives, and Roboflow dataset URLs in `roboflow://workspace/project/version/format` form. If `dataset_type` is omitted,
parsers are tried until one validates the dataset directory as either a full directory or a single split.

#### Methods

##### init

```python
def __init__(dataset_dir: str, *, dataset_name: str | None = None, save_dir: Path | str | None = None, dataset_plugin: T = None, dataset_type: DatasetType | None = None, task_name: str | dict[str, str] | None = None, full_warnings: bool = False, **kwargs):
```

High-level abstraction over various parsers.

Automatically recognizes the dataset format and uses the appropriate parser.

Parameters

 * `dataset_dir` (`str`): Dataset directory identifier. Can be one of: * Local path to the dataset directory.
    * * `Remote URL supported by L{LuxonisFileSystem}.`: * `gcs://` for Google Cloud Storage
          * `s3://` for Amazon S3
    * * `roboflow://` for Roboflow datasets.`: * Expected format: `roboflow://workspace/project/version/format`.
    * * `ultralytics://` for Ultralytics Platform datasets.`: * Expected format: `ultralytics://username/datasets/slug`
          * Optional version: append `?v=<version>` to export a specific dataset version.
 * `dataset_name` (`str | None`): Optional output dataset name. If omitted, the name is derived from `dataset_dir`.
 * `save_dir` (`Path | str | None`): Optional directory used when downloading remote datasets. If omitted, the current working
   directory is used.
 * `dataset_plugin` (`T`): Optional dataset plugin registry name. If omitted, `LuxonisDataset` is used.
 * `dataset_type` (`DatasetType | None`): Optional dataset type. If provided, automatic format recognition is skipped.
 * `task_name` (`str | dict[str, str] | None`): Optional task naming rule. A string is used for all records. A mapping uses class
   names as keys and task names as values.
 * `full_warnings` (`bool`): Whether all skipped annotation warnings should be logged without truncation.
 * `**kwargs`: Additional arguments passed to the selected dataset constructor.

Raises

 * `RuntimeError`: If a Roboflow URL is used and `ROBOFLOW_API_KEY` is not configured.
 * `ValueError`: If a Roboflow URL is malformed, its version is not an integer, or the dataset format cannot be recognized.

##### get_parser_issue_messages

```python
def get_parser_issue_messages(self) -> list[ParserIssueMessage]:
```

Return parser issue messages collected during the last parse.

##### parse

```python
def parse(**kwargs) -> BaseDataset:
```

Parse the dataset and return it in LDF format.

If the dataset already exists, parsing will be skipped and the existing dataset will be returned instead.

Parameters

 * `**kwargs`: Parser-specific arguments.

Returns

 * `BaseDataset`: Parsed dataset.

Raises

 * `ValueError`: If the selected parser rejects the dataset structure or split arguments.

### ParserType

Recognized parser entry-point type.

#### Attributes

##### DIR

Dataset directory with multiple splits.

##### SPLIT

Directory or file representing one parser input split.

## Attributes

### T
