PiHardwareInfo


NamePiHardwareInfo JSON
Version 0.6.1 PyPI version JSON
download
home_pageNone
SummaryGet Raspberry Pi hardware info
upload_time2025-02-25 03:55:13
maintainerNone
docs_urlNone
authorRex Zhang
requires_python>=3.9
licenseMIT
keywords raspberrypi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PiHardwareInfo

[![image](https://img.shields.io/pypi/v/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)
[![image](https://img.shields.io/pypi/pyversions/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)
[![image](https://img.shields.io/pypi/dm/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)

Get Raspberry Pi hardware info from `/proc/cpuinfo` and `/sys/class/net/*`

## Try

run

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

result

```console
PiHardwareInfo(
 {'revision_code': '0x0',
 'model_type': <ModelType.RPI_5: 23>,
 'model_name': 'Raspberry Pi 5 Model B Rev 1.0',
 'processor': <Processor.BCM2712: 4>,
 'memory': 8192,
 'manufacturer': <Manufacturer.SONY_UK: 0>,
 'revision': '1.0',
 'serial_number': 'ecc0679911340000',
 'mac_address': {'eth0': '2C:CF:67:00:00:00',
                 'wlan0': '2C:CF:67:00:00:00'},
 'overvoltage': False,
 'otp_program': False,
 'otp_read': False}
)
```

## Install

```console
pip install PiHardwareInfo
```

## Usage as library

```python
from pi_hardware_info import ModelType, PiHardwareInfo

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

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

## Usage as tool

```shell
python -m pi_hardware_info
```

## History

### 0.6.1 - 20250225

- Add, network interface MAC address info
- Refactor

### 0.5.0 - 20250224

- Add, Support to raspberry pi 5
- Codebase modernization Updates
  - Drop py3.5 py3.6 py3.7 py3.8
  - Add type hints
  - Add unit test
  - Add pyproject.toml
  - Add pre-commit

### 0.4.0 - 20220810

- Add, support Zero2W/400/CM4
- Add, Overvoltage/OTP Program/OTP Read support

### 0.3.3 - 20190709

- Support raspberry pi 4B
- Rewrite some code

### 0.2.0 - 20190302

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

### 0.1.0 - 20190301

- First release

## Alternative

- <https://github.com/tompreston/raspi-version>
- <https://pypi.org/project/pirev>
- <https://pypi.org/project/RPi.version>

## Ref

- <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html>
- <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "PiHardwareInfo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "raspberrypi",
    "author": "Rex Zhang",
    "author_email": "rex.zhang@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3a/dc/13ce11a367c0ad947be7fc14c311de283fb7edc94444dd057035c76c4abf/pihardwareinfo-0.6.1.tar.gz",
    "platform": null,
    "description": "# PiHardwareInfo\n\n[![image](https://img.shields.io/pypi/v/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)\n[![image](https://img.shields.io/pypi/pyversions/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)\n[![image](https://img.shields.io/pypi/dm/PiHardwareInfo.svg)](https://pypi.org/project/PiHardwareInfo/)\n\nGet Raspberry Pi hardware info from `/proc/cpuinfo` and `/sys/class/net/*`\n\n## Try\n\nrun\n\n```console\ncurl -s https://raw.githubusercontent.com/rexzhang/pi-hardware-info/master/pi_hardware_info.py | python3\n```\n\nresult\n\n```console\nPiHardwareInfo(\n {'revision_code': '0x0',\n 'model_type': <ModelType.RPI_5: 23>,\n 'model_name': 'Raspberry Pi 5 Model B Rev 1.0',\n 'processor': <Processor.BCM2712: 4>,\n 'memory': 8192,\n 'manufacturer': <Manufacturer.SONY_UK: 0>,\n 'revision': '1.0',\n 'serial_number': 'ecc0679911340000',\n 'mac_address': {'eth0': '2C:CF:67:00:00:00',\n                 'wlan0': '2C:CF:67:00:00:00'},\n 'overvoltage': False,\n 'otp_program': False,\n 'otp_read': False}\n)\n```\n\n## Install\n\n```console\npip install PiHardwareInfo\n```\n\n## Usage as library\n\n```python\nfrom pi_hardware_info import ModelType, PiHardwareInfo\n\ninfo = PiHardwareInfo()\nif info.model_type == ModelType.MODEL_3B_PLUS:\n    print('5G Wifi ready')\n\nelif info.model_type == ModelType.MODEL_3B:\n    print('only 2.4G Wifi')\n```\n\n## Usage as tool\n\n```shell\npython -m pi_hardware_info\n```\n\n## History\n\n### 0.6.1 - 20250225\n\n- Add, network interface MAC address info\n- Refactor\n\n### 0.5.0 - 20250224\n\n- Add, Support to raspberry pi 5\n- Codebase modernization Updates\n  - Drop py3.5 py3.6 py3.7 py3.8\n  - Add type hints\n  - Add unit test\n  - Add pyproject.toml\n  - Add pre-commit\n\n### 0.4.0 - 20220810\n\n- Add, support Zero2W/400/CM4\n- Add, Overvoltage/OTP Program/OTP Read support\n\n### 0.3.3 - 20190709\n\n- Support raspberry pi 4B\n- Rewrite some code\n\n### 0.2.0 - 20190302\n\n- Add old style revision code support, support 1A/1B\n\n### 0.1.0 - 20190301\n\n- First release\n\n## Alternative\n\n- <https://github.com/tompreston/raspi-version>\n- <https://pypi.org/project/pirev>\n- <https://pypi.org/project/RPi.version>\n\n## Ref\n\n- <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html>\n- <https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Get Raspberry Pi hardware info",
    "version": "0.6.1",
    "project_urls": {
        "repository": "https://github.com/rexzhang/pi-hardware-info"
    },
    "split_keywords": [
        "raspberrypi"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2888a117596c8d9b34860c9477a5d8cb023d3ad9cf55f67f73646aefcc84399",
                "md5": "229a029636a84eaf87b147dda5a6b1dc",
                "sha256": "91e96604b121f04845aa8325bc535d4636545f905b8ecc338c3cb2e19544c0ff"
            },
            "downloads": -1,
            "filename": "PiHardwareInfo-0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "229a029636a84eaf87b147dda5a6b1dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5010,
            "upload_time": "2025-02-25T03:55:11",
            "upload_time_iso_8601": "2025-02-25T03:55:11.402194Z",
            "url": "https://files.pythonhosted.org/packages/d2/88/8a117596c8d9b34860c9477a5d8cb023d3ad9cf55f67f73646aefcc84399/PiHardwareInfo-0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3adc13ce11a367c0ad947be7fc14c311de283fb7edc94444dd057035c76c4abf",
                "md5": "9ac6dda583b47499a4e568ba3c0c4a04",
                "sha256": "40cf3ecc6416636495ee7bbf8d8e26a257fdaa0f380334f84ee04e00e044d997"
            },
            "downloads": -1,
            "filename": "pihardwareinfo-0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9ac6dda583b47499a4e568ba3c0c4a04",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4707,
            "upload_time": "2025-02-25T03:55:13",
            "upload_time_iso_8601": "2025-02-25T03:55:13.192658Z",
            "url": "https://files.pythonhosted.org/packages/3a/dc/13ce11a367c0ad947be7fc14c311de283fb7edc94444dd057035c76c4abf/pihardwareinfo-0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-25 03:55:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rexzhang",
    "github_project": "pi-hardware-info",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pihardwareinfo"
}
        
Elapsed time: 2.90610s