A scriptable Bluetooth LE and TCP OBD2 (ELM327) adapter emulator and CI test harness.
Project description
elmulator — Python package
A pure-standard-library ELM327 TCP server and scenario validator. No third-party dependencies. Python 3.9+.
Install
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
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
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 proves byte-for-byte parity.
Test
pip install pytest
pytest -q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elmulator-0.2.0.tar.gz.
File metadata
- Download URL: elmulator-0.2.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fde8a0fc899ce5ed18fedbc6fd21071ff1f8d10b064817dcbdb2e1dedb01a64
|
|
| MD5 |
19d27c9e54dbfd0fce806061a9bdd6ec
|
|
| BLAKE2b-256 |
9c405eaec106bd918e723c510b0237cb5aed937c94c766b0c9f8c562ffe43572
|
Provenance
The following attestation bundles were made for elmulator-0.2.0.tar.gz:
Publisher:
release-pypi.yml on qadanm/elmulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elmulator-0.2.0.tar.gz -
Subject digest:
0fde8a0fc899ce5ed18fedbc6fd21071ff1f8d10b064817dcbdb2e1dedb01a64 - Sigstore transparency entry: 2083424297
- Sigstore integration time:
-
Permalink:
qadanm/elmulator@2e6d3475daf9754ee38a3b4a3a2697d10d04378c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qadanm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@2e6d3475daf9754ee38a3b4a3a2697d10d04378c -
Trigger Event:
release
-
Statement type:
File details
Details for the file elmulator-0.2.0-py3-none-any.whl.
File metadata
- Download URL: elmulator-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcce186dc4f05d151d59e32f64f7e48cf6e1b2171ec175af5ddeefc4cb7b3531
|
|
| MD5 |
fa0d1e4b937e1cbb9e0fc215226a62de
|
|
| BLAKE2b-256 |
3d4b588738843b6a92bd23491c1ebec78270566b067a10ed509a87ea34188882
|
Provenance
The following attestation bundles were made for elmulator-0.2.0-py3-none-any.whl:
Publisher:
release-pypi.yml on qadanm/elmulator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
elmulator-0.2.0-py3-none-any.whl -
Subject digest:
bcce186dc4f05d151d59e32f64f7e48cf6e1b2171ec175af5ddeefc4cb7b3531 - Sigstore transparency entry: 2083424341
- Sigstore integration time:
-
Permalink:
qadanm/elmulator@2e6d3475daf9754ee38a3b4a3a2697d10d04378c -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qadanm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@2e6d3475daf9754ee38a3b4a3a2697d10d04378c -
Trigger Event:
release
-
Statement type: