Skip to main content

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.

PyPI version Python 3.9+ License: MIT Tests Code Style: Black Downloads

๐ŸŽฏ 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

๐ŸŒŸ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyautokit-1.0.0.tar.gz (64.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyautokit-1.0.0-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

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

Hashes for pyautokit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d3e4218b511b7b6eda7d60b8aced41f00f7a469efb697c4f0c42f66aa4b50087
MD5 7f443676f029dc1572541cc9400dc4bc
BLAKE2b-256 24399d6c8d660387159257e488e8be56c539f23001d2e414f64be6647513a60f

See more details on using hashes here.

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

Hashes for pyautokit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90c73f0a6f61d1864aad6c02300217650988f92ede73907a95f8725c0d1bd1df
MD5 dfc1c570db75efb2ae1070ea3c36a444
BLAKE2b-256 8bbc2caaf19c5c9fdb44ac7b405a87d34b6a8a719e2f53783afb938d60c22951

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page