Skip to main content

A Python library for interacting with OBDII.

Project description

PyPI version Python Version from PEP 621 TOML PyTest CI status

A modern, easy to use, Python ≥3.8 library for interacting with OBDII devices.

Installing

Python 3.8 or higher is required.

A Virtual Environment is recommended.

Create a virtual environment

Linux/macOS

python3 -m venv .venv
source .venv/bin/activate

Windows

py -3 -m venv .venv
.venv\Scripts\activate

Install from PyPI

pip install py-obdii

Install the development version

From Github:

pip install git+https://github.com/PaulMarisOUMary/OBDII@main[dev]

From local source:

git clone https://github.com/PaulMarisOUMary/OBDII
cd OBDII
pip install .[dev]

From TestPyPI:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple py-obdii[dev]

Usage Example

from obdii import at_commands, commands, Connection

conn = Connection("COM5")

version = conn.query(at_commands.VERSION_ID)
print(f"Version: {version.value}")

response = conn.query(commands.VEHICLE_SPEED)
print(f"Vehicle Speed: {response.value} {response.units}")

conn.close()

You can find more detailed examples and usage scenarios in the examples folder of this repository.

Emulator Support

To streamline the development process, you can use the ELM327-Emulator library. This allows you to simulate an OBDII connection on your machine without needing a physical OBDII device.

Setting Up the ELM327-Emulator

  1. Install the library with “sim” extra options:

    pip install py-obdii[sim]
  2. Start the ELM327-Emulator:

    python -m elm -p "REPLACE_WITH_PORT" -s car --baudrate 38400

Use Virtual Ports on Windows

Windows users, can use com0com to create virtual serial ports and connect the ELM327-Emulator to your Python code.

  1. Install com0com and create two virtual serial ports, (e.g. COM5 and COM6).

  2. In the ELM327-Emulator, set the port to COM6.

  3. In your Python code, set the connection port to COM5.

Support & Contact

For questions start a discussion on Github, for support open an issue. Your feedback and questions are greatly appreciated and will help improve this project !


Thank you for using or contributing to this project. Follow our updates by leaving a star to this repository !

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

py_obdii-0.8.0b0.tar.gz (486.5 kB view details)

Uploaded Source

Built Distribution

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

py_obdii-0.8.0b0-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file py_obdii-0.8.0b0.tar.gz.

File metadata

  • Download URL: py_obdii-0.8.0b0.tar.gz
  • Upload date:
  • Size: 486.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for py_obdii-0.8.0b0.tar.gz
Algorithm Hash digest
SHA256 453ac1e8e84cb073109a50fb9f0e30c2c5b01c060d8695bb2b9a4d7384974059
MD5 5168db0a843ff4d0d2d14516e3a271c7
BLAKE2b-256 94ff1d12c3ef10de0c14bfd7955aa0cb50ead0c1d7f64210c07d6a2e42323f38

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_obdii-0.8.0b0.tar.gz:

Publisher: publish-to-pypi.yml on PaulMarisOUMary/OBDII

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

File details

Details for the file py_obdii-0.8.0b0-py3-none-any.whl.

File metadata

  • Download URL: py_obdii-0.8.0b0-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for py_obdii-0.8.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 73b1607a23db3534f2b532615fa6b85140a39c544a4d67e9acb512588249873f
MD5 77586611877d81fb92f8501f4babffd3
BLAKE2b-256 cb517ae9d9044e8a9fc814e70de304239e51e05c867934a083dc417fba8d5d17

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_obdii-0.8.0b0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on PaulMarisOUMary/OBDII

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