spidev
Python bindings for Linux SPI access through spidev
What it is and what it does
Spidev is a thin Python wrapper around the Linux kernel's spidev userspace API for controlling SPI (Serial Peripheral Interface) devices. It allows you to open a device file (typically /dev/spidev0.0), configure SPI parameters like clock speed and mode, and then read from or write to connected hardware. The package handles the low-level ioctl calls needed to communicate with the kernel driver, abstracting away the C API details.
The module is used primarily on embedded Linux systems—Raspberry Pi, BeagleBone, and similar platforms—where you need to talk to SPI-connected peripherals like sensors, displays, or memory chips. It supports configurable settings (speed, polarity, phase, chip-select behavior) and provides both simple read/write operations and full duplex transfers. The package has no runtime dependencies beyond the Linux kernel and spidev driver itself.
Use it for:
- Control SPI-connected displays or LED matrices on a Raspberry Pi or similar embedded board.
- Read sensor data from SPI-based accelerometers, temperature sensors, or analog-to-digital converters.
- Interface with SPI flash memory chips or SD card controllers for embedded storage access.
- Communicate with external SPI-connected microcontrollers or FPGAs in a larger embedded system.
- Prototype hardware interfaces in Python without writing C kernel modules or using lower-level system calls directly.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to interact with SPI devices on Linux systems through the spidev kernel driver, allowing user-space programs to read from and write to SPI hardware.
Yes, if you are developing on Linux with SPI hardware and need straightforward Python access to it. The package is stable, permissively licensed, and has no known vulnerabilities. Install friction is moderate due to platform specificity, and maintenance is aging but not abandoned. Not suitable for non-Linux systems or projects requiring active feature development.
Install
spidev on PyPI
pip
pip install spidevuv
uv add spidevpoetry
poetry add spidevInstalling spidev
Before you install
Medium install friction due to platform-specific wheel availability (ARM Linux only in the evidence shown). The package is in aging maintenance status with a last commit in December 2025, but carries production-stable classification and no known vulnerabilities. Suitable for stable embedded projects but not actively developed.
License in practice
MIT license is permissive and imposes no significant restrictions on use, modification, or distribution in your own projects.
Quickstart
import spidev
spi = spidev.SpiDev()
spi.open_path("/dev/spidev0.0")
spi.max_speed_hz = 5000
spi.mode = 0b01
to_send = [0x01, 0x02, 0x03]
response = spi.xfer(to_send)
spi.close()
Requires Linux kernel with spidev driver enabled and access to /dev/spidev* device files; typically runs on embedded Linux systems (Raspberry Pi, BeagleBone, etc.) or systems with SPI hardware controllers.
Verify before relying
- Whether the package supports modern Python versions beyond what the classifiers indicate (Python 2.6, 2.7, 3 are listed but no specific 3.x versions stated).
- Current state of active maintenance and whether aging status reflects planned long-term support or de facto abandonment.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 333 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 121,457/month — #11,978 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spidev-3.8-cp39-cp39-linux_armv7l.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pyftdiPyFtdi provides a pure-Python user-space driver…
permissive · top 15,000 on PyPI
Adafruit-PureIOProvides pure Python access to Linux I2C and…
permissive · top 15,000 on PyPI
pyudevpyudev is a pure Python binding for libudev…
copyleft · top 5,000 on PyPI
pylspciParses the output of the lspci command to…
copyleft · top 15,000 on PyPI
icsneopyicsneopy is a Python binding for Intrepid…
unclear · top 15,000 on PyPI
ft4222Provides Python bindings to LibFT4222, enabling…
permissive · top 15,000 on PyPI
python-canProvides Python abstractions and utilities for…
copyleft · top 5,000 on PyPI
evdevProvides Python bindings to Linux's evdev and…
permissive · top 5,000 on PyPI
hidapiProvides a Python interface to HIDAPI, enabling…
unclear · top 5,000 on PyPI
phidget22Phidget22 is the official Python library for…
permissive · top 15,000 on PyPI