Python-OBD is a library for handling data from a car's On-Board Diagnostics port (OBD-II). It can stream real time sensor data, perform diagnostics (such as reading check-engine codes), and is fit for the Raspberry Pi. This library is designed to work with standard ELM327 OBD-II adapters.
Install the latest release from pypi:
$ pip install obdIf you are using a bluetooth adapter, you will need to install the following packages:
$ sudo apt-get install bluetooth bluez-utils bluemanimport obd
connection = obd.OBD() # auto-connects to USB or RF port
cmd = obd.commands.RPM # select an OBD command (sensor)
response = connection.query(cmd) # send the command, and parse the response
print(response.value)
print(response.unit)GNU General Public License V2