Installation

This guide will help you set up the library on your system.

Setup

Make sure your environment meets these requirements before installing.

Requirements

  • Python 3.8 or higher

Virtual Environment

A Virtual Environment is always recommended as it keeps your projects dependencies isolated from other Python projects. This helps to avoid conflicts with other packages or libraries.

$ python3 -m venv .venv
$ source .venv/bin/activate
py -3 -m venv .venv
.venv\Scripts\activate

Tip

To deactivate the virtual environment later, simply run deactivate in your terminal.

Install the Library

Choose the option that fits your needs. If unsure, use PyPI.

From GitHub

To get the latest features and bug fixes that haven’t been released yet.

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

From Source

If you want to contribute to the library or modify the source code.

git clone https://github.com/PaulMarisOUMary/OBDII
cd OBDII
pip install -e .

The -e flag installs the library in editable mode to modify the source code directly (ideal for contributors).

From PyPI Pre-release

To install the official latest pre-release version (beta, alpha, release candidate) from PyPI.

pip install --upgrade --pre py-obdii

From TestPyPI

To test pre-release versions before they’re officially published on PyPI.

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

Optional Dependencies

Install these on top of the base package depending on what you need: emulating vehicles, running tests, developing the library, or building the documentation.

Installs the ELM327-Emulator library and dependencies for data mocking and vehicle emulation.

pip install py-obdii[sim]

Installs development dependencies, including linters, formatters, and type checkers.

pip install py-obdii[dev]

Required if you want to run unit tests or integration tests.

pip install py-obdii[test]

Useful if you plan to build the documentation with Sphinx or contribute to the docs.

pip install py-obdii[docs]

Installs all extras at once.

pip install py-obdii[sim,dev,test,docs]

Verify Installation

After installation, you can verify that the library is installed correctly by running:

python -c "import obdii; print(obdii.__version__)"

This should print the version of the library you have installed, e.g. 0.10.5b.

Upgrade the Library

To upgrade to the latest version of the library, use:

pip install --upgrade py-obdii