Skip to main content

python-OBD

A python module for handling realtime sensor data from OBD-II vehicle ports. Works with ELM327 OBD-II adapters, and is fit for the Raspberry Pi.

Installation

$ pip install obd

Basic Usage

import obd

connection = obd.OBD() # auto-connects to USB or RF port

cmd = obd.commands.SPEED # select an OBD command (sensor)

response = connection.query(cmd) # send the command, and parse the response

print(response.value) # returns unit-bearing values thanks to Pint
print(response.value.to("mph")) # user-friendly unit conversions

Documentation

Available at python-obd.readthedocs.org

Commands

Here are a handful of the supported commands (sensors). For a full list, see the docs

note: support for these commands will vary from car to car

  • Calculated Engine Load
  • Engine Coolant Temperature
  • Fuel Pressure
  • Intake Manifold Pressure
  • Engine RPM
  • Vehicle Speed
  • Timing Advance
  • Intake Air Temp
  • Air Flow Rate (MAF)
  • Throttle Position
  • Engine Run Time
  • Fuel Level Input
  • Number of warm-ups since codes cleared
  • Barometric Pressure
  • Ambient air temperature
  • Commanded throttle actuator
  • Time run with MIL on
  • Time since trouble codes cleared
  • Hybrid battery pack remaining life
  • Engine fuel rate
  • Vehicle Identification Number (VIN)

Common Issues

Bluetooth OBD-II Adapters

There are sometimes connection issues when using a Bluetooth OBD-II adapter with some devices (the Raspberry Pi is a common problem). This can be fixed by setting the following arguments when setting up the connection:

fast=False, timeout=30

License

GNU GPL v2

This library is forked from:

Enjoy and drive safe!

Metadata

Release files for obd 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for obd 0.7.3
File Size Uploaded
obd-0.7.3.tar.gz 73.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for obd 0.7.3
File Interpreter ABI Platform
obd-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 145.1 kB

Release files / obd-0.7.3.tar.gz

Download URL obd-0.7.3.tar.gz
Size 73.0 kB
Tags Source
SHA-256 checksum
How to use checksums
27b8f043376ca700edb98bf5216e2912295ecde0e735b260999f2d9ddf342522
BLAKE2b-256 checksum
How to use checksums
f9373ae6fd261f911fb3292249a876061786a54486cd5899d49b1406c3483921
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release files / obd-0.7.3-py3-none-any.whl

Download URL obd-0.7.3-py3-none-any.whl
Size 72.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f26da700f13683a27855e6a439db72f7025fff6f1fd47ad4c6c33089d9fe7cab
BLAKE2b-256 checksum
How to use checksums
3a478ef35b33fc80db40d4a42632b0a22b2b2ed7671832dbc9bda9d912a826b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page