# lawref.a3_io

*module*

Safe import/export adapters for A3 decision tables.

These adapters do not decide anything.  They only translate DMN/CSV/XLSX into
the canonical ``law.decision/0.1`` JSON surface and then hand it to ``a3``.
Spreadsheet formulas are rejected before any cell value is inspected.

## lawref.a3_io.DMN_NS

*attribute* · *module attribute*

```python
DMN_NS = 'https://www.omg.org/spec/DMN/20230324/MODEL/'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L23-L23)

## lawref.a3_io.LAW_NS

*attribute* · *module attribute*

```python
LAW_NS = 'urn:law-dsl:a3:dmn:0.1'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L24-L24)

## lawref.a3_io.PKG_REL_NS

*attribute* · *module attribute*

```python
PKG_REL_NS = 'http://schemas.openxmlformats.org/package/2006/relationships'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L26-L26)

## lawref.a3_io.REL_NS

*attribute* · *module attribute*

```python
REL_NS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L25-L25)

## lawref.a3_io.SHEET_NS

*attribute* · *module attribute*

```python
SHEET_NS = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L27-L27)

## lawref.a3_io.ImportError_

*class*

```python
class ImportError_(ValueError)
```

Bases: `ValueError`

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L32-L37)

### lawref.a3_io.ImportError_.code

*attribute* · *instance attribute*

```python
code = code
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L35-L35)

### lawref.a3_io.ImportError_.diagnostics

*attribute* · *instance attribute*

```python
diagnostics = diagnostics or []
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L37-L37)

### lawref.a3_io.ImportError_.message

*attribute* · *instance attribute*

```python
message = message
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L36-L36)

## lawref.a3_io.export_dmn

*function*

```python
def export_dmn(source: dict) -> bytes
```

Canonical A3 table -> deterministic DMN 1.5 profile XML.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L136-L192)

## lawref.a3_io.import_csv

*function*

```python
def import_csv(data: bytes, mapping: dict, uri: str = 'memory:table.csv') -> dict
```

CSV -> A3 using a mandatory explicit typed mapping.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L395-L408)

## lawref.a3_io.import_dmn

*function*

```python
def import_dmn(data: bytes, uri: str = 'memory:table.dmn') -> dict
```

DMN 1.5 decision table -> canonical A3 source + import report.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L315-L392)

## lawref.a3_io.import_file

*function*

```python
def import_file(path: Path, mapping: dict | None = None) -> dict
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L592-L605)

## lawref.a3_io.import_xlsx

*function*

```python
def import_xlsx(data: bytes, mapping: dict, uri: str = 'memory:table.xlsx') -> dict
```

XLSX -> A3 without an office/calculation engine.

Every worksheet is scanned for ``<f>`` first.  A cached ``<v>`` beside it
cannot make the workbook acceptable.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L489-L589)

## lawref.a3_io.mapping_bool_defaults

*function*

```python
def mapping_bool_defaults() -> dict[str, bool]
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/a3_io.py#L436-L437)
