Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ› ๏ธ MyTools - Developer's Swiss Army Knife

PyPI Python Version License Stars Issues PRs Welcome

A powerful collection of CLI tools for Python developers
Clean cache, manage Django projects, handle virtual environments, and more - all in one place!


โœจ Features

๐Ÿงน Clean Python Cache Remove all __pycache__ folders recursively with space calculation
๐Ÿš€ Django Manager Create projects, apps, run migrations and server interactively
๐Ÿ Environment Manager Create/delete virtual environments, manage .env files
๐Ÿ“ File Operations Copy, move, delete, and list files with beautiful output
๐Ÿ“Š File Statistics Count files by extension, analyze project structure
๐Ÿ“„ AI Context Generator Generate optimized project context for AI assistants

๐Ÿš€ Quick Installation

Install from PyPI (Recommended)

pip install mytools

Install from GitHub

pip install git+https://github.com/Alexashok99/mytools.git

Development Installation

git clone https://github.com/Alexashok99/mytools.git
cd mytools
pip install -e .

๐ŸŽฎ Basic Usage

See all available tools

$ mytools list
๐Ÿ”ง Available tools:
  โ€ข clean-pycache โ€“ Remove all __pycache__ folders recursively
  โ€ข django โ€“ Interactive Django project manager
  โ€ข env โ€“ Virtual environment and .env helper
  ...

Get help

mytools --help
mytools clean-pycache --help

Clean Python cache

cd your-project-directory
mytools clean-pycache
๐Ÿ” Cleaning in: E:\projects\myproject
โœ… Deleted: __pycache__ (1.25 MB)
โœ… Deleted: src\__pycache__ (0.50 MB)
๐ŸŽฏ Summary: 2 folders deleted, 1.75 MB freed

Start Django manager

mytools django
DJANGO MANAGER
1. Create Django Project
2. Check Django Installation
3. Create Django App
...

๐Ÿ“š Detailed Documentation

Plugins & Extensions

MyTools is designed to be extendable. Thirdโ€‘party or custom tools can be registered using Python entry points under the mytools.plugins group. The package dynamically loads every tool listed there when it starts.

There is also a src/mytools/plugins/ package included for convenience โ€” it's empty by default but you may drop local plugin modules in there and add corresponding entry points during development.


๐Ÿงน Clean Python Cache

Removes all __pycache__ directories recursively from current path.

mytools clean-pycache --yes          # skip confirmation prompt
mytools clean-pycache --no-pause     # run without waiting at end
mytools clean-pycache
  • Shows folder size before deletion
  • Displays total space freed
  • Safe - asks for confirmation

๐Ÿš€ Django Manager

Interactive Django project and app management.

mytools django

Features:

  • Create new Django projects
  • Check Django installation
  • Create Django apps
  • Make and apply migrations
  • Run development server

๐Ÿ Environment Manager

Virtual environment and .env file management.

mytools env

Features:

  • Create virtual environments (.venv, venv, custom)
  • Delete virtual environments
  • Create .env file with templates
  • Delete .env files
  • List environment variables
  • Check Python environment

๐Ÿ“ File Operations

Comprehensive file and folder management.

mytools file-ops

Features:

  • List all files with sizes
  • Copy files/folders
  • Move files/folders
  • Delete files/folders
  • File information
  • Create folders and files
  • Export file lists

๐Ÿ“Š File Statistics

Analyze your project structure.

mytools file-counter

Output:

๐Ÿ“ Project: myproject
๐Ÿ“ Path: E:/projects/myproject

๐Ÿ“ˆ Statistics:
   โ€ข Total folders: 42
   โ€ข Total files: 156

๐Ÿ“„ Files by extension:
   โ€ข .py: 89
   โ€ข .md: 23
   โ€ข .json: 12
   โ€ข .txt: 8
   โ€ข .yml: 5
   โ€ข [no extension]: 19

๐Ÿ“„ AI Context Generator

Generate optimized context for AI assistants.

mytools context

Features:

  • Smart file selection (prioritizes important files)
  • Custom ignore patterns
  • Project tree visualization
  • File content extraction
  • Size limits to prevent overflow

โš™๏ธ Configuration

Create .env file in your project directory:

# MyTools Configuration
MYTOOLS_LOG_LEVEL=INFO          # DEBUG, INFO, WARNING, ERROR
MYTOOLS_MAX_FILE_SIZE=100000    # Max file size to read (bytes)
MYTOOLS_MAX_TOTAL_SIZE=500000   # Max total context size (bytes)

Or set environment variables directly:

# Windows
set MYTOOLS_LOG_LEVEL=DEBUG

# Linux/Mac
export MYTOOLS_LOG_LEVEL=DEBUG

๐Ÿงช Development Setup

# Clone repository
git clone https://github.com/Alexashok99/mytools.git
cd mytools

# Create virtual environment
python -m venv .venv
# Activate it:
# Windows: .venv\Scripts\activate
# Linux/Mac: source .venv/bin/activate

# Install in editable mode with dev dependencies
pip install -e .[dev]

# Run tests
pytest tests/ --cov=mytools

# Format code
black src/ tests/

# Lint code
ruff check src/ tests/

# Type check
mypy src/

๐Ÿ“ Project Structure

mytools/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ mytools/
โ”‚       โ”œโ”€โ”€ __init__.py          # Package version
โ”‚       โ”œโ”€โ”€ __main__.py          # python -m support
โ”‚       โ”œโ”€โ”€ cli.py              # Typer CLI application
โ”‚       โ”œโ”€โ”€ config.py           # Pydantic settings
โ”‚       โ”œโ”€โ”€ utils.py            # Helper functions
โ”‚       โ””โ”€โ”€ tools/              # All CLI tools
โ”‚           โ”œโ”€โ”€ base.py         # BaseTool abstract class
โ”‚           โ”œโ”€โ”€ clean_pycache.py
โ”‚           โ”œโ”€โ”€ django_manager.py
โ”‚           โ”œโ”€โ”€ env_manager.py
โ”‚           โ”œโ”€โ”€ file_ops.py
โ”‚           โ”œโ”€โ”€ file_counter.py
โ”‚           โ””โ”€โ”€ context_generator.py
โ”œโ”€โ”€ tests/                      # Unit tests
โ”‚   โ”œโ”€โ”€ test_cli.py
โ”‚   โ””โ”€โ”€ test_tools/
โ”œโ”€โ”€ pyproject.toml             # Package configuration
โ”œโ”€โ”€ README.md                  # This file
โ”œโ”€โ”€ LICENSE                    # MIT License
โ””โ”€โ”€ .gitignore                # Git ignore rules

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. ๐Ÿ› Report bugs - Open an issue
  2. โœจ Suggest features - Open an issue with enhancement tag
  3. ๐Ÿ“ Improve docs - Fix typos, add examples
  4. ๐Ÿ”ง Submit PRs - Fix bugs, add features

Development workflow:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing)
  5. Open a Pull Request

Guidelines:

  • Follow PEP 8 style guide
  • Add tests for new features
  • Update documentation
  • Use Black formatter
  • Run Ruff linter

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

Your Name


โญ Support

If you find this project useful, please consider:

  • Giving a โญ star on GitHub
  • ๐Ÿ“ค Sharing with fellow developers
  • ๐Ÿ› Reporting issues
  • ๐Ÿ”ง Contributing code

Made with โค๏ธ for Python developers

About

A powerful collection of CLI tools for Python developers Clean cache, manage Django projects, handle virtual environments, and more - all in one place!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages