Skip to main content

python3-spi

Python 3.x interface for SPI communications using Linux spidev

This is a fork of https://github.com/tomstokes/python-spi which seems to be abandoned with the python 3 compatibility patch proposed by Tom Egan applied.

Features

  • Pure Python implementation. No C module to compile.
  • Supports half-duplex reads and writes as well as full-duplex transfers.
  • Exposes all available spidev interface options as properties.

Requirements

  • spidev enabled in the kernel and (if necessary) the device tree.
  • Write permissions to the /dev/spidevN.N device.
    • Some distributions have an 'spi' group for this purpose. If available, add this group to the user account and ensure the spidev device is group-writeable.
    • If no 'spi' group exists, a udev rule can be created to set the permissions of the spidev device.
    • As a last resort, running the python script as root should allow access to the spidev. Note This is not recommended. Use the 'spi' group or udev rules whenever possible.

Example

import spi
spi = SPI("/dev/spidev1.0")
spi.mode = SPI.MODE_0
spi.bits_per_word = 8
spi.speed = 500000
received = spi.transfer([0x11, 0x22, 0xFF])
spi.write([0x12, 0x34, 0xAB, 0xCD])
received = spi.read(10)

Metadata

Release files for python3-spi 0.3.1

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

Source distribution (sdist)

Source distribution for python3-spi 0.3.1
File Size Uploaded Provenance
python3-spi-0.3.1.tar.gz 5.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for python3-spi 0.3.1
File Interpreter ABI Platform
python3_spi-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / python3-spi-0.3.1.tar.gz

Download URL python3-spi-0.3.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b1ecec1ad1c83aafaa932ca8681dbcb5b5c8fcc2d951b9ca8c1654c7b7c23ad2
BLAKE2b-256 checksum
How to use checksums
d5f0c1fcd96229d098569c5d17f796a648d0e0addd1025b643071f03a3e82bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / python3_spi-0.3.1-py3-none-any.whl

Download URL python3_spi-0.3.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
922fecb672c3f6b8b5220b5cdf077f8fd737f1f1724045b4ff5e6f06e93f706e
BLAKE2b-256 checksum
How to use checksums
8ef39d85897fe888416c45741289cbf09af47321a009fed586cc8ff8fb886f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for python3-spi 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files No provenance

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