Skip to content

Gzeu/pyautokit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 πŸš€

About

Python Automation Toolkit - Complete automation utilities for file organization, web scraping, email, backups, and blockchain monitoring

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors