Python Automation Toolkit - Complete CLI utilities for everyday tasks
Project description
PyAutokit ๐
Python Automation Toolkit - A comprehensive, production-ready collection of automation utilities for everyday tasks.
๐ฏ Overview
PyAutokit is a modular Python toolkit with 11 complete automation modules. Each module has a complete CLI with argparse and can be used programmatically. All modules are standalone, well-documented, and tested.
๐ฆ Installation
Quick Install
# Basic installation
pip install pyautokit
# With browser automation (Playwright)
pip install 'pyautokit[browser]'
playwright install # Download browser binaries
# With file watching
pip install 'pyautokit[watch]'
# With everything
pip install 'pyautokit[all]'
From Source
git clone https://github.com/Gzeu/pyautokit.git
cd pyautokit
pip install -e '.[all]'
See INSTALLATION.md for detailed installation guide.
โก Quick Start
# Organize files
pyautokit-organizer ~/Downloads --method category --dry-run
# Monitor crypto prices
pyautokit-crypto --coin EGLD --coin BTC
# Generate secure password
pyautokit-security genpass --length 20
# GitHub automation
pyautokit-github list-repos --user Gzeu
# Browser automation
pyautokit-browser screenshot https://example.com -o page.png
# Convert data
pyautokit-data convert data.csv --to json
โจ All Modules (11 Total)
| Module | CLI Command | Description | Test Coverage |
|---|---|---|---|
| ๐ File Organizer | pyautokit-organizer |
Organize files by category/date/size | 95%+ |
| ๐ Web Scraper | pyautokit-scraper |
Scrape with BeautifulSoup4 | Partial |
| ๐ง Email Automation | pyautokit-email |
SMTP with templates | Partial |
| ๐พ Backup Manager | pyautokit-backup |
Versioned backups (ZIP/TAR/TAR.GZ) | Partial |
| ๐ Log Analyzer | pyautokit-logs |
Parse and analyze logs | Partial |
| ๐ Data Processor | pyautokit-data |
CSV/JSON conversion & transforms | Partial |
| ๐ Security Utils | pyautokit-security |
Encryption, hashing, passwords | Partial |
| โ๏ธ Blockchain Monitor | pyautokit-crypto |
Crypto price tracking | 80%+ |
| ๐ง API Client | pyautokit |
REST API with retry logic | Partial |
| ๐ GitHub Utils | pyautokit-github |
Repo/Issue/PR management | 80%+ |
| ๐ญ Playwright Browser | pyautokit-browser |
Browser automation & testing | 80%+ |
๐ Feature Details
๐ File Organizer
- Organize by extension, date, category, or size
- Smart categorization (Documents, Images, Videos, Code)
- Dry-run mode for safe testing
- Auto-watch mode for continuous organization
- Duplicate handling (rename, skip, overwrite)
- Directory statistics
๐ Web Scraper
- Ethical scraping with rate limiting
- BeautifulSoup4 for static sites
- CSS selector support
- Link extraction and text parsing
- Session management
๐ง Email Automation
- SMTP support (Gmail, custom servers)
- Template-based personalization
- Bulk email sending from CSV/JSON
- Attachment support
- HTML and plain text emails
- Dry-run mode
๐พ Backup Manager
- Multiple compression formats (ZIP, TAR, TAR.GZ)
- Version management (keep N backups)
- Incremental backups
- Easy restore functionality
- Backup listing and filtering
๐ Log Analyzer
- Parse common log formats
- Extract errors, warnings, patterns
- IP address and email extraction
- Timestamp analysis
- Statistical summaries
- Time range filtering
๐ Data Processor
- CSV โ JSON conversion
- Data filtering and transformation
- Aggregation (sum, avg, min, max, count)
- Deduplication by key
- Batch processing
๐ Security Utils
- File encryption/decryption (Fernet)
- Password-based key derivation (PBKDF2)
- Secure password generation
- Hashing utilities (MD5, SHA256, SHA512)
- Token generation
- Key generation
โ๏ธ Blockchain Monitor
- Real-time crypto price monitoring
- Support for EGLD, BTC, ETH, BNB, SOL
- 24h change tracking
- Market cap and volume data
- Trending coins detection
- Price alerts
- Continuous monitoring mode
๐ GitHub Utils (NEW!)
- Create, list, delete repositories
- Manage issues (create, list, close, update)
- Manage pull requests (create, list, merge)
- Create releases and tags
- Trigger GitHub Actions workflows
- Complete GitHub API integration
- Authentication with tokens
๐ญ Playwright Browser Automation (NEW!)
- Multi-browser support (Chromium, Firefox, WebKit)
- Screenshot capture (full page, element-specific)
- PDF generation from web pages
- Web scraping (dynamic sites)
- Form filling and submission
- Click sequences and interactions
- HTTP authentication
- Mobile device emulation
- Network request monitoring
- JavaScript execution
- Headless and headed modes
๐ป CLI Commands
Available Commands
pyautokit # Unified CLI entry point
pyautokit-organizer # File organization
pyautokit-scraper # Web scraping (BeautifulSoup)
pyautokit-email # Email automation
pyautokit-backup # Backup management
pyautokit-logs # Log analysis
pyautokit-data # Data processing
pyautokit-security # Encryption & security
pyautokit-crypto # Blockchain monitoring
pyautokit-github # GitHub automation (NEW!)
pyautokit-browser # Browser automation (NEW!)
Quick Examples
# File Organization
pyautokit-organizer ~/Downloads --method category --dry-run
pyautokit-organizer ~/Downloads --watch --interval 30
# Crypto Monitoring
pyautokit-crypto --coin EGLD
pyautokit-crypto --coin BTC --coin ETH --monitor --interval 300
# Security
pyautokit-security genpass --length 20
pyautokit-security encrypt file.txt file.enc --password secret
pyautokit-security hash file.txt --file --algorithm sha256
# Data Processing
pyautokit-data convert data.csv --to json
pyautokit-data filter data.json --field status=active
pyautokit-data aggregate data.json --field price --operation avg
# Backup
pyautokit-backup create ./myproject --compression tar.gz
pyautokit-backup list
pyautokit-backup restore backup.tar.gz ./restored
# GitHub (NEW!)
pyautokit-github list-repos --user Gzeu
pyautokit-github create-repo my-project --private
pyautokit-github list-issues --owner Gzeu --repo pyautokit
# Browser Automation (NEW!)
pyautokit-browser screenshot https://example.com -o page.png --full-page
pyautokit-browser pdf https://docs.com -o doc.pdf --format A4
pyautokit-browser scrape https://news.com -s "titles:h1" -o results.json
pyautokit-browser --browser firefox --headed screenshot https://example.com -o ff.png
๐ Programmatic Usage
File Organization
from pyautokit import FileOrganizer
from pathlib import Path
organizer = FileOrganizer(dry_run=False)
results = organizer.organize_by_category(Path("~/Downloads"))
print(f"Organized into {len(results)} categories")
Blockchain Monitoring
from pyautokit import BlockchainMonitor
monitor = BlockchainMonitor()
price_data = monitor.get_price("EGLD")
print(f"EGLD: ${price_data['price']} ({price_data['change_24h']:.2f}%)")
GitHub Automation
from pyautokit import GitHubUtils
gh = GitHubUtils(token="your-github-token")
# Create repository
repo = gh.create_repository("my-project", private=True)
# Create issue
issue = gh.create_issue(
"Gzeu", "pyautokit",
"Feature request",
"Add awesome feature"
)
# List PRs
prs = gh.list_pull_requests("Gzeu", "pyautokit", state="open")
Browser Automation
import asyncio
from pyautokit import PlaywrightUtils
async def automate():
async with PlaywrightUtils() as pw:
# Screenshot
await pw.screenshot(
"https://example.com",
"page.png",
full_page=True
)
# Scrape dynamic content
data = await pw.scrape(
"https://news.com",
{"titles": "h1", "links": "a"}
)
# Fill form
await pw.fill_form(
"https://app.com/login",
{"#email": "user@test.com", "#password": "pass"},
submit_selector="#submit"
)
asyncio.run(automate())
Security Utils
from pyautokit import SecurityUtils
utils = SecurityUtils()
# Generate password
password = utils.generate_password(length=20)
# Encrypt file
utils.encrypt_file("secret.txt", "secret.enc", password="mypass")
# Hash file
file_hash = utils.hash_file("file.txt", algorithm="sha256")
Data Processing
from pyautokit import DataProcessor
from pathlib import Path
processor = DataProcessor()
# Convert CSV to JSON
data = processor.csv_to_json(Path("data.csv"))
# Filter data
filtered = processor.filter_data(data, {"status": "active"})
# Aggregate
avg_price = processor.aggregate(data, "price", "avg")
print(f"Average price: ${avg_price:.2f}")
๐ Working Examples
| Example | File | Description |
|---|---|---|
| File Organization | examples/organize_downloads.py |
Auto-organize with watch mode |
| Crypto Monitoring | examples/monitor_egld.py |
Real-time price monitoring |
| Web Scraping | examples/scrape_news.py |
Scrape news headlines |
| Bulk Emails | examples/send_bulk_emails.py |
Send templated emails |
| Backup Automation | examples/backup_project.py |
Automated backups |
| Log Analysis | examples/analyze_logs.py |
Parse server logs |
| GitHub Automation | examples/github_automation.py |
Repo & issue management |
| Browser Automation | examples/playwright_automation.py |
Screenshots, PDFs, scraping |
Run examples:
python examples/organize_downloads.py --watch
python examples/monitor_egld.py
python examples/playwright_automation.py
๐งช Testing
# Install dev dependencies
pip install 'pyautokit[dev]'
# Run all tests
pytest
# With coverage
pytest --cov=pyautokit --cov-report=html
# Test specific module
pytest tests/test_file_organizer.py -v
pytest tests/test_blockchain_monitor.py -v
pytest tests/test_playwright_utils.py -v
# Run async tests
pytest tests/test_playwright_utils.py -v -m asyncio
Test Coverage:
file_organizer.py- 95%+blockchain_monitor.py- 80%+github_utils.py- 80%+playwright_utils.py- 80%+
๐ฆ Publishing to PyPI
See PUBLISHING.md for complete PyPI publishing guide.
Quick reference:
# Build
python -m build
# Check
twine check dist/*
# Upload to PyPI
twine upload dist/*
๐ Project Structure
pyautokit/
โโโ pyautokit/ # Main package
โ โโโ __init__.py # Package exports
โ โโโ __main__.py # โ
Unified CLI
โ โโโ file_organizer.py # โ
CLI + 95% tests
โ โโโ web_scraper.py # โ
Complete CLI
โ โโโ email_automation.py # โ
Complete CLI
โ โโโ backup_manager.py # โ
Complete CLI
โ โโโ log_analyzer.py # โ
Complete CLI
โ โโโ data_processor.py # โ
Complete CLI
โ โโโ security_utils.py # โ
Complete CLI
โ โโโ blockchain_monitor.py # โ
CLI + 80% tests
โ โโโ github_utils.py # โ
CLI + 80% tests (NEW!)
โ โโโ playwright_utils.py # โ
CLI + 80% tests (NEW!)
โโโ examples/ # Working examples (8 files)
โโโ tests/ # Test suite (11 test files)
โโโ .github/workflows/ # CI/CD pipelines
โโโ setup.py # โ
PyPI setup
โโโ pyproject.toml # โ
Build config
โโโ PUBLISHING.md # โ
PyPI guide
โโโ INSTALLATION.md # โ
Install guide
โโโ CONTRIBUTING.md # โ
Contribution guide
๐ค Contributing
Contributions are welcome! Please:
- 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
See CONTRIBUTING.md for detailed guidelines.
๐ License
MIT License - Free for personal and commercial use. See LICENSE for details.
๐ค Author
George Pricop
- ๐ Blockchain Developer & AI Automation Specialist
- ๐ผ Building on MultiversX (EGLD) ecosystem
- ๐ Constanศa, Romania
- ๐ GitHub: @Gzeu
- ๐ More projects
๐ Links
- PyPI: pypi.org/project/pyautokit
- GitHub: github.com/Gzeu/pyautokit
- Issues: Report bugs
- Examples: Working examples
- Installation: INSTALLATION.md
- Publishing: PUBLISHING.md
- Contributing: CONTRIBUTING.md
๐ Star History
If you find PyAutokit useful, please give it a โญ on GitHub!
Built with โค๏ธ for automation enthusiasts.
Install now: pip install pyautokit ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyautokit-1.0.0.tar.gz.
File metadata
- Download URL: pyautokit-1.0.0.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3e4218b511b7b6eda7d60b8aced41f00f7a469efb697c4f0c42f66aa4b50087
|
|
| MD5 |
7f443676f029dc1572541cc9400dc4bc
|
|
| BLAKE2b-256 |
24399d6c8d660387159257e488e8be56c539f23001d2e414f64be6647513a60f
|
File details
Details for the file pyautokit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyautokit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90c73f0a6f61d1864aad6c02300217650988f92ede73907a95f8725c0d1bd1df
|
|
| MD5 |
dfc1c570db75efb2ae1070ea3c36a444
|
|
| BLAKE2b-256 |
8bbc2caaf19c5c9fdb44ac7b405a87d34b6a8a719e2f53783afb938d60c22951
|