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 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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PiHardwareInfo, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size PiHardwareInfo-0.3.3-py2.py3-none-any.whl (3.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size PiHardwareInfo-0.3.3.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page