pyhw 0.3.7__tar.gz → 0.4.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. {pyhw-0.3.7/src/pyhw.egg-info → pyhw-0.4.1}/PKG-INFO +5 -2
  2. {pyhw-0.3.7 → pyhw-0.4.1}/README.md +3 -1
  3. {pyhw-0.3.7 → pyhw-0.4.1}/pyproject.toml +4 -1
  4. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/__main__.py +4 -0
  5. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/backendBase.py +1 -0
  6. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/gpu/linux.py +10 -11
  7. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/nic/linux.py +11 -13
  8. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/nic/macos.py +7 -0
  9. pyhw-0.4.1/src/pyhw/backend/npu/__init__.py +5 -0
  10. pyhw-0.4.1/src/pyhw/backend/npu/linux.py +42 -0
  11. pyhw-0.4.1/src/pyhw/backend/npu/macos.py +39 -0
  12. pyhw-0.4.1/src/pyhw/backend/npu/npuBase.py +17 -0
  13. pyhw-0.4.1/src/pyhw/backend/npu/npuInfo.py +10 -0
  14. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/pyhwUtil/pyhwUtil.py +2 -0
  15. {pyhw-0.3.7 → pyhw-0.4.1/src/pyhw.egg-info}/PKG-INFO +5 -2
  16. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw.egg-info/SOURCES.txt +6 -0
  17. pyhw-0.4.1/src/pyhw.egg-info/requires.txt +1 -0
  18. {pyhw-0.3.7 → pyhw-0.4.1}/LICENSE +0 -0
  19. {pyhw-0.3.7 → pyhw-0.4.1}/MANIFEST.in +0 -0
  20. {pyhw-0.3.7 → pyhw-0.4.1}/setup.cfg +0 -0
  21. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/__init__.py +0 -0
  22. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/__init__.py +0 -0
  23. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/cpu/__init__.py +0 -0
  24. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/cpu/cpuBase.py +0 -0
  25. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
  26. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/cpu/linux.py +0 -0
  27. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/cpu/macos.py +0 -0
  28. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/gpu/__init__.py +0 -0
  29. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/gpu/gpuBase.py +0 -0
  30. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
  31. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/gpu/macos.py +0 -0
  32. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/__init__.py +0 -0
  33. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/hostBase.py +0 -0
  34. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/hostInfo.py +0 -0
  35. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/linux.py +0 -0
  36. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/macos.py +0 -0
  37. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/host/windows.py +0 -0
  38. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/kernel/__init__.py +0 -0
  39. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/kernel/kernelBase.py +0 -0
  40. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
  41. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/kernel/unix.py +0 -0
  42. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/kernel/windows.py +0 -0
  43. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/memory/__init__.py +0 -0
  44. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/memory/linux.py +0 -0
  45. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/memory/macos.py +0 -0
  46. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/memory/memoryBase.py +0 -0
  47. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/memory/memoryInfo.py +0 -0
  48. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/metal/t.py +0 -0
  49. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/nic/__init__.py +0 -0
  50. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/nic/nicBase.py +0 -0
  51. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/nic/nicInfo.py +0 -0
  52. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/os/__init__.py +0 -0
  53. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/os/linux.py +0 -0
  54. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/os/macos.py +0 -0
  55. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/os/osBase.py +0 -0
  56. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/os/osInfo.py +0 -0
  57. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/shell/__init__.py +0 -0
  58. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/shell/shellBase.py +0 -0
  59. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/shell/unix.py +0 -0
  60. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/title/__init__.py +0 -0
  61. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/title/titleBase.py +0 -0
  62. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/title/unix.py +0 -0
  63. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/title/windows.py +0 -0
  64. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/uptime/__init__.py +0 -0
  65. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/uptime/linux.py +0 -0
  66. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/uptime/macos.py +0 -0
  67. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
  68. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
  69. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/__init__.py +0 -0
  70. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/color/__init__.py +0 -0
  71. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/color/colorConfig.py +0 -0
  72. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/color/colorSet.py +0 -0
  73. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/color/colorUtil.py +0 -0
  74. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/frontendBase.py +0 -0
  75. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/__init__.py +0 -0
  76. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/alpine.pyhw +0 -0
  77. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/arch.pyhw +0 -0
  78. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/armbian.pyhw +0 -0
  79. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/centos.pyhw +0 -0
  80. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
  81. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
  82. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
  83. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
  84. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
  85. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/raspbian.pyhw +0 -0
  86. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
  87. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
  88. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/frontend/logo/logoBase.py +0 -0
  89. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/macos.py +0 -0
  90. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/pyhwException/__init__.py +0 -0
  91. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/pyhwException/pyhwException.py +0 -0
  92. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/pyhwUtil/__init__.py +0 -0
  93. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
  94. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw.egg-info/dependency_links.txt +0 -0
  95. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw.egg-info/entry_points.txt +0 -0
  96. {pyhw-0.3.7 → pyhw-0.4.1}/src/pyhw.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhw
3
- Version: 0.3.7
3
+ Version: 0.4.1
4
4
  Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
5
5
  Author-email: Xiao Ran <xiaoran.007@icloud.com>
6
6
  License: BSD-3-Clause
@@ -13,6 +13,7 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
+ Requires-Dist: pypci-ng>=0.0.3
16
17
 
17
18
  # PyHw
18
19
  [![Downloads](https://static.pepy.tech/badge/pyhw)](https://pepy.tech/project/pyhw)
@@ -27,7 +28,9 @@ PyHw, a neofetch-like command line tool for fetching system information but writ
27
28
  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 🤔).
28
29
 
29
30
 
30
- ![demo](https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE)
31
+ [//]: # (![demo]&#40;https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE&#41;)
32
+ ![demo](https://files.catbox.moe/xx58xy.jpg)
33
+
31
34
 
32
35
 
33
36
 
@@ -11,7 +11,9 @@ PyHw, a neofetch-like command line tool for fetching system information but writ
11
11
  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 🤔).
12
12
 
13
13
 
14
- ![demo](https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE)
14
+ [//]: # (![demo]&#40;https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE&#41;)
15
+ ![demo](https://files.catbox.moe/xx58xy.jpg)
16
+
15
17
 
16
18
 
17
19
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyhw"
7
- version = "0.3.7"
7
+ version = "0.4.1"
8
8
  description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
9
9
  keywords = ["neofetch", "system information", "command line tool", "python", "hardware information", "fastfetch", "fetching"]
10
10
  authors = [
@@ -13,6 +13,9 @@ authors = [
13
13
  readme = "README.md"
14
14
  license = {text = "BSD-3-Clause"}
15
15
  requires-python = ">=3.9"
16
+ dependencies = [
17
+ "pypci-ng>=0.0.3"
18
+ ]
16
19
  classifiers = [
17
20
  "Development Status :: 4 - Beta",
18
21
  "Programming Language :: Python :: 3",
@@ -10,6 +10,7 @@ from .backend.cpu import CPUDetect
10
10
  from .backend.gpu import GPUDetect
11
11
  from .backend.memory import MemoryDetect
12
12
  from .backend.nic import NICDetect
13
+ from .backend.npu import NPUDetect
13
14
  from .pyhwUtil import createDataString
14
15
  from .pyhwUtil import getOS, selectOSLogo
15
16
 
@@ -34,6 +35,9 @@ def main():
34
35
  nic_info = NICDetect(os=current_os).getNICInfo()
35
36
  if nic_info.number > 0:
36
37
  data.NIC = nic_info.nics
38
+ npu_info = NPUDetect(os=current_os).getNPUInfo()
39
+ if npu_info.number > 0:
40
+ data.NPU = npu_info.npus
37
41
 
38
42
  Printer(logo_os=selectOSLogo(OSDetect(os=current_os).getOSInfo().id), data=createDataString(data)).cPrint()
39
43
 
@@ -20,3 +20,4 @@ class Data:
20
20
  GPU = ["Default Value"]
21
21
  Memory = "Default Value"
22
22
  NIC = ["Default Value"]
23
+ NPU = ["Default Value"]
@@ -2,6 +2,7 @@ import subprocess
2
2
  from .gpuInfo import GPUInfo
3
3
  from ..cpu import CPUDetect
4
4
  from ...pyhwUtil import getArch
5
+ import pypci
5
6
 
6
7
 
7
8
  class GPUDetectLinux:
@@ -14,19 +15,17 @@ class GPUDetectLinux:
14
15
  return self.__gpuInfo
15
16
 
16
17
  def __getGPUInfo(self):
17
- try:
18
- pci_info = subprocess.run(["bash", "-c", "lspci"], capture_output=True, text=True).stdout.strip()
19
- except subprocess.SubprocessError:
20
- return
21
- if len(pci_info) == 0: # no pcie devices found
18
+ gpu_devices = pypci.PCI().FindAllVGA()
19
+ if len(gpu_devices) == 0:
22
20
  self.__handleNonePciDevices()
23
- for line in pci_info.split("\n"):
24
- if "VGA" in line or "Display" in line or "3D " in line:
25
- gpu = line.split(": ")[1]
26
- self.__gpuInfo.gpus.append(self.__gpuNameClean(gpu))
21
+ else:
22
+ for device in gpu_devices:
23
+ if device.subsystem_device_name != "":
24
+ device_name = f"{device.vendor_name} {device.device_name} ({device.subsystem_device_name})"
25
+ else:
26
+ device_name = f"{device.vendor_name} {device.device_name}"
27
+ self.__gpuInfo.gpus.append(self.__gpuNameClean(device_name))
27
28
  self.__gpuInfo.number += 1
28
- if self.__gpuInfo.number == 0:
29
- self.__handleNonePciDevices() # fallback to a sbc device detection method
30
29
 
31
30
  def __handleNonePciDevices(self):
32
31
  # if detector can't find any VGA/Display/3D GPUs, assume the host is a sbc device, this function is a placeholder for a more advanced method.
@@ -2,6 +2,7 @@ import subprocess
2
2
  from .nicInfo import NICInfo
3
3
  from ...pyhwUtil import getArch
4
4
  from ...pyhwException import BackendException
5
+ import pypci
5
6
 
6
7
 
7
8
  class NICDetectLinux:
@@ -14,20 +15,17 @@ class NICDetectLinux:
14
15
  return self.__nicInfo
15
16
 
16
17
  def __getNICInfo(self):
17
- try:
18
- pci_info = subprocess.run(["bash", "-c", "lspci"], capture_output=True, text=True).stdout.strip()
19
- except subprocess.SubprocessError:
20
- return
21
- if len(pci_info) == 0: # no pcie devices found
18
+ nic_devices = pypci.PCI().FindAllNIC()
19
+ if len(nic_devices) == 0:
22
20
  self.__handleNonePciDevices()
23
- return
24
- for line in pci_info.split("\n"):
25
- if "Ethernet controller" in line or "Network controller" in line:
26
- nic = line.split(": ")[1]
27
- self.__nicInfo.nics.append(self.__nicNameClean(nic))
21
+ else:
22
+ for device in nic_devices:
23
+ if device.subsystem_device_name != "":
24
+ device_name = f"{device.vendor_name} {device.device_name} ({device.subsystem_device_name})"
25
+ else:
26
+ device_name = f"{device.vendor_name} {device.device_name}"
27
+ self.__nicInfo.nics.append(self.__nicNameClean(device_name))
28
28
  self.__nicInfo.number += 1
29
- if self.__nicInfo.number == 0:
30
- self.__handleNonePciDevices() # fallback to usb detection method
31
29
 
32
30
  def __handleNonePciDevices(self):
33
31
  # placeholder for a more advanced method.
@@ -40,4 +38,4 @@ class NICDetectLinux:
40
38
  return nic_name_clean
41
39
 
42
40
  def __sortNICList(self):
43
- return self.__nicInfo.nics.sort()
41
+ return self.__nicInfo.nics.sort()
@@ -1,4 +1,5 @@
1
1
  from .nicInfo import NICInfo
2
+ import subprocess
2
3
 
3
4
 
4
5
  class NICDetectMacOS:
@@ -9,3 +10,9 @@ class NICDetectMacOS:
9
10
  self.__nicInfo.nics.append("en0")
10
11
  self.__nicInfo.number = 1
11
12
  return self.__nicInfo
13
+
14
+ def __getNICInfo(self):
15
+ # Placeholder for a more advanced method.
16
+ interfaces = subprocess.run(["bash", "-c", "route get default | grep interface"], capture_output=True, text=True).stdout.strip()
17
+
18
+
@@ -0,0 +1,5 @@
1
+ from .npuBase import NPUDetect
2
+
3
+ __all__ = ['NPUDetect']
4
+
5
+
@@ -0,0 +1,42 @@
1
+ import subprocess
2
+ from .npuInfo import NPUInfo
3
+ from ..cpu import CPUDetect
4
+ from ...pyhwUtil import getArch
5
+ import pypci
6
+
7
+
8
+ class NPUDetectLinux:
9
+ def __init__(self):
10
+ self.__npuInfo = NPUInfo()
11
+
12
+ def getNPUInfo(self):
13
+ self.__getNPUInfo()
14
+ self.__sortNPUList()
15
+ return self.__npuInfo
16
+
17
+ def __getNPUInfo(self):
18
+ npu_devices = pypci.PCI().FindAllNPU()
19
+ if len(npu_devices) == 0:
20
+ self.__handleNonePciDevices()
21
+ else:
22
+ for device in npu_devices:
23
+ if device.subsystem_device_name != "":
24
+ device_name = f"{device.vendor_name} {device.device_name} ({device.subsystem_device_name})"
25
+ else:
26
+ device_name = f"{device.vendor_name} {device.device_name}"
27
+ self.__npuInfo.npus.append(self.__npuNameClean(device_name))
28
+ self.__npuInfo.number += 1
29
+
30
+ def __handleNonePciDevices(self):
31
+ # Place Holder for unknown NPU
32
+ self.__npuInfo.number = 1
33
+ self.__npuInfo.npus.append("Not found")
34
+
35
+ @staticmethod
36
+ def __npuNameClean(npu_name: str):
37
+ npu_name_clean = npu_name.replace("Corporation ", "")
38
+ return npu_name_clean
39
+
40
+ def __sortNPUList(self):
41
+ self.__npuInfo.npus.sort()
42
+
@@ -0,0 +1,39 @@
1
+ from .npuInfo import NPUInfo
2
+ from ...pyhwUtil import getArch
3
+ import json
4
+ import subprocess
5
+
6
+
7
+ class NPUDetectMacOS:
8
+ def __init__(self):
9
+ self.__npuInfo = NPUInfo()
10
+ self.__arch = getArch()
11
+
12
+ def getNPUInfo(self):
13
+ if self.__arch == "aarch64":
14
+ self.__getNPUAppleSilicon()
15
+ else: # Does not consider powerPC based Macs.
16
+ self.__getNPUIntel()
17
+ return self.__npuInfo
18
+
19
+ def __getNPUAppleSilicon(self):
20
+ # Place holder
21
+ self.__npuInfo.npus.append("Neural Engine [SOC Integrated]")
22
+ self.__npuInfo.number += 1
23
+
24
+ def __getNPUIntel(self):
25
+ # Place holder
26
+ self.__npuInfo.npus.append("Not Found")
27
+ self.__npuInfo.number += 1
28
+
29
+ @staticmethod
30
+ def __handleVendor(vendor):
31
+ if vendor == "sppci_vendor_Apple":
32
+ return "Apple"
33
+ elif vendor == "sppci_vendor_intel":
34
+ return "Intel"
35
+ elif vendor == "sppci_vendor_amd":
36
+ return "AMD"
37
+ else:
38
+ return vendor
39
+
@@ -0,0 +1,17 @@
1
+ from .linux import NPUDetectLinux
2
+ from .macos import NPUDetectMacOS
3
+
4
+
5
+ class NPUDetect:
6
+ def __init__(self, os):
7
+ self.OS = os
8
+
9
+ def getNPUInfo(self):
10
+ if self.OS == "linux":
11
+ return NPUDetectLinux().getNPUInfo()
12
+ elif self.OS == "macos":
13
+ return NPUDetectMacOS().getNPUInfo()
14
+ else:
15
+ raise NotImplementedError("Unsupported operating system")
16
+
17
+
@@ -0,0 +1,10 @@
1
+ from dataclasses import dataclass
2
+
3
+
4
+ @dataclass
5
+ class NPUInfo:
6
+ def __init__(self):
7
+ self.number = 0
8
+ self.npus = []
9
+
10
+
@@ -53,6 +53,8 @@ def createDataString(data: Data):
53
53
  data_string += f" Memory: {data.Memory}\n"
54
54
  for nic in data.NIC:
55
55
  data_string += f" NIC: {nic}\n"
56
+ for npu in data.NPU:
57
+ data_string += f" NPU: {npu}\n"
56
58
  return data_string
57
59
 
58
60
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhw
3
- Version: 0.3.7
3
+ Version: 0.4.1
4
4
  Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
5
5
  Author-email: Xiao Ran <xiaoran.007@icloud.com>
6
6
  License: BSD-3-Clause
@@ -13,6 +13,7 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
+ Requires-Dist: pypci-ng>=0.0.3
16
17
 
17
18
  # PyHw
18
19
  [![Downloads](https://static.pepy.tech/badge/pyhw)](https://pepy.tech/project/pyhw)
@@ -27,7 +28,9 @@ PyHw, a neofetch-like command line tool for fetching system information but writ
27
28
  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 🤔).
28
29
 
29
30
 
30
- ![demo](https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE)
31
+ [//]: # (![demo]&#40;https://i2.imgs.ovh/d/BQACAgUAAx0EUvSR8wACMvpmyFVohzKxLcUdLiJaEa3wlo_OrQACuw4AAoX-QVaSpG0-rTAeRTUE&#41;)
32
+ ![demo](https://files.catbox.moe/xx58xy.jpg)
33
+
31
34
 
32
35
 
33
36
 
@@ -9,6 +9,7 @@ src/pyhw.egg-info/PKG-INFO
9
9
  src/pyhw.egg-info/SOURCES.txt
10
10
  src/pyhw.egg-info/dependency_links.txt
11
11
  src/pyhw.egg-info/entry_points.txt
12
+ src/pyhw.egg-info/requires.txt
12
13
  src/pyhw.egg-info/top_level.txt
13
14
  src/pyhw/backend/__init__.py
14
15
  src/pyhw/backend/backendBase.py
@@ -44,6 +45,11 @@ src/pyhw/backend/nic/linux.py
44
45
  src/pyhw/backend/nic/macos.py
45
46
  src/pyhw/backend/nic/nicBase.py
46
47
  src/pyhw/backend/nic/nicInfo.py
48
+ src/pyhw/backend/npu/__init__.py
49
+ src/pyhw/backend/npu/linux.py
50
+ src/pyhw/backend/npu/macos.py
51
+ src/pyhw/backend/npu/npuBase.py
52
+ src/pyhw/backend/npu/npuInfo.py
47
53
  src/pyhw/backend/os/__init__.py
48
54
  src/pyhw/backend/os/linux.py
49
55
  src/pyhw/backend/os/macos.py
@@ -0,0 +1 @@
1
+ pypci-ng>=0.0.3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes