semvec/pypi-packages huggingface dataset:
raspberrypi-info 0.2.0
A python library to get raspberry pi info
License: MIT
Requires Python: >=3.6
Keywords: raspberry pi,pi,info,proc,cpu,linux

# Raspberry Pi Information

[![Actions Status](https://github.com/MomsFriendlyRobotCompany/raspberrypi-info/workflows/CheckPackage/badge.svg)](https://github.com/MomsFriendlyRobotCompany/raspberrypi-info/actions)
![GitHub](https://img.shields.io/github/license/MomsFriendlyRobotCompany/raspberrypi-info)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/raspberrypi-info)
![PyPI](https://img.shields.io/pypi/v/raspberrypi-info)

**work in progress**

Answers:

- is this a raspberry pi?
    - `pi_info` return `None` if not a Raspberry Pi
- reads `/proc/cpuinfo` for revision code

## Info

Reads the [revision code](https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md)
which encodes a bunch of information as `uuuuuuuuFMMMCCCCPPPPTTTTTTTTRRRR`. This library
decodes that number.

## Example

```python
from raspberrypi_info import pi_info
from raspberrypi_info.rpi import decode  # normally you don't use this!

# given a revision code, it decodes it (see below). Normally you
# wouldn't do this ... this is just a test
print(decode(0xa020a0))  # compute module 3
print(decode(0xa22042))  # Pi2B
print(decode(0xc03111))  # Pi4B

print(pi_info())  # reads /proc/cpuinfo and get revision code
```

```
RPiInfo(type='CM3', processor='BCM2837', memory='1GB', revision=0, manufacturer='Sony UK', flag='new-style revision')
RPiInfo(type='2B', processor='BCM2837', memory='1GB', revision=2, manufacturer='Embest', flag='new-style revision')
RPiInfo(type='4B', processor='BCM2711', memory='4GB', revision=1, manufacturer='Sony UK', flag='new-style revision')
```

# Change Log

| Date        | Version | Notes      |
|-------------|---------|------------|
| 2020 Apr 5  | 0.2.0   | changed name because it is about the pi |
| 2020 Dec 4  | 0.1.0   | changed name because it does more |
| 2019 Oct 27 | 0.0.3   | simple clean up |
| 2019 Oct 27 | 0.0.1   | init            |


# MIT License

**Copyright (c) 2019 Kevin J. Walchko**

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.