A powerful command-line toolbox for Python developers, featuring Django project management, virtual environment handling, file operations, Git helpers, and AI context generation – all in one place.
- 🚀 Django Manager – Create projects, apps, run migrations, start development server.
- 🐍 Environment Manager – Create/delete virtual environments (
.venv/venv), manage.envfiles, check Python environment. - 📁 File Operations – List, copy, move, delete files/folders with safety confirmations and size calculations.
- 📊 File Statistics – Count files and folders by extension, see project size.
- 📄 Generate AI Context – Produce an optimised project snapshot for AI assistants (smart file selection, ignore patterns).
- 🔧 Git & Requirements – Generate/update
.gitignorefrom templates, createrequirements.txt, install packages. - 🧹 Clean pycache – Recursively delete all
__pycache__folders with space summary.
All tools are accessible via a clean, numbered menu.
- Python 3.6 or higher
- Git (optional, for cloning)
-
Clone the repository
git clone https://github.com/Alexashok99/dpm.git cd dpm -
(Optional) Create and activate a virtual environment
python -m venv .venv # Windows .venv\Scripts\activate # Linux/macOS source .venv/bin/activate
-
No external dependencies required – the tool uses only Python standard library.
-
Run the application
python main.py
When you run python main.py, you'll see the main menu:
==================================================
🛠 TOOL EXECUTER
==================================================
1. 🧹 Clean __pycache__ — Remove all __pycache__ folders recursively
2. 🚀 Django Manager — Create Django project, check, create app, migrate, runserver
3. 🐍 Environment Manager — Create/delete virtual env, create/delete .env file
4. 📊 File Statistics — Count files and folders by type
5. 📁 File Operations — List, copy, move, delete files and folders
6. 📄 Generate AI Context — Create optimized project context with filtering options for AI
7. 🔧 Git & Requirements — Manage .gitignore, requirements.txt, install packages
0. Exit
----------------------------------------
Select option:
Just enter the number of the tool you need and follow the interactive prompts.
The default directories and files to ignore (e.g., .git, __pycache__, .env) are stored in configs_file/config.py. You can modify the DEFAULT_IGNORE_DIRS and DEFAULT_IGNORE_FILES sets there, or use the tool’s interactive options (e.g., in Generate AI Context) to add custom exclusions.
Some tools (like Environment Manager) let you create .env files with common templates. The tool itself does not require any environment variables to run, but you can set the following to customise behaviour:
DPM_NO_COLOR– Set to any value to disable coloured output (not yet implemented, but reserved for future use).
A batch file dpm.bat is included in the project root. It allows you to run the tool from any command prompt by simply typing dpm.
It calls python main.py from the directory where the script is located, so you don't have to navigate to the project folder each time.
-
Copy
dpm.batto a folder in your PATH
For example, create a folderC:\binand add it to your system PATH:- Open System Properties → Advanced → Environment Variables
- Under System variables, select
Pathand click Edit - Add
C:\bin(or your chosen folder) - Copy
dpm.batinto that folder
-
Or add the project folder to PATH
Add the full path of thedpmproject folder to your PATH instead. Then you can rundpmfrom anywhere.
After either step, open a new Command Prompt and type:
dpmYou should see the main menu.
Create an alias in your ~/.bashrc or ~/.zshrc:
alias dpm='python3 /path/to/dpm/main.py'Then reload with source ~/.bashrc.
dpm/
├── configs_file/ # Configuration classes
│ └── config.py
├── tools/ # All tool implementations
│ ├── base_tool.py # Base class for all tools
│ ├── clean_pycache_script.py
│ ├── django_tool.py
│ ├── env_tool.py
│ ├── file_counter_tool.py
│ ├── file_ops_tool.py
│ ├── full_context_tool.py
│ ├── git_requirements_tool.py
│ └── loader.py # Dynamic tool loader
├── util/ # Utility functions
│ └── utils.py
├── main.py # Application entry point
├── dpm.bat # Windows launcher
└── README.md # This file
Contributions are welcome! Feel free to open issues or submit pull requests. Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some amazing feature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.
Alex Ashok
- GitHub: @Alexashok99
- Inspired by everyday development needs – from Django project setup to cleaning up
__pycache__. - Built with Python's standard library – no extra dependencies required.
Happy coding! 🚀