system-parse-lib 0.0.1__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/PKG-INFO +11 -4
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/README.md +10 -3
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/docs/index.html +18 -15
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/pyproject.toml +1 -1
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/.gitignore +0 -0
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/LICENSE +0 -0
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/src/system-parse-lib/__init__.py +0 -0
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/src/system-parse-lib/systemparselib.py +0 -0
- {system_parse_lib-0.0.1 → system_parse_lib-0.0.2}/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: system-parse-lib
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: A for now small python library used for getting information about the system and hardware on linux. Dependency free! (well, not really)
|
|
5
5
|
Project-URL: Homepage, https://github.com/black-mesa-studios/system-parse-lib
|
|
6
6
|
Project-URL: Issues, https://github.com/black-mesa-studios/system-parse-lib/issues/
|
|
@@ -16,8 +16,9 @@ Description-Content-Type: text/markdown
|
|
|
16
16
|
|
|
17
17
|
A small Python library for reading system information on Linux: OS name, kernel version, uptime, desktop environment, session type, CPU and GPU models and vendors, and basic user details. One module, no third-party dependencies, and no external commands: everything is read from `/etc`, `/proc` and `/sys`.
|
|
18
18
|
|
|
19
|
+
[](https://pypi.org/project/system-parse-lib/)
|
|
19
20
|

|
|
20
|
-

|
|
21
|
+

|
|
21
22
|

|
|
22
23
|
|
|
23
24
|
**Documentation:** https://black-mesa-studios.github.io/system-parse-lib/
|
|
@@ -40,7 +41,13 @@ A small Python library for reading system information on Linux: OS name, kernel
|
|
|
40
41
|
|
|
41
42
|
## Installation
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Install it from [PyPI](https://pypi.org/project/system-parse-lib/):
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
pip install system-parse-lib
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or use the source directly: clone the repo and copy `systemparselib.py` next to your script.
|
|
44
51
|
|
|
45
52
|
```
|
|
46
53
|
git clone https://github.com/black-mesa-studios/system-parse-lib.git
|
|
@@ -94,4 +101,4 @@ python3 test.py
|
|
|
94
101
|
|
|
95
102
|
## License
|
|
96
103
|
|
|
97
|
-
Released under the [BSD 3-Clause License](LICENSE). Copyright 2026 Black Mesa Studios.
|
|
104
|
+
Released under the [BSD 3-Clause License](LICENSE). Copyright 2026 Black Mesa Studios.
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A small Python library for reading system information on Linux: OS name, kernel version, uptime, desktop environment, session type, CPU and GPU models and vendors, and basic user details. One module, no third-party dependencies, and no external commands: everything is read from `/etc`, `/proc` and `/sys`.
|
|
4
4
|
|
|
5
|
+
[](https://pypi.org/project/system-parse-lib/)
|
|
5
6
|

|
|
6
|
-

|
|
7
|
+

|
|
7
8
|

|
|
8
9
|
|
|
9
10
|
**Documentation:** https://black-mesa-studios.github.io/system-parse-lib/
|
|
@@ -26,7 +27,13 @@ A small Python library for reading system information on Linux: OS name, kernel
|
|
|
26
27
|
|
|
27
28
|
## Installation
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
Install it from [PyPI](https://pypi.org/project/system-parse-lib/):
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
pip install system-parse-lib
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or use the source directly: clone the repo and copy `systemparselib.py` next to your script.
|
|
30
37
|
|
|
31
38
|
```
|
|
32
39
|
git clone https://github.com/black-mesa-studios/system-parse-lib.git
|
|
@@ -80,4 +87,4 @@ python3 test.py
|
|
|
80
87
|
|
|
81
88
|
## License
|
|
82
89
|
|
|
83
|
-
Released under the [BSD 3-Clause License](LICENSE). Copyright 2026 Black Mesa Studios.
|
|
90
|
+
Released under the [BSD 3-Clause License](LICENSE). Copyright 2026 Black Mesa Studios.
|
|
@@ -48,31 +48,33 @@ footer{margin-top:60px;color:var(--mut);font-size:.9rem}
|
|
|
48
48
|
<h4>Reference</h4>
|
|
49
49
|
<ul><li><a href="#overview">Functions</a></li><li><a href="#distro">Distro</a></li><li><a href="#user">User & host</a></li><li><a href="#desktop">Desktop & session</a></li><li><a href="#system">System</a></li><li><a href="#hardware">Hardware</a></li></ul>
|
|
50
50
|
<h4>Source</h4>
|
|
51
|
-
<ul><li><a href="https://github.com/black-mesa-studios/system-parse-lib">GitHub repository</a></li><li><a href="https://github.com/black-mesa-studios/system-parse-lib/blob/main/LICENSE">License (BSD-3-Clause)</a></li></ul>
|
|
51
|
+
<ul><li><a href="https://pypi.org/project/system-parse-lib/">PyPI package</a></li><li><a href="https://github.com/black-mesa-studios/system-parse-lib">GitHub repository</a></li><li><a href="https://github.com/black-mesa-studios/system-parse-lib/blob/main/LICENSE">License (BSD-3-Clause)</a></li></ul>
|
|
52
52
|
</nav>
|
|
53
53
|
<main>
|
|
54
54
|
<h1 id="home"><span>[</span>system-parse-lib<span>]</span></h1>
|
|
55
55
|
<p class="tag">A small Python library for reading system information on Linux.</p>
|
|
56
56
|
<hr>
|
|
57
57
|
<p>system-parse-lib reads your OS name, kernel version, uptime, desktop environment, session type, CPU and GPU models and vendors, and basic user details, and hands them back as plain Python values. It's one module, <code>systemparselib.py</code>. It has no third-party dependencies and doesn't call any external commands: everything is read straight from <code>/etc</code>, <code>/proc</code> and <code>/sys</code>.</p>
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
<h2 id="requirements">Requirements</h2>
|
|
60
60
|
<ul>
|
|
61
61
|
<li>Linux</li>
|
|
62
62
|
<li>Python 3.10 or newer</li>
|
|
63
63
|
<li>Optional: a <code>pci.ids</code> file (from the <code>hwdata</code> or <code>pciids</code> package) so <code>get_gpu()</code> can show real model names</li>
|
|
64
64
|
</ul>
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
<h2 id="install">Installation</h2>
|
|
67
|
-
<p>
|
|
67
|
+
<p>Install it from <a href="https://pypi.org/project/system-parse-lib/">PyPI</a>:</p>
|
|
68
|
+
<pre><code>pip install system-parse-lib</code></pre>
|
|
69
|
+
<p>Or use the source directly: clone the repository and copy <code>systemparselib.py</code> next to your script.</p>
|
|
68
70
|
<pre><code>git clone https://github.com/black-mesa-studios/system-parse-lib.git
|
|
69
71
|
cp system-parse-lib/systemparselib.py ./</code></pre>
|
|
70
|
-
|
|
72
|
+
|
|
71
73
|
<h2 id="quickstart">Quick start</h2>
|
|
72
74
|
<pre><code>import systemparselib
|
|
73
|
-
|
|
75
|
+
|
|
74
76
|
sysinfo = systemparselib.Main()
|
|
75
|
-
|
|
77
|
+
|
|
76
78
|
print(sysinfo.get_pretty_name()) # e.g. Arch Linux
|
|
77
79
|
print(sysinfo.get_de()) # e.g. KDE
|
|
78
80
|
print(sysinfo.get_session_type()) # e.g. wayland
|
|
@@ -80,7 +82,7 @@ print(sysinfo.get_kernel_version()) # e.g. 6.11.2-arch1-1
|
|
|
80
82
|
print(sysinfo.get_pretty_uptime()) # e.g. up 3 hours, 12 minutes
|
|
81
83
|
print(sysinfo.get_gpu()) # [GPU(vendor='AMD', model='...', driver='amdgpu')]
|
|
82
84
|
print(f"{sysinfo.get_username()}@{sysinfo.get_hostname()}")</code></pre>
|
|
83
|
-
|
|
85
|
+
|
|
84
86
|
<h2 id="overview">Functions</h2>
|
|
85
87
|
<p>Everything lives on the <code>Main</code> class. Creating an instance reads <code>/etc/os-release</code> once; each method then reads its own data when called.</p>
|
|
86
88
|
<div class="t"><table>
|
|
@@ -97,26 +99,26 @@ print(f"{sysinfo.get_username()}@{sysinfo.get_hostname()}")</code></pre>
|
|
|
97
99
|
<tr><td><code>get_cpu()</code></td><td><code>str | None</code></td><td><code>/proc/cpuinfo</code></td></tr>
|
|
98
100
|
<tr><td><code>get_gpu()</code></td><td><code>list[GPU]</code></td><td><code>/sys/bus/pci/devices</code></td></tr>
|
|
99
101
|
</table></div>
|
|
100
|
-
|
|
102
|
+
|
|
101
103
|
<h2 id="distro">Distro</h2>
|
|
102
104
|
<h3><code>get_distro_id()</code></h3>
|
|
103
105
|
<p>Returns the distro's short ID with quotes removed, such as <code>arch</code>, <code>ubuntu</code> or <code>fedora</code>. Useful for picking a package manager.</p>
|
|
104
106
|
<h3><code>get_pretty_name()</code></h3>
|
|
105
107
|
<p>Returns the human-readable OS name, such as <code>Arch Linux</code> or <code>Ubuntu 24.04 LTS</code>.</p>
|
|
106
108
|
<p class="tag">Both return <code>None</code> if <code>/etc/os-release</code> doesn't exist.</p>
|
|
107
|
-
|
|
109
|
+
|
|
108
110
|
<h2 id="user">User & host</h2>
|
|
109
111
|
<h3><code>get_username()</code></h3>
|
|
110
112
|
<p>Returns the name of the current user.</p>
|
|
111
113
|
<h3><code>get_hostname()</code></h3>
|
|
112
114
|
<p>Returns the machine's hostname.</p>
|
|
113
|
-
|
|
115
|
+
|
|
114
116
|
<h2 id="desktop">Desktop & session</h2>
|
|
115
117
|
<h3><code>get_de()</code></h3>
|
|
116
118
|
<p>Returns the desktop environment from <code>XDG_CURRENT_DESKTOP</code>, falling back to <code>DESKTOP_SESSION</code>. Returns <code>None</code> when neither is set, for example over SSH or in a TTY.</p>
|
|
117
119
|
<h3><code>get_session_type()</code></h3>
|
|
118
120
|
<p>Returns the session type from <code>XDG_SESSION_TYPE</code>, such as <code>wayland</code>, <code>x11</code> or <code>tty</code>. If the variable isn't set, it returns the string <code>"Could not retrieve session type."</code>.</p>
|
|
119
|
-
|
|
121
|
+
|
|
120
122
|
<h2 id="system">System</h2>
|
|
121
123
|
<h3><code>get_kernel_version()</code></h3>
|
|
122
124
|
<p>Returns the kernel release string, such as <code>6.11.2-arch1-1</code>.</p>
|
|
@@ -124,7 +126,7 @@ print(f"{sysinfo.get_username()}@{sysinfo.get_hostname()}")</code></pre>
|
|
|
124
126
|
<p>Returns the time since boot in whole seconds, read from <code>/proc/uptime</code>. Returns <code>None</code> if it can't be read.</p>
|
|
125
127
|
<h3><code>get_pretty_uptime()</code></h3>
|
|
126
128
|
<p>Returns the uptime as readable text, such as <code>up 3 hours, 12 minutes</code> or <code>up 2 days, 1 hour, 5 minutes</code>. Returns <code>None</code> if the uptime can't be read.</p>
|
|
127
|
-
|
|
129
|
+
|
|
128
130
|
<h2 id="hardware">Hardware</h2>
|
|
129
131
|
<h3><code>get_cpu()</code></h3>
|
|
130
132
|
<p>Returns the CPU model name from <code>/proc/cpuinfo</code>, such as <code>AMD Ryzen 5 5600X 6-Core Processor</code>. Returns <code>None</code> if the file doesn't exist, and an empty string if it has no <code>model name</code> line (some ARM systems).</p>
|
|
@@ -138,9 +140,10 @@ print(f"{sysinfo.get_username()}@{sysinfo.get_hostname()}")</code></pre>
|
|
|
138
140
|
</table></div>
|
|
139
141
|
<pre><code>[GPU(vendor='NVIDIA', model='GeForce GTX 1650', driver='nvidia')]</code></pre>
|
|
140
142
|
<p>For a plain dictionary, use <code>dataclasses.asdict(gpu)</code>.</p>
|
|
141
|
-
|
|
143
|
+
|
|
142
144
|
<hr>
|
|
143
|
-
<footer>system-parse-lib is released under the BSD 3-Clause License. Copyright 2026 Black Mesa Studios. <a href="https://github.com/black-mesa-studios/system-parse-lib">
|
|
145
|
+
<footer>system-parse-lib is released under the BSD 3-Clause License. Copyright 2026 Black Mesa Studios. <a href="https://pypi.org/project/system-parse-lib/">PyPI</a> · <a href="https://github.com/black-mesa-studios/system-parse-lib">GitHub</a>.</footer>
|
|
144
146
|
</main>
|
|
145
147
|
</body>
|
|
146
148
|
</html>
|
|
149
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|