Skip to main content

Get Raspberry Pi hardware info

Project description

https://img.shields.io/pypi/v/PiHardwareInfo.svg https://img.shields.io/pypi/pyversions/PiHardwareInfo.svg https://img.shields.io/pypi/dm/PiHardwareInfo.svg

Get Raspberry Pi hardware/version info from /proc/cpuinfo

Try

run

curl -s https://raw.githubusercontent.com/rexzhang/pi-hardware-info/master/pi_hardware_info.py | python3

result

<PiHardwareInfo:0x000005, MODEL_B, UNKNOWN, 256, 2.0, QISDA, UNKNOWN>
<PiHardwareInfo:0xa020d3, MODEL_3B_PLUS, BCM2837, 1024, 1.3, SONY_UK, 00000000d855943b>

Install

pip install PiHardwareInfo

Usage

from pi_hardware_info import ModelType, get_info

info = get_info()
if info.model_type == ModelType.MODEL_3B_PLUS:
    print('5G Wifi ready')

elif info.model_type == ModelType.MODEL_3B:
    print('only 2.4G Wifi')

History

0.4.0

  • Add, support Zero2W/400/CM4

  • Add, Overvoltage/OTP Program/OTP Read support

0.3.3

  • Support raspberry pi 4B

  • Rewrite some code

0.2.0

  • Add old style revision code support, support 1A/1B

0.1.0

  • First release

Alternative

Ref

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

PiHardwareInfo-0.4.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

PiHardwareInfo-0.4.0-py2.py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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