--- id: smbus2 version: "0.6.1" license: MIT license_treatment: permissive maintenance: active --- # smbus2 — smbus2 is a drop-in replacement for smbus-cffi/smbus-python in pure Python License: permissive · Maintenance: active · Downloads: 1.1M/mo ## What it is and what it does smbus2 is a pure Python implementation of the SMBus and I2C protocols for Linux, designed as a drop-in replacement for the older C-based smbus bindings. It provides a familiar interface to users of the original smbus library while adding support for more complete I2C functionality, including combined read/write transactions with repeated start conditions and Packet Error Checking (PEC). The package handles standard SMBus operations like reading and writing bytes, words, and blocks of data, as well as lower-level I2C transactions through the i2c_rdwr interface. It works across Python 2.7 and modern Python 3 versions, has no external runtime dependencies, and is designed for embedded systems and hardware interfacing tasks where direct I2C communication is needed. Use it for: - Read sensor data from I2C-connected devices on a Raspberry Pi or other Linux single-board computer. - Write configuration or control data to I2C peripherals like EEPROM, GPIO expanders, or motor controllers. - Perform combined I2C transactions requiring a write followed by a read with no stop bit between operations. - Access I2C devices with data blocks larger than the standard SMBus 32-byte limit using i2c_rdwr. - Replace legacy smbus bindings in existing Python projects without changing application logic. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. smbus2 provides pure Python I2C/SMBus communication for Linux devices, replacing the C-based smbus bindings with a compatible interface that supports both basic SMBus operations and advanced I2C transactions. Yes. smbus2 is actively maintained, has no dependencies, installs easily, carries no security vulnerabilities, and is the standard choice for I2C communication in Python on Linux. Install it if you need to communicate with I2C devices; it is low-risk and widely used in embedded and IoT projects. ## Install pip install smbus2 uv add smbus2 poetry add smbus2 ## Installing smbus2 Before you install: Low install friction with no runtime dependencies and a pure Python wheel distribution. Actively maintained with recent releases and a stable repository. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations. Quickstart: from smbus2 import SMBus with SMBus(1) as bus: byte_value = bus.read_byte_data(0x50, 0) print(byte_value) Requires a Linux system with I2C support and access to /dev/i2c-* device files; does not work on Windows or macOS. Verify before relying: - Whether the package requires root or special permissions to access /dev/i2c-* device files on Linux systems. - Performance characteristics compared to the original C-based smbus bindings for high-frequency I2C operations. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 1.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags i2c communication python, smbus python library, raspberry pi i2c, linux i2c interface, smbus replacement pure python, i2c read write transactions, embedded linux i2c, i2c-hardware, embedded-linux, raspberry-pi [View on SkillFed](https://skillfed.io/packages/smbus2) · [View on PyPI](https://pypi.org/project/smbus2/)