diskman 0.2.1__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.
diskman-0.2.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gaffer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
diskman-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: diskman
3
+ Version: 0.2.1
4
+ Summary: CLI + TUI disk manager with SMART, LUKS, and non-blocking automount
5
+ Home-page: https://github.com/gaffer/disk-manager
6
+ Author: Gaffer
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/gaffer/disk-manager
9
+ Project-URL: Repository, https://github.com/gaffer/disk-manager
10
+ Project-URL: Issues, https://github.com/gaffer/disk-manager/issues
11
+ Keywords: linux,disk,partition,mount,luks,smart,tui,cli
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: System :: Systems Administration
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: rich>=13.7.0
28
+ Provides-Extra: binary
29
+ Requires-Dist: pyinstaller>=6.0; extra == "binary"
30
+ Provides-Extra: release
31
+ Requires-Dist: build>=1.2.0; extra == "release"
32
+ Requires-Dist: twine>=5.0.0; extra == "release"
33
+ Dynamic: home-page
34
+ Dynamic: license-file
35
+ Dynamic: requires-python
36
+
37
+ # diskman
38
+
39
+ [![PyPI version](https://img.shields.io/pypi/v/diskman.svg)](https://pypi.org/project/diskman/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
41
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
42
+
43
+ **diskman** is a lightweight, terminal-first Linux disk and partition manager. It provides a powerful CLI and an interactive TUI for day-to-day storage administration, featuring SMART health monitoring, LUKS encryption support, and filesystem-aware automounting.
44
+
45
+ ---
46
+
47
+ ## 🚀 Key Features
48
+
49
+ - **Dual Interface:** Full-featured Command Line Interface (CLI) and an interactive Terminal User Interface (TUI).
50
+ - **Smart Automount:** Filesystem-aware mount options (e.g., `discard` for SSDs, UID/GID mapping for FAT/NTFS).
51
+ - **LUKS Support:** Auto-detection, unlocking, and locking of encrypted partitions.
52
+ - **Health Monitoring:** Real-time SMART health status visibility (via `smartmontools`).
53
+ - **Safety First:** Automatically excludes root partitions from destructive operations and provides a **read-only fallback** if a writable mount fails.
54
+ - **Non-Blocking Ops:** Asynchronous mount, unmount, and LUKS operations to keep the TUI responsive.
55
+ - **Persistence:** Easily toggle reboot-persistent mounts via tagged `/etc/fstab` entries.
56
+ - **System Integration:** Ready-to-use `systemd` service and timer for periodic automounting.
57
+
58
+ ---
59
+
60
+ ## 📦 Installation
61
+
62
+ ### From PyPI (Recommended)
63
+
64
+ Install the latest stable version directly from PyPI:
65
+
66
+ ```bash
67
+ python3 -m pip install --upgrade diskman
68
+ ```
69
+
70
+ ### From Source
71
+
72
+ ```bash
73
+ git clone https://github.com/SoyalIslam/disk-manager.git
74
+ cd disk-manager
75
+ python3 -m pip install .
76
+ ```
77
+
78
+ ### Requirements
79
+
80
+ - **OS:** Linux
81
+ - **Python:** 3.9+
82
+ - **System Tools:** `util-linux` (`lsblk`, `findmnt`, `mount`, `umount`)
83
+ - **Optional Tools:**
84
+ - `cryptsetup` (for LUKS support)
85
+ - `smartmontools` (for SMART health monitoring)
86
+
87
+ ---
88
+
89
+ ## 🛠 Usage
90
+
91
+ ### CLI Reference
92
+
93
+ | Command | Description |
94
+ | :--- | :--- |
95
+ | `diskman list` | List all partitions, filesystems, and mount status. |
96
+ | `diskman tui` | Launch the interactive Terminal User Interface. |
97
+ | `sudo diskman automount` | Auto-mount all available partitions (excluding root). |
98
+ | `sudo diskman mount /dev/sdb1` | Mount a specific device (prompts for LUKS if needed). |
99
+ | `sudo diskman umount /dev/sdb1` | Unmount a specific device. |
100
+ | `sudo diskman luks-unlock /dev/sdb2` | Unlock a LUKS encrypted partition. |
101
+ | `sudo diskman boot-add /dev/sdb1` | Enable reboot-persistent mount in `/etc/fstab`. |
102
+
103
+ *Note: Operations that modify system state (mount/unmount/LUKS/fstab) require `sudo`.*
104
+
105
+ ### TUI Controls
106
+
107
+ Launch with `diskman tui` (or `sudo diskman tui` for full functionality):
108
+
109
+ - **`j` / `k`** or **Arrow Keys**: Navigate device list.
110
+ - **`m`**: Mount or unmount the selected partition.
111
+ - **`u` / `l`**: Unlock or lock a LUKS partition.
112
+ - **`a`**: Trigger a background automount of all devices.
113
+ - **`p`**: Toggle persistence (`/etc/fstab`) for the selected device.
114
+ - **`r`**: Refresh the device list.
115
+ - **`q`**: Exit.
116
+
117
+ ---
118
+
119
+ ## ⚙️ System Integration
120
+
121
+ ### Periodic Automount (systemd)
122
+
123
+ You can automate mounting of external drives using the provided systemd units:
124
+
125
+ 1. **Install Units:**
126
+ ```bash
127
+ sudo install -Dm644 extras/systemd/diskman-automount.service /etc/systemd/system/
128
+ sudo install -Dm644 extras/systemd/diskman-automount.timer /etc/systemd/system/
129
+ ```
130
+
131
+ 2. **Enable Timer:**
132
+ ```bash
133
+ sudo systemctl daemon-reload
134
+ sudo systemctl enable --now diskman-automount.timer
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 🏗 Development
140
+
141
+ ### Setup Environment
142
+
143
+ ```bash
144
+ python3 -m venv .venv
145
+ source .venv/bin/activate
146
+ pip install -r requirements-dev.txt
147
+ ```
148
+
149
+ ### Build & Package
150
+
151
+ ```bash
152
+ # Build distribution archives
153
+ python3 -m build
154
+
155
+ # Build standalone binary (via PyInstaller)
156
+ ./scripts/build_binary.sh
157
+ ```
158
+
159
+ ### GitHub Actions: Publish to PyPI
160
+
161
+ This repo includes:
162
+
163
+ - `.github/workflows/publish-pypi.yml`
164
+
165
+ Set these repository secrets in GitHub:
166
+
167
+ - `PYPI_API_TOKEN`
168
+ - `TEST_PYPI_API_TOKEN`
169
+
170
+ Workflow usage:
171
+
172
+ 1. Manual publish to TestPyPI:
173
+ - Actions -> `Publish Python Package` -> `Run workflow` -> target `testpypi`
174
+ 2. Manual publish to PyPI:
175
+ - Actions -> `Publish Python Package` -> `Run workflow` -> target `pypi`
176
+ 3. Auto publish to PyPI on tag:
177
+ - Push tag `vX.Y.Z` matching `pyproject.toml` version
178
+
179
+ ```bash
180
+ git tag v0.2.1
181
+ git push origin v0.2.1
182
+ ```
183
+
184
+ ---
185
+
186
+ ## 📄 License
187
+
188
+ This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
189
+
190
+ ## 🤝 Contributing
191
+
192
+ Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/SoyalIslam/disk-manager/issues).
@@ -0,0 +1,156 @@
1
+ # diskman
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/diskman.svg)](https://pypi.org/project/diskman/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
6
+
7
+ **diskman** is a lightweight, terminal-first Linux disk and partition manager. It provides a powerful CLI and an interactive TUI for day-to-day storage administration, featuring SMART health monitoring, LUKS encryption support, and filesystem-aware automounting.
8
+
9
+ ---
10
+
11
+ ## 🚀 Key Features
12
+
13
+ - **Dual Interface:** Full-featured Command Line Interface (CLI) and an interactive Terminal User Interface (TUI).
14
+ - **Smart Automount:** Filesystem-aware mount options (e.g., `discard` for SSDs, UID/GID mapping for FAT/NTFS).
15
+ - **LUKS Support:** Auto-detection, unlocking, and locking of encrypted partitions.
16
+ - **Health Monitoring:** Real-time SMART health status visibility (via `smartmontools`).
17
+ - **Safety First:** Automatically excludes root partitions from destructive operations and provides a **read-only fallback** if a writable mount fails.
18
+ - **Non-Blocking Ops:** Asynchronous mount, unmount, and LUKS operations to keep the TUI responsive.
19
+ - **Persistence:** Easily toggle reboot-persistent mounts via tagged `/etc/fstab` entries.
20
+ - **System Integration:** Ready-to-use `systemd` service and timer for periodic automounting.
21
+
22
+ ---
23
+
24
+ ## 📦 Installation
25
+
26
+ ### From PyPI (Recommended)
27
+
28
+ Install the latest stable version directly from PyPI:
29
+
30
+ ```bash
31
+ python3 -m pip install --upgrade diskman
32
+ ```
33
+
34
+ ### From Source
35
+
36
+ ```bash
37
+ git clone https://github.com/SoyalIslam/disk-manager.git
38
+ cd disk-manager
39
+ python3 -m pip install .
40
+ ```
41
+
42
+ ### Requirements
43
+
44
+ - **OS:** Linux
45
+ - **Python:** 3.9+
46
+ - **System Tools:** `util-linux` (`lsblk`, `findmnt`, `mount`, `umount`)
47
+ - **Optional Tools:**
48
+ - `cryptsetup` (for LUKS support)
49
+ - `smartmontools` (for SMART health monitoring)
50
+
51
+ ---
52
+
53
+ ## 🛠 Usage
54
+
55
+ ### CLI Reference
56
+
57
+ | Command | Description |
58
+ | :--- | :--- |
59
+ | `diskman list` | List all partitions, filesystems, and mount status. |
60
+ | `diskman tui` | Launch the interactive Terminal User Interface. |
61
+ | `sudo diskman automount` | Auto-mount all available partitions (excluding root). |
62
+ | `sudo diskman mount /dev/sdb1` | Mount a specific device (prompts for LUKS if needed). |
63
+ | `sudo diskman umount /dev/sdb1` | Unmount a specific device. |
64
+ | `sudo diskman luks-unlock /dev/sdb2` | Unlock a LUKS encrypted partition. |
65
+ | `sudo diskman boot-add /dev/sdb1` | Enable reboot-persistent mount in `/etc/fstab`. |
66
+
67
+ *Note: Operations that modify system state (mount/unmount/LUKS/fstab) require `sudo`.*
68
+
69
+ ### TUI Controls
70
+
71
+ Launch with `diskman tui` (or `sudo diskman tui` for full functionality):
72
+
73
+ - **`j` / `k`** or **Arrow Keys**: Navigate device list.
74
+ - **`m`**: Mount or unmount the selected partition.
75
+ - **`u` / `l`**: Unlock or lock a LUKS partition.
76
+ - **`a`**: Trigger a background automount of all devices.
77
+ - **`p`**: Toggle persistence (`/etc/fstab`) for the selected device.
78
+ - **`r`**: Refresh the device list.
79
+ - **`q`**: Exit.
80
+
81
+ ---
82
+
83
+ ## ⚙️ System Integration
84
+
85
+ ### Periodic Automount (systemd)
86
+
87
+ You can automate mounting of external drives using the provided systemd units:
88
+
89
+ 1. **Install Units:**
90
+ ```bash
91
+ sudo install -Dm644 extras/systemd/diskman-automount.service /etc/systemd/system/
92
+ sudo install -Dm644 extras/systemd/diskman-automount.timer /etc/systemd/system/
93
+ ```
94
+
95
+ 2. **Enable Timer:**
96
+ ```bash
97
+ sudo systemctl daemon-reload
98
+ sudo systemctl enable --now diskman-automount.timer
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 🏗 Development
104
+
105
+ ### Setup Environment
106
+
107
+ ```bash
108
+ python3 -m venv .venv
109
+ source .venv/bin/activate
110
+ pip install -r requirements-dev.txt
111
+ ```
112
+
113
+ ### Build & Package
114
+
115
+ ```bash
116
+ # Build distribution archives
117
+ python3 -m build
118
+
119
+ # Build standalone binary (via PyInstaller)
120
+ ./scripts/build_binary.sh
121
+ ```
122
+
123
+ ### GitHub Actions: Publish to PyPI
124
+
125
+ This repo includes:
126
+
127
+ - `.github/workflows/publish-pypi.yml`
128
+
129
+ Set these repository secrets in GitHub:
130
+
131
+ - `PYPI_API_TOKEN`
132
+ - `TEST_PYPI_API_TOKEN`
133
+
134
+ Workflow usage:
135
+
136
+ 1. Manual publish to TestPyPI:
137
+ - Actions -> `Publish Python Package` -> `Run workflow` -> target `testpypi`
138
+ 2. Manual publish to PyPI:
139
+ - Actions -> `Publish Python Package` -> `Run workflow` -> target `pypi`
140
+ 3. Auto publish to PyPI on tag:
141
+ - Push tag `vX.Y.Z` matching `pyproject.toml` version
142
+
143
+ ```bash
144
+ git tag v0.2.1
145
+ git push origin v0.2.1
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 📄 License
151
+
152
+ This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
153
+
154
+ ## 🤝 Contributing
155
+
156
+ Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/SoyalIslam/disk-manager/issues).
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "diskman"
7
+ version = "0.2.1"
8
+ description = "CLI + TUI disk manager with SMART, LUKS, and non-blocking automount"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ authors = [
13
+ {name = "Gaffer"},
14
+ ]
15
+ keywords = ["linux", "disk", "partition", "mount", "luks", "smart", "tui", "cli"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Environment :: Console",
19
+ "Intended Audience :: System Administrators",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: System :: Systems Administration",
28
+ "Topic :: Utilities",
29
+ ]
30
+ dependencies = [
31
+ "rich>=13.7.0",
32
+ ]
33
+
34
+ [project.scripts]
35
+ diskman = "diskman.cli:main"
36
+
37
+ [project.optional-dependencies]
38
+ binary = [
39
+ "pyinstaller>=6.0",
40
+ ]
41
+ release = [
42
+ "build>=1.2.0",
43
+ "twine>=5.0.0",
44
+ ]
45
+
46
+ [project.urls]
47
+ Homepage = "https://github.com/gaffer/disk-manager"
48
+ Repository = "https://github.com/gaffer/disk-manager"
49
+ Issues = "https://github.com/gaffer/disk-manager/issues"
50
+
51
+ [tool.setuptools]
52
+ package-dir = {"" = "src"}
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
diskman-0.2.1/setup.py ADDED
@@ -0,0 +1,53 @@
1
+ from setuptools import setup, find_packages
2
+ from pathlib import Path
3
+
4
+ # Extract version from src/diskman/__init__.py
5
+ version = "0.2.1"
6
+ init_file = Path(__file__).parent / "src" / "diskman" / "__init__.py"
7
+ if init_file.exists():
8
+ for line in init_file.read_text(encoding="utf-8").splitlines():
9
+ if line.startswith("__version__"):
10
+ version = line.split("=")[1].strip().strip('"').strip("'")
11
+ break
12
+
13
+ setup(
14
+ name="diskman",
15
+ version=version,
16
+ author="Gaffer",
17
+ description="CLI + TUI disk manager with SMART, LUKS, and non-blocking automount",
18
+ long_description=Path("README.md").read_text(encoding="utf-8"),
19
+ long_description_content_type="text/markdown",
20
+ url="https://github.com/gaffer/disk-manager",
21
+ project_urls={
22
+ "Homepage": "https://github.com/gaffer/disk-manager",
23
+ "Repository": "https://github.com/gaffer/disk-manager",
24
+ "Issues": "https://github.com/gaffer/disk-manager/issues",
25
+ },
26
+ package_dir={"": "src"},
27
+ packages=find_packages(where="src"),
28
+ python_requires=">=3.9",
29
+ install_requires=[
30
+ "rich>=13.7.0",
31
+ ],
32
+ entry_points={
33
+ "console_scripts": [
34
+ "diskman=diskman.cli:main",
35
+ ],
36
+ },
37
+ classifiers=[
38
+ "Development Status :: 4 - Beta",
39
+ "Environment :: Console",
40
+ "Intended Audience :: System Administrators",
41
+ "License :: OSI Approved :: MIT License",
42
+ "Operating System :: POSIX :: Linux",
43
+ "Programming Language :: Python :: 3",
44
+ "Programming Language :: Python :: 3 :: Only",
45
+ "Programming Language :: Python :: 3.9",
46
+ "Programming Language :: Python :: 3.10",
47
+ "Programming Language :: Python :: 3.11",
48
+ "Programming Language :: Python :: 3.12",
49
+ "Topic :: System :: Systems Administration",
50
+ "Topic :: Utilities",
51
+ ],
52
+ keywords="linux, disk, partition, mount, luks, smart, tui, cli",
53
+ )
@@ -0,0 +1,2 @@
1
+ __all__ = ["__version__"]
2
+ __version__ = "0.2.1"