Skip to main content

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:

  1. The version is automatically incremented according to Conventional Commits
  2. A new GitHub release is created
  3. 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

rpi_hw_info-2.0.4.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpi_hw_info-2.0.4-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

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

Hashes for rpi_hw_info-2.0.4.tar.gz
Algorithm Hash digest
SHA256 db41944975943e6dc053e06738c0dfe0130ac1a438d5c573427df2a67e1ba6c3
MD5 4f295576737c1f0214deb1b3fbc77a9c
BLAKE2b-256 07dacd9fca6826a8b17f981216ac879e929d3fd8ec5b301f91458d87ff02aacd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpi_hw_info-2.0.4.tar.gz:

Publisher: release.yaml on SpottyMatt/rpi-hw-info

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for rpi_hw_info-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5da67b911a4cd7008f7dac14024bc2df318c2901f46ce9393d33620882a1e435
MD5 56f21207688dfe588e14841cb3789f7c
BLAKE2b-256 57ce50bc71b87398ee86aef59df84548dcb25e4fac99459e4f1c677cdc081b12

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page