diff --git a/README.md b/README.md index 2dd8934..cb6e532 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PyArchitecture -PyArchitecture is a lightweight python module to get system architecture information. +PyArchitecture is a lightweight python module to get kernel information via OS specific CLI commands. ![Python][label-pyversion] @@ -11,6 +11,20 @@ PyArchitecture is a lightweight python module to get system architecture informa [![Pypi-format][label-pypi-format]][pypi-files] [![Pypi-status][label-pypi-status]][pypi] +## Summary + +PyArchitecture is designed to retrieve hard-to-find kernel information like CPU/GPU model name, physical disks, +and memory profiles without using any external dependencies. + +> Although this project does not rely on external dependencies, it does use system tools, as outlined below. + +| Datatype / Override key | Linux | Darwin (macOS) | Windows | +|-------------------------|------------------|-----------------------------|------------------------------------------| +| **CPU** - `cpu_lib` | `/proc/cpuinfo` | `/usr/sbin/sysctl` | `C:\Windows\System32\wbem\wmic.exe` | +| **PCI** - `gpu_lib` | `/usr/bin/lspci` | `/usr/sbin/system_profiler` | `C:\Windows\System32\wbem\wmic.exe` | +| **Memory** - `mem_lib` | `/proc/meminfo` | `/usr/sbin/sysctl` | N/A | +| **Disk** - `disk_lib` | `/usr/bin/lsblk` | `/usr/sbin/diskutil` | `C:\Program Files\PowerShell\7\pwsh.exe` | + ## Installation ```shell diff --git a/pyarchitecture/__init__.py b/pyarchitecture/__init__.py index a6daaa7..2436505 100644 --- a/pyarchitecture/__init__.py +++ b/pyarchitecture/__init__.py @@ -5,7 +5,7 @@ from pyarchitecture import cpu, disks, gpu, memory -version = "0.1.0" +version = "0.1.1a0" def all_components() -> Dict[str, Any]: diff --git a/pyarchitecture/cpu/__init__.py b/pyarchitecture/cpu/__init__.py index aee6801..e3c1740 100644 --- a/pyarchitecture/cpu/__init__.py +++ b/pyarchitecture/cpu/__init__.py @@ -22,23 +22,17 @@ def _get_cpu_lib(user_input: str | os.PathLike) -> str: ) -def get_cpu_info(cpu_lib: str | os.PathLike = None) -> Dict[str, int | str]: +def get_cpu_info(cpu_lib: str | os.PathLike = None) -> str: """OS-agnostic function to get all CPUs connected to the host system. Args: cpu_lib: Custom CPU library path. Returns: - List[Dict[str, str]]: + str: Returns CPU name. """ library_path = _get_cpu_lib(cpu_lib) if os.path.isfile(library_path): - cpu_name = main.get_name(library_path) - cpu_count = os.cpu_count() - return { - "name": cpu_name, - "logical_cores": cpu_count, - "physical_cores": int(cpu_count / 2) if cpu_count >= 2 else 1, - } + return main.get_name(library_path) LOGGER.error(f"CPU library {library_path!r} doesn't exist") diff --git a/pyproject.toml b/pyproject.toml index a64389d..a678fa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "PyArchitecture" dynamic = ["version"] -description = "Python module to get physical drives connected to a host machine" +description = "Python module to get kernel information via OS specific CLI commands" readme = "README.md" authors = [{ name = "Vignesh Rao", email = "svignesh1793@gmail.com" }] license = { file = "LICENSE" }