A professional terminal-based disk partition utility built with Python and Textual, providing an intuitive interface for Windows disk management operations.
Disk Partition Manager is a modern, user-friendly wrapper around Windows' native diskpart utility. It features a clean terminal user interface built with Textual, making complex disk operations accessible through simple menu navigation.
- π₯οΈ Interactive TUI: Clean, professional terminal interface
- πΎ Disk Management: List, clean, and partition disk drives
- π Safe Operations: Clear prompts and confirmation workflows
- β‘ Quick Setup: Single-file executable with batch launcher
- π― Windows Native: Leverages Windows diskpart for reliable operations
Microsoft Disk Partition Utility
Created by Hardik Kawale
> List Disks
> Clean Disk
> Create Partition
> Exit
- Operating System: Windows 10/11 or Windows Server 2016+
- Python: Version 3.8 or higher
- Privileges: Administrator rights (required for disk operations)
- Dependencies: Textual library
-
Clone the repository:
git clone https://github.com/Hardik-369/Disk_tool.git cd Disk_tool -
Install dependencies:
pip install textual
-
Run as Administrator:
# Using the batch launcher run.bat # Or directly with Python python disk_tool.py
python -m venv venv
venv\Scripts\activate
pip install textual
python disk_tool.py| Option | Description |
|---|---|
| List Disks | Display all available disk drives with detailed information |
| Clean Disk | Completely wipe a selected disk ( |
| Create Partition | Create new primary partition with NTFS formatting |
| Exit | Safely close the application |
- Select "List Disks" from main menu
- View comprehensive disk information
- Note disk numbers for subsequent operations
- Select "Clean Disk"
- Enter the disk number (from disk list)
- Confirm operation
- Monitor progress and results
- Select "Create Partition"
- Specify target disk number
- Enter partition size in MB
- Automatic NTFS formatting and drive letter assignment
disk-partition-manager/
βββ disk_tool.py # Main application file
βββ disk_tool.bat # Windows batch launcher
βββ README.md # This documentation
The application follows a modular screen-based architecture:
- MainMenu: Primary navigation interface
- ListDisksScreen: Disk enumeration and display
- CleanDiskScreen: Disk wiping operations
- CreatePartitionScreen: Partition creation workflow
- ResultScreen: Operation results and feedback
textual>=0.40.0 # Modern TUI frameworkThe tool generates temporary diskpart scripts for each operation, ensuring:
- Atomic operations
- Error handling
- Output capture
- Clean script management
- Administrator Privileges: Required for all disk operations
- Data Loss Prevention: Clear warnings before destructive operations
- Input Validation: Disk numbers and sizes are validated
- Temporary Files: Scripts are automatically cleaned up
The application includes comprehensive error handling for:
- Invalid disk numbers
- Insufficient permissions
- Diskpart execution failures
- File system errors
- Input validation errors
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
git clone https://github.com/yourusername/disk-partition-manager.git
cd disk-partition-manager
python -m venv dev-env
dev-env\Scripts\activate
pip install textual pytest black flake8- Follow PEP 8 style guidelines
- Use type hints where appropriate
- Include docstrings for all functions
- Write unit tests for new features
| Issue | Solution |
|---|---|
| "Access Denied" | Run as Administrator |
| "Python not found" | Ensure Python is in system PATH |
| "Textual not found" | Install with pip install textual |
| "Disk not accessible" | Check disk connection and permissions |
Enable verbose output:
python disk_tool.py --debug- Initial release
- Basic disk operations (list, clean, partition)
- Textual-based TUI
- Windows batch launcher
- Linux/macOS support
- Advanced partition types (GPT, extended)
- Disk health monitoring
- Configuration file support
- Logging system
- Multi-disk operations
This project is licensed under the MIT License - see the LICENSE file for details.
Hardik Kawale
- GitHub: @hardikkawale
- Textual - Modern Python TUI framework
- Microsoft Diskpart - Windows disk partitioning utility
- Python Community - For excellent documentation and support
This software is provided "AS IS" without warranty. Users are responsible for data backup before performing disk operations. The author is not liable for any data loss or system damage resulting from the use of this software.
β Star this repository if it helped you!
Made with β€οΈ by Hardik Kawale