Skip to main content

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

elmulator-0.3.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elmulator-0.3.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file elmulator-0.3.0.tar.gz.

File metadata

  • Download URL: elmulator-0.3.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elmulator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 36d3e95d778fa9e976d848018228046aae93f47d7756e66a2b31dbac0967c87d
MD5 53ec612f1e5aa2b00a1412a57c78b8e7
BLAKE2b-256 5013c53bc760fa108e771c2578c92bcf172ef92550d39ed80d27297a6456c8b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for elmulator-0.3.0.tar.gz:

Publisher: release-pypi.yml on qadanm/elmulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file elmulator-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: elmulator-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for elmulator-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be27a57c159c6a176e3984bf211cc20e10d93a5c1ca0b7f3e0fa82d81c20a94a
MD5 1be3da157dfb3ab83c0e1c323d0509c3
BLAKE2b-256 b300e47008262135c9355760d1c029ea003858b22677bea6922a9653b9cb8488

See more details on using hashes here.

Provenance

The following attestation bundles were made for elmulator-0.3.0-py3-none-any.whl:

Publisher: release-pypi.yml on qadanm/elmulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page