This release is a pre-release and may not be stable for production use.
OBDII
Overview
Connect to any vehicle through its OBDII port and start reading real-time data from Python in a few lines of code.
Plug in a USB, Bluetooth, WiFi or Ethernet adapter, then query engine speed, fault codes, fuel level, VIN, and much more.
Whether you’re building a diagnostic tool, a performance data logger, a custom dashboard, a smart home integration, or just learning how vehicles communicate, this library handles the complexity of vehicle communication, so you don’t have to.
Installation
Python 3.8 or higher is required.
Install from PyPI using pip:
pip install py-obdii
For more installation options, see the Installation Guide.
Usage Example
from obdii import Connection, at_commands, commands
from obdii.utils.scan import scan_ports
# Find first available OBDII device connected via serial
ports = scan_ports(return_first=True)
if not ports:
raise ValueError("No OBDII devices found.")
# Connect to the adapter
with Connection(ports[0]) as conn:
# Query adapter firmware version
version = conn.query(at_commands.VERSION_ID)
print(f"Version: {version.value}")
# Query vehicle's engine speed (rpm)
response = conn.query(commands.ENGINE_SPEED)
print(f"Engine Speed: {response.value} {response.units}")
More examples in the examples folder and Usage Guide.
Emulator Support
You don’t need a physical OBDII device to start developing.
You can use the ELM327-Emulator library to simulate an OBDII adapter and vehicle responses.
Setting Up the ELM327-Emulator
Install the library with the sim extra options:
pip install py-obdii[sim]Start the ELM327-Emulator:
python -m elm -p "REPLACE_WITH_PORT" -s car --baudrate 38400
For platform-specific instructions, see the Emulating a Vehicle guide.
Hardware Requirements
For real-world usage, an ELM327-compatible OBDII adapter is required to connect to your vehicle.
USB: reliable, plug and play
Ethernet: reliable, low latency
Bluetooth: wireless, convenient
WiFi: wireless, mobile compatible
More information on connecting to different adapter types can be found in the Connection Guide.
Compatibility
All ELM327 protocols are supported, covering vehicles from the mid-1990s through today.
Protocol Support
ID |
Protocol |
Specifications |
|---|---|---|
0x01 |
SAE J1850 PWM |
41.6 Kbaud |
0x02 |
SAE J1850 VPW |
10.4 Kbaud |
0x03 |
ISO 9141-2 |
5 baud init, 10.4 Kbaud |
0x04 |
ISO 14230-4 KWP |
5 baud init, 10.4 Kbaud |
0x05 |
ISO 14230-4 KWP |
fast init, 10.4 Kbaud |
0x06 |
ISO 15765-4 CAN |
11 bit ID, 500 Kbaud |
0x07 |
ISO 15765-4 CAN |
29 bit ID, 500 Kbaud |
0x08 |
ISO 15765-4 CAN |
11 bit ID, 250 Kbaud |
0x09 |
ISO 15765-4 CAN |
29 bit ID, 250 Kbaud |
0x0A |
SAE J1939 CAN |
29 bit ID, 250 Kbaud |
0x0B |
USER1 CAN |
11 bit ID, 125 Kbaud |
0x0C |
USER2 CAN |
11 bit ID, 50 Kbaud |
Support & Contact
Found a bug?
Have a question?
Your feedback is greatly appreciated and helps improve this project.
Follow our updates by leaving a star to this repository!
Metadata
Release files for py-obdii 0.10.5b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_obdii-0.10.5b0.tar.gz | 655.1 kB | With provenance | Details for py_obdii-0.10.5b0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_obdii-0.10.5b0-py3-none-any.whl | Python 3 | none | any | Details for py_obdii-0.10.5b0-py3-none-any.whl |
Total release size: 709.3 kB
Release files / py_obdii-0.10.5b0.tar.gz
| Download URL | py_obdii-0.10.5b0.tar.gz |
|---|---|
| Size | 655.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad4e1ba1a56119e447bd82462e98908d3abb12a67edc14f7d503331d5c25e889
|
|
BLAKE2b-256 checksum How to use checksums |
9d1c07583f8eac9b294efea7c4635865fcb652e2d2cb9e89dc7912a2e3f823b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logRelease files / py_obdii-0.10.5b0-py3-none-any.whl
| Download URL | py_obdii-0.10.5b0-py3-none-any.whl |
|---|---|
| Size | 54.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67430d28645fbe805f874ed9b76cae78bba7ed961445e51e6958b647ca6e25fd
|
|
BLAKE2b-256 checksum How to use checksums |
e25159ee8956ac903a0527a4be8cedaea11c6cf152bc7712699eca5e91b1609e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logSecurity for py-obdii 0.10.5b0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for py_obdii-0.10.5b0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.