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.1.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.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: elmulator-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ad1e0945d65d7c768093037d4d2171f032f7f2cec40afec12e8105a60f99c2ba
MD5 8c193ce742b8daad2935573254cc6d66
BLAKE2b-256 be672b530bbad78cfc543c08848ee4ce0c316db339bb1adea1ff2d727480dda8

See more details on using hashes here.

Provenance

The following attestation bundles were made for elmulator-0.3.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: elmulator-0.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ae8067aee27474fd1315a30c6535653bb3b50689d35eb19bb7a2c124f55570
MD5 f71444d1fae6c084301d4ee9d7ac0fc2
BLAKE2b-256 8cc05a9da1d48ffa1dee2cba7c9fbcc40f6194e0f01dc76e19850659dc7d1761

See more details on using hashes here.

Provenance

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