A Python library for interacting with OBDII.
Project description
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
Install the library with “sim” extra options:
pip install py-obdii[sim]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.
Install com0com and create two virtual serial ports, (e.g. COM5 and COM6).
In the ELM327-Emulator, set the port to COM6.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
453ac1e8e84cb073109a50fb9f0e30c2c5b01c060d8695bb2b9a4d7384974059
|
|
| MD5 |
5168db0a843ff4d0d2d14516e3a271c7
|
|
| BLAKE2b-256 |
94ff1d12c3ef10de0c14bfd7955aa0cb50ead0c1d7f64210c07d6a2e42323f38
|
Provenance
The following attestation bundles were made for py_obdii-0.8.0b0.tar.gz:
Publisher:
publish-to-pypi.yml on PaulMarisOUMary/OBDII
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_obdii-0.8.0b0.tar.gz -
Subject digest:
453ac1e8e84cb073109a50fb9f0e30c2c5b01c060d8695bb2b9a4d7384974059 - Sigstore transparency entry: 660748939
- Sigstore integration time:
-
Permalink:
PaulMarisOUMary/OBDII@21b2cfa17a68bbb84982a93686e5a4dbcd6b18d2 -
Branch / Tag:
refs/tags/v0.8.0b - Owner: https://github.com/PaulMarisOUMary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@21b2cfa17a68bbb84982a93686e5a4dbcd6b18d2 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b1607a23db3534f2b532615fa6b85140a39c544a4d67e9acb512588249873f
|
|
| MD5 |
77586611877d81fb92f8501f4babffd3
|
|
| BLAKE2b-256 |
cb517ae9d9044e8a9fc814e70de304239e51e05c867934a083dc417fba8d5d17
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_obdii-0.8.0b0-py3-none-any.whl -
Subject digest:
73b1607a23db3534f2b532615fa6b85140a39c544a4d67e9acb512588249873f - Sigstore transparency entry: 660748943
- Sigstore integration time:
-
Permalink:
PaulMarisOUMary/OBDII@21b2cfa17a68bbb84982a93686e5a4dbcd6b18d2 -
Branch / Tag:
refs/tags/v0.8.0b - Owner: https://github.com/PaulMarisOUMary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@21b2cfa17a68bbb84982a93686e5a4dbcd6b18d2 -
Trigger Event:
push
-
Statement type: