pyhw


Namepyhw JSON
Version 0.11.5 PyPI version JSON
download
home_pageNone
SummaryPyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
upload_time2025-02-15 17:42:53
maintainerNone
docs_urlNone
authorXiao Ran
requires_python>=3.9
licenseBSD-3-Clause
keywords neofetch system information command line tool python hardware information fastfetch fetching
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyHw
[![Downloads](https://static.pepy.tech/badge/pyhw)](https://pepy.tech/project/pyhw)
![PyPI - Version](https://img.shields.io/pypi/v/pyhw?label=version)
![Static Badge](https://img.shields.io/badge/Python-3.9%2B-green)

![Static Badge](https://img.shields.io/badge/macOS-11%2B-green)
![Static Badge](https://img.shields.io/badge/Linux-blue)
![Static Badge](https://img.shields.io/badge/FreeBSD-red)
![Static Badge](https://img.shields.io/badge/Windows-yellow)

![Static Badge](https://img.shields.io/badge/amd64-green)
![Static Badge](https://img.shields.io/badge/aarch64-blue)
![Static Badge](https://img.shields.io/badge/arm32-yellow)
![Static Badge](https://img.shields.io/badge/riscv64-%238A2BE2)


PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python. **Currently, this project is still in the initial stage, only Linux, macOS, FreeBSD and Windows are supported.**

This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔).


[//]: # (![demo](https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE))
[//]: # (![demo](https://files.catbox.moe/xx58xy.jpg))
![demo](https://files.catbox.moe/2d21fu.jpg)




## 1. Install
There are already a lot of similar tools so you can choose any of them; they're all essentially no different. If you want to try this tool, There are two convenient ways to install it.

### 1.1 Install by pipx
**pipx** is an amazing tool to help you install and run applications written in Python. It is more like **brew** or **apt**. You can find more information about it here [pipx](https://github.com/pypa/pipx). **pipx** is available on almost all major platforms and is usually provided by the corresponding package manager. If you haven't used pipx before, you can refer to this [document](https://pipx.pypa.io/stable/installation/) to install it.

You can install pyhw by the following command:
```shell
pipx install pyhw
```
You can then use this tool directly from the command line with the following command, just like neofetch.
```shell
pyhw
```

### 1.2 Install by pip
In any case, pip is always available, so if you can't install this program using **pipx**, you can install pyhw by the following command:
```shell
pip install pyhw
```
To upgrade pyhw:
```shell
pip install pyhw -U
# or
pip install pyhw --upgrade
```
You can then use this tool directly from the command line with the following command, just like neofetch.
```shell
pyhw
# or
python -m pyhw
```
Please note that the command line entry for __pyhw__ is created by pip, and depending on the user, this entry may not in the __system PATH__. If you encounter this problem, pip will give you a prompt, follow the prompts to add entry to the __system PATH__.


### 1.3 Important note about debian 12:
If you use system pip to install pyhw, you will encounter this problem on debian12 and some related distributions (like Ubuntu 24.04):
```text
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
```
This is due to the fact that system python is not supposed to be managed by pip. You can simply use **pipx** to install **pyhw**. Or you can use a virtual environment (venv), conda environment or force remove this restriction (not recommended).

## 2. Tested OS
* macOS arm64, x86_64
* Linux arm64, x86_64, riscv64
* FreeBSD arm64
* Windows 10 x86_64
* Windows 11 arm64, x86_64

For more detailed information, please refer to [Tested Platform](docs/tested_platform.md).

## 3. Add Logo
1. Create a file named **\<os>.pyhw** in **logo/ascii** folder
2. Modify **colorConfig.py** file to add a new logo style
3. Update **pyhwUtil.py** to enable new logo style.

## 4. Build from source

### 4.1 Dependencies
This package was originally implemented in pure python and only depends on the python standard library. However, in subsequent development, the code for the pci part was separated into a separate package **pypci-ng**, which can be obtained using pip (or check out [this](https://github.com/xiaoran007/pypci) GitHub repository).

### 4.2 Build tools
Make sure the following Python build tools are already installed.
* setuptools
* build
* twine

### 4.3 Build package
clone the project, and run:
```shell
python -m build
```
After the build process, the source package and the binary whl package can be found in the dist folder. Then you can use the following command to install the new package.
```shell
pip install dist/*.whl --force-reinstall
```

### 4.4 Build Full Feature package
Currently, build process relay on swiftc and macOS IOKit framework. To build Full Feature Package from source, you need a Mac machine with macOS 11 and newer.

Simply type:
```shell
make build
make install
```

## 5. Test Package
If you have docker installed, you can test this package through docker by type:
```shell
make test # local build
make test-pypi # release version
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyhw",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Xiao Ran <xiaoran.007@icloud.com>",
    "keywords": "neofetch, system information, command line tool, python, hardware information, fastfetch, fetching",
    "author": "Xiao Ran",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b3/4d/3a08e728778bcd21359fdc7510a6ee0ee9dcac390ab15a787cb75d045b93/pyhw-0.11.5.tar.gz",
    "platform": null,
    "description": "# PyHw\n[![Downloads](https://static.pepy.tech/badge/pyhw)](https://pepy.tech/project/pyhw)\n![PyPI - Version](https://img.shields.io/pypi/v/pyhw?label=version)\n![Static Badge](https://img.shields.io/badge/Python-3.9%2B-green)\n\n![Static Badge](https://img.shields.io/badge/macOS-11%2B-green)\n![Static Badge](https://img.shields.io/badge/Linux-blue)\n![Static Badge](https://img.shields.io/badge/FreeBSD-red)\n![Static Badge](https://img.shields.io/badge/Windows-yellow)\n\n![Static Badge](https://img.shields.io/badge/amd64-green)\n![Static Badge](https://img.shields.io/badge/aarch64-blue)\n![Static Badge](https://img.shields.io/badge/arm32-yellow)\n![Static Badge](https://img.shields.io/badge/riscv64-%238A2BE2)\n\n\nPyHw, a neofetch-like command line tool for fetching system information but written mostly in Python. **Currently, this project is still in the initial stage, only Linux, macOS, FreeBSD and Windows are supported.**\n\nThis project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so \ud83e\udd14).\n\n\n[//]: # (![demo]&#40;https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE&#41;)\n[//]: # (![demo]&#40;https://files.catbox.moe/xx58xy.jpg&#41;)\n![demo](https://files.catbox.moe/2d21fu.jpg)\n\n\n\n\n## 1. Install\nThere are already a lot of similar tools so you can choose any of them; they're all essentially no different. If you want to try this tool, There are two convenient ways to install it.\n\n### 1.1 Install by pipx\n**pipx** is an amazing tool to help you install and run applications written in Python. It is more like **brew** or **apt**. You can find more information about it here [pipx](https://github.com/pypa/pipx). **pipx** is available on almost all major platforms and is usually provided by the corresponding package manager. If you haven't used pipx before, you can refer to this [document](https://pipx.pypa.io/stable/installation/) to install it.\n\nYou can install pyhw by the following command:\n```shell\npipx install pyhw\n```\nYou can then use this tool directly from the command line with the following command, just like neofetch.\n```shell\npyhw\n```\n\n### 1.2 Install by pip\nIn any case, pip is always available, so if you can't install this program using **pipx**, you can install pyhw by the following command:\n```shell\npip install pyhw\n```\nTo upgrade pyhw:\n```shell\npip install pyhw -U\n# or\npip install pyhw --upgrade\n```\nYou can then use this tool directly from the command line with the following command, just like neofetch.\n```shell\npyhw\n# or\npython -m pyhw\n```\nPlease note that the command line entry for __pyhw__ is created by pip, and depending on the user, this entry may not in the __system PATH__. If you encounter this problem, pip will give you a prompt, follow the prompts to add entry to the __system PATH__.\n\n\n### 1.3 Important note about debian 12:\nIf you use system pip to install pyhw, you will encounter this problem on debian12 and some related distributions (like Ubuntu 24.04):\n```text\nerror: externally-managed-environment\n\n\u00d7 This environment is externally managed\n\u2570\u2500> To install Python packages system-wide, try apt install\n    python3-xyz, where xyz is the package you are trying to\n    install.\n    \n    If you wish to install a non-Debian-packaged Python package,\n    create a virtual environment using python3 -m venv path/to/venv.\n    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n    sure you have python3-full installed.\n    \n    For more information visit http://rptl.io/venv\n\nnote: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\nhint: See PEP 668 for the detailed specification.\n```\nThis is due to the fact that system python is not supposed to be managed by pip. You can simply use **pipx** to install **pyhw**. Or you can use a virtual environment (venv), conda environment or force remove this restriction (not recommended).\n\n## 2. Tested OS\n* macOS arm64, x86_64\n* Linux arm64, x86_64, riscv64\n* FreeBSD arm64\n* Windows 10 x86_64\n* Windows 11 arm64, x86_64\n\nFor more detailed information, please refer to [Tested Platform](docs/tested_platform.md).\n\n## 3. Add Logo\n1. Create a file named **\\<os>.pyhw** in **logo/ascii** folder\n2. Modify **colorConfig.py** file to add a new logo style\n3. Update **pyhwUtil.py** to enable new logo style.\n\n## 4. Build from source\n\n### 4.1 Dependencies\nThis package was originally implemented in pure python and only depends on the python standard library. However, in subsequent development, the code for the pci part was separated into a separate package **pypci-ng**, which can be obtained using pip (or check out [this](https://github.com/xiaoran007/pypci) GitHub repository).\n\n### 4.2 Build tools\nMake sure the following Python build tools are already installed.\n* setuptools\n* build\n* twine\n\n### 4.3 Build package\nclone the project, and run:\n```shell\npython -m build\n```\nAfter the build process, the source package and the binary whl package can be found in the dist folder. Then you can use the following command to install the new package.\n```shell\npip install dist/*.whl --force-reinstall\n```\n\n### 4.4 Build Full Feature package\nCurrently, build process relay on swiftc and macOS IOKit framework. To build Full Feature Package from source, you need a Mac machine with macOS 11 and newer.\n\nSimply type:\n```shell\nmake build\nmake install\n```\n\n## 5. Test Package\nIf you have docker installed, you can test this package through docker by type:\n```shell\nmake test # local build\nmake test-pypi # release version\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.",
    "version": "0.11.5",
    "project_urls": {
        "homepage": "https://github.com/xiaoran007/pyhw"
    },
    "split_keywords": [
        "neofetch",
        " system information",
        " command line tool",
        " python",
        " hardware information",
        " fastfetch",
        " fetching"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afba2fbe24d3260bf8343ae755519a0027ee6fcc829fb1835b2d0bca30ddc91d",
                "md5": "8c380241f3c4df82a204c5b381a7aca5",
                "sha256": "e78cad76e3bb32ebf6d4e091738ab1160571b1635f0f12e9db4388815b2e1291"
            },
            "downloads": -1,
            "filename": "pyhw-0.11.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c380241f3c4df82a204c5b381a7aca5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 94870,
            "upload_time": "2025-02-15T17:42:51",
            "upload_time_iso_8601": "2025-02-15T17:42:51.719324Z",
            "url": "https://files.pythonhosted.org/packages/af/ba/2fbe24d3260bf8343ae755519a0027ee6fcc829fb1835b2d0bca30ddc91d/pyhw-0.11.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b34d3a08e728778bcd21359fdc7510a6ee0ee9dcac390ab15a787cb75d045b93",
                "md5": "cd29fdffce5b1d35aee96437ad8fe511",
                "sha256": "1c59afb2a164ed94fd42a078c9cc939fcf0dd35f5d1f3d5f5d38dfdea38b4502"
            },
            "downloads": -1,
            "filename": "pyhw-0.11.5.tar.gz",
            "has_sig": false,
            "md5_digest": "cd29fdffce5b1d35aee96437ad8fe511",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 74701,
            "upload_time": "2025-02-15T17:42:53",
            "upload_time_iso_8601": "2025-02-15T17:42:53.966118Z",
            "url": "https://files.pythonhosted.org/packages/b3/4d/3a08e728778bcd21359fdc7510a6ee0ee9dcac390ab15a787cb75d045b93/pyhw-0.11.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 17:42:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xiaoran007",
    "github_project": "pyhw",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyhw"
}
        
Elapsed time: 1.08666s