Skip to main content

A scriptable Bluetooth + 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          # once published
# or from this checkout:
pip install -e .

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.1.0.tar.gz (8.3 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.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for elmulator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2fd19d951376c0fa851ccceeca402da2b104d266eb1adc14f8d8e99cd0726a8
MD5 07480dd05b6f56386a9009b4e2fc5412
BLAKE2b-256 74c9eae6ffb3cbc582293da9238bc89e331317a3e64d72b38ffc84b4980b9a5e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: elmulator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97b42d5221ba530df349ec1896e53a4ad20226cf6d0a848a4a86e1b3af73cb09
MD5 7fdf26a28814de5ef7293306640fe026
BLAKE2b-256 9ce56103d58312b4c9a790df31c85ab9a955e99d110bc9ef5df0cc8f859677cb

See more details on using hashes here.

Provenance

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