Skip to content

samjrdn/pirev-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pirev

pypi version license

A tiny, zero-dependency utility providing hardware revision information for Raspberry Pi devices. All information is parsed from the device's revision code located in /proc/cpuinfo.

Installation

pip install pirev

Usage

from pirev import getInfo

info = getInfo()

print('Raspberry Pi {type}'.format(type=info['revision']['type']))

Error handling

Running the utility on a device which is not a Raspberry Pi will result in an error being raised.

try:
  info = getInfo()
  print('Raspberry Pi {type}'.format(type=info['revision']['type']))
except ReferenceError:
  print('Not a Raspberry Pi device!')

Releases

No releases published

Packages

No packages published

Languages