Raspberry Pi Hardware Info Detector
Project description
Raspberry Pi Hardware Info Detector
A Python tool to detect Raspberry Pi hardware information, including model name, CPU and FPU targets.
Installation
From PyPI
pipx install rpi-hw-info
From Source
git clone https://github.com/username/rpi-hw-info.git
cd rpi-hw-info
pip install .
Usage
As a Command-Line Tool
# Run directly
rpi-hw-info
# Show version
rpi-hw-info --version
# Use in shell scripts
CPU_TARGET=$(rpi-hw-info | awk -F ':' '{print $3}')
gcc -mtune=${CPU_TARGET} ...
As a Python Package
from rpi_hw_info import detect_rpi_model
# Get RPi model information
rpi_model = detect_rpi_model()
# Access model properties
print(f"Model: {rpi_model.model_name}")
print(f"CPU Target: {rpi_model.cpu_target}")
print(f"FPU Target: {rpi_model.fpu_target}")
# Get package version
from rpi_hw_info import __version__
print(f"Package version: {__version__}")
Output Format
The command-line tool outputs a colon (:)-separated list of data to stdout:
Example:
3B+:0xd:cortex-a53:neon-fp-armv8
| Column # | Contents | Example |
|---|---|---|
| 1 | Short human-readable model | 3B+ |
| 2 | Hexadecimal model ID | 0xd |
| 3 | CPU target | cortex-a53 |
| 4 | FPU target | neon-fp-armv8 |
Error Handling
If the hardware info cannot be detected, an error message will be printed to stderr and the process will exit with a non-zero status code.
Technical Details
Detection is based on decoding the hardware "revision" per the Raspberry Pi Documentation.
Developer Guide
Versioning
This project uses Semantic Versioning with automatic version calculation based on Conventional Commits.
Version numbers are automatically calculated based on commit messages:
fix:commits increment the patch version (0.0.X)feat:commits increment the minor version (0.X.0)- Commits with
BREAKING CHANGE:in the description increment the major version (X.0.0)
Release Process
Commits pushed to the master branch are automatically analyzed, and if there are unreleased changes:
- The version is automatically incremented according to Conventional Commits
- A new GitHub release is created
- The package is automatically published to PyPI
No manual version management is needed - just write proper commit messages!
Publishing to PyPI
This project uses GitHub Actions to automatically publish releases to PyPI using PyPI Trusted Publishers.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rpi_hw_info-2.0.4.tar.gz.
File metadata
- Download URL: rpi_hw_info-2.0.4.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db41944975943e6dc053e06738c0dfe0130ac1a438d5c573427df2a67e1ba6c3
|
|
| MD5 |
4f295576737c1f0214deb1b3fbc77a9c
|
|
| BLAKE2b-256 |
07dacd9fca6826a8b17f981216ac879e929d3fd8ec5b301f91458d87ff02aacd
|
Provenance
The following attestation bundles were made for rpi_hw_info-2.0.4.tar.gz:
Publisher:
release.yaml on SpottyMatt/rpi-hw-info
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpi_hw_info-2.0.4.tar.gz -
Subject digest:
db41944975943e6dc053e06738c0dfe0130ac1a438d5c573427df2a67e1ba6c3 - Sigstore transparency entry: 246051558
- Sigstore integration time:
-
Permalink:
SpottyMatt/rpi-hw-info@c87a800587ee6edb6fe52f1920826dc575f0bc98 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/SpottyMatt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c87a800587ee6edb6fe52f1920826dc575f0bc98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rpi_hw_info-2.0.4-py3-none-any.whl.
File metadata
- Download URL: rpi_hw_info-2.0.4-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5da67b911a4cd7008f7dac14024bc2df318c2901f46ce9393d33620882a1e435
|
|
| MD5 |
56f21207688dfe588e14841cb3789f7c
|
|
| BLAKE2b-256 |
57ce50bc71b87398ee86aef59df84548dcb25e4fac99459e4f1c677cdc081b12
|
Provenance
The following attestation bundles were made for rpi_hw_info-2.0.4-py3-none-any.whl:
Publisher:
release.yaml on SpottyMatt/rpi-hw-info
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rpi_hw_info-2.0.4-py3-none-any.whl -
Subject digest:
5da67b911a4cd7008f7dac14024bc2df318c2901f46ce9393d33620882a1e435 - Sigstore transparency entry: 246051559
- Sigstore integration time:
-
Permalink:
SpottyMatt/rpi-hw-info@c87a800587ee6edb6fe52f1920826dc575f0bc98 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/SpottyMatt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c87a800587ee6edb6fe52f1920826dc575f0bc98 -
Trigger Event:
push
-
Statement type: