Metadata-Version: 2.4
Name: elmulator
Version: 0.2.0
Summary: A scriptable Bluetooth LE and TCP OBD2 (ELM327) adapter emulator and CI test harness.
Project-URL: Homepage, https://github.com/qadanm/elmulator
Project-URL: Repository, https://github.com/qadanm/elmulator
Project-URL: Specification, https://github.com/qadanm/elmulator/blob/main/SPEC.md
Author: elmulator contributors
License: MIT
Keywords: automotive,ble,bluetooth,ci,elm327,emulator,obd2,testing
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Emulators
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# elmulator — Python package

A pure-standard-library ELM327 TCP server and scenario validator. No third-party dependencies. Python 3.9+.

## Install

```bash
pip install elmulator
# or from a checkout of this repo:
pip install -e .
```

If the `elmulator` command is not on your PATH after installing (pip prints a warning when the scripts directory is not on PATH), use `python -m elmulator` instead. It works the same way, for example `python -m elmulator self-test`.

## CLI

```bash
elmulator serve SCENARIO [--host H] [--port N] [--echo on|off|scenario] \
                         [--split a,b,c] [--latency-ms N] [--jitter-ms N] [--seed N]
elmulator validate [PATHS...]     # files or dirs; defaults to the bundled examples
elmulator self-test               # in-process loopback smoke test
```

`serve` prints `LISTENING <port>` on stdout once bound (`--port 0` picks a free port) and logs activity to stderr. Each client gets its own scenario cursor state.

## Library

```python
from elmulator import Scenario, serve
import argparse

scenario = Scenario.from_path("scenarios/p0420_basic.scenario.json")
args = argparse.Namespace(host="127.0.0.1", port=0, echo="scenario",
                          split=None, latency_ms=0, jitter_ms=0, seed=0)
serve(args, scenario)   # blocking; pass ready_event/stop_event for threaded use
```

The matching, echo, splitting, and jitter semantics are identical to the Swift engine; the [conformance suite](../conformance/) proves byte-for-byte parity.

## Test

```bash
pip install pytest
pytest -q
```
