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.2.0.tar.gz (8.4 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.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

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

Hashes for elmulator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0fde8a0fc899ce5ed18fedbc6fd21071ff1f8d10b064817dcbdb2e1dedb01a64
MD5 19d27c9e54dbfd0fce806061a9bdd6ec
BLAKE2b-256 9c405eaec106bd918e723c510b0237cb5aed937c94c766b0c9f8c562ffe43572

See more details on using hashes here.

Provenance

The following attestation bundles were made for elmulator-0.2.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.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

Hashes for elmulator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcce186dc4f05d151d59e32f64f7e48cf6e1b2171ec175af5ddeefc4cb7b3531
MD5 fa0d1e4b937e1cbb9e0fc215226a62de
BLAKE2b-256 3d4b588738843b6a92bd23491c1ebec78270566b067a10ed509a87ea34188882

See more details on using hashes here.

Provenance

The following attestation bundles were made for elmulator-0.2.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