A collection of reusable Python utility scripts to help with everyday tasks. This project is designed to grow with daily contributions and improvements.
python_utils_toolkit/
├── utils/
│ ├── __init__.py
│ ├── file_utils.py # File operations (copy, move, rename, search)
│ ├── text_utils.py # Text processing (parse, format, validate)
│ ├── date_utils.py # Date/time operations
│ ├── web_utils.py # Web utilities (download, scrape, API helpers)
│ └── system_utils.py # System utilities (disk space, process info)
├── examples/
│ └── demo_scripts.py # Example usage of utilities
├── tests/
│ └── test_utils.py # Unit tests
├── requirements.txt
└── README.md
# Clone the repository
git clone <your-repo-url>
cd python_utils_toolkit
# Install dependencies
pip install -r requirements.txtfind_files()- Search files by patternget_file_info()- Get file metadatabatch_rename()- Rename multiple filesfind_duplicates()- Find duplicate filesorganize_by_extension()- Organize files by type
extract_emails()- Extract emails from textextract_urls()- Extract URLs from textword_frequency()- Count word occurrencesslugify()- Convert text to URL-friendly slugvalidate_email()- Validate email format
time_ago()- Human-readable time differencebusiness_days_between()- Calculate business daysformat_duration()- Format seconds to readable durationget_week_dates()- Get all dates in a week
download_file()- Download file with progress baris_url_valid()- Check if URL is accessibleget_page_title()- Get webpage titleshorten_url()- URL shortener helper
get_disk_usage()- Get disk space infoget_system_info()- Get OS and hardware infofind_large_files()- Find large files in directorymonitor_process()- Monitor process resource usage
from utils.file_utils import find_files, get_file_info
from utils.text_utils import extract_emails, slugify
from utils.date_utils import time_ago
# Find all Python files
python_files = find_files(".", "*.py")
# Extract emails from text
emails = extract_emails("Contact us at hello@example.com")
# Get human-readable time
print(time_ago(datetime(2024, 1, 1))) # "11 months ago"This project grows with daily contributions! Here are areas you can improve:
- Add new utility functions - Think of common tasks you do repeatedly
- Improve existing functions - Add error handling, edge cases
- Add unit tests - Increase test coverage
- Add documentation - Improve docstrings and examples
- Performance optimizations - Make functions faster
- Add CLI support - Make utilities runnable from command line
- Add type hints - Improve code quality
- Fix bugs - Address edge cases and issues
- Add JSON/CSV/XML parsing utilities
- Add image processing utilities
- Add encryption/hashing utilities
- Add logging utilities
- Add configuration management
- Add database utilities
- Add email sending utilities
- Add PDF utilities
- Add archive (zip/tar) utilities
- Add network utilities
Now that you've built a comprehensive Python utils toolkit, here's your next challenge:
Build a CLI Tool for the Utils Toolkit
Create a command-line interface that allows users to access all utility functions from the terminal. This will make your utilities more accessible and demonstrate advanced CLI development skills.
Requirements:
- Use
argparseorclickfor CLI parsing - Support all major utility functions (file, text, date, web, system)
- Include help documentation for each command
- Add progress bars for long-running operations
- Support both interactive and batch modes
- Include configuration file support
- Add colored output for better user experience
Example Usage:
# File operations
python -m utils.cli find-files --pattern "*.py" --directory ./src
python -m utils.cli organize-files --source ./downloads --by extension
# Text processing
python -m utils.cli extract-emails --file document.txt
python -m utils.cli slugify "Hello World! How are you?"
# System info
python -m utils.cli system-info
python -m utils.cli disk-usage C:/Bonus Challenges:
- Add shell completion support (bash/zsh/fish)
- Create a web API version of the utilities
- Add logging and audit trails
- Implement plugin architecture for extensibility
- Create a GUI version using tkinter or web interface
Learning Objectives:
- CLI application development
- Argument parsing and validation
- Cross-platform compatibility
- Error handling and user feedback
- Code organization for CLI tools
MIT License - Feel free to use, modify, and distribute.
Your Name
This toolkit is designed to be a living project with continuous improvements. Star the repo and check back for updates!