{"id":18764367,"url":"https://github.com/momsfriendlyrobotcompany/linuxinfo","last_synced_at":"2026-04-29T01:02:59.423Z","repository":{"id":62576307,"uuid":"217851229","full_name":"MomsFriendlyRobotCompany/linuxinfo","owner":"MomsFriendlyRobotCompany","description":"Get linux and raspberry pi information as a namedtuple","archived":false,"fork":false,"pushed_at":"2020-10-25T00:55:18.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T17:18:07.508Z","etag":null,"topics":["pi-model","python3","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rpi-info/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MomsFriendlyRobotCompany.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-27T12:24:07.000Z","updated_at":"2020-10-25T00:55:20.000Z","dependencies_parsed_at":"2022-11-03T17:36:07.236Z","dependency_job_id":null,"html_url":"https://github.com/MomsFriendlyRobotCompany/linuxinfo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Flinuxinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Flinuxinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Flinuxinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyRobotCompany%2Flinuxinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyRobotCompany","download_url":"https://codeload.github.com/MomsFriendlyRobotCompany/linuxinfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239662745,"owners_count":19676435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pi-model","python3","raspberry-pi"],"created_at":"2024-11-07T18:29:37.671Z","updated_at":"2025-12-07T06:30:14.905Z","avatar_url":"https://github.com/MomsFriendlyRobotCompany.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Information\n\n[![Actions Status](https://github.com/MomsFriendlyRobotCompany/linuxinfo/workflows/CheckPackage/badge.svg)](https://github.com/MomsFriendlyRobotCompany/linuxinfo/actions)\n![GitHub](https://img.shields.io/github/license/MomsFriendlyRobotCompany/linuxinfo)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/linuxinfo)\n![PyPI](https://img.shields.io/pypi/v/linuxinfo)\n\n**work in progress**\n\nAnswers:\n\n- is this a raspberry pi?\n    - functions return `None` on error\n- is this a raspbian or ubuntu distro?\n- is this distro based on debian?\n- reads `/proc/cpuinfo` for revision code\n- reads `/etc/os-release` for linux OS info\n\n## Info\n\nReads the [revision code](https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md)\nwhich encodes a bunch of information as `uuuuuuuuFMMMCCCCPPPPTTTTTTTTRRRR`. This library\ndecodes that number.\n\n```python\nRPiInfo = namedtuple(\"RPiInfo\", \"type processor memory revision manufacturer flag\")\nLinuxInfo = namedtuple(\"LinuxInfo\", \"distro distro_pretty debian_based version version_codename\")\n```\n\n## Commands\n\n- `get_temp()`\n- `get_ip()`\n- `reboot()`\n- `shutdown()`\n\n## Example\n\n```python\nfrom linuxinfo import linux_info()\nfrom linuxinfo import pi_info\nfrom linuxinfo import RPiInfo, LinuxInfo  # not sure you need these\nfrom linuxinfo.rpi import decode          # normally you don't use this!\n\n# given a revision code, it decodes it (see below). Normally you\n# wouldn't do this ... this is just a test\nprint(decode(0xa020a0))  # compute module 3\nprint(decode(0xa22042))  # Pi2B\nprint(decode(0xc03111))  # Pi4B\n\nprint(pi_info())  # reads /proc/cpuinfo and get revision code\n```\n\n```\nRPiInfo(type='CM3', processor='BCM2837', memory='1GB', revision=0, manufacturer='Sony UK', flag='new-style revision')\nRPiInfo(type='2B', processor='BCM2837', memory='1GB', revision=2, manufacturer='Embest', flag='new-style revision')\nRPiInfo(type='4B', processor='BCM2711', memory='4GB', revision=1, manufacturer='Sony UK', flag='new-style revision')\n```\n\n# Change Log\n\n| Date        | Version | Notes      |\n|-------------|---------|------------|\n| 2020 Oct 24 | 0.2.0   | updated for new processors and added commands |\n| 2019 Dec 4  | 0.1.0   | changed name because it does more |\n| 2019 Oct 27 | 0.0.3   | simple clean up |\n| 2019 Oct 27 | 0.0.1   | init            |\n\n\n# MIT License\n\n**Copyright (c) 2019 Kevin J. Walchko**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlyrobotcompany%2Flinuxinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlyrobotcompany%2Flinuxinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlyrobotcompany%2Flinuxinfo/lists"}