# `PhoenixKitCatalogue.Import.Parser`
[🔗](https://github.com/BeamLabEU/phoenix_kit_catalogue/blob/0.1.14/lib/phoenix_kit_catalogue/import/parser.ex#L5)

Parses XLSX and CSV files into structured row data.

Returns a map with headers, rows, sheet names, and row count.
Uses no external dependencies beyond what phoenix_kit already provides:
- NimbleCSV for CSV (auto-detects separator)
- XlsxReader for XLSX

# `parsed_file`

```elixir
@type parsed_file() :: %{
  sheets: [String.t()],
  headers: [String.t()],
  rows: [[String.t()]],
  row_count: non_neg_integer()
}
```

# `detect_format`

```elixir
@spec detect_format(String.t()) :: :xlsx | :csv | {:error, :unsupported}
```

Detects file format from the filename extension.

# `list_sheets`

```elixir
@spec list_sheets(binary()) :: {:ok, [String.t()]} | {:error, term()}
```

Lists sheet names from an XLSX file.

# `parse`

```elixir
@spec parse(binary(), String.t(), keyword()) ::
  {:ok, parsed_file()} | {:error, term()}
```

Parses a file binary into structured data.

## Options

  * `:sheet` — sheet name to parse (XLSX only, defaults to first sheet)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
