← 返回
未分类

Python Automation

Full-stack Python automation toolkit for file processing, data extraction, PDF manipulation, Excel/workbook automation, web scraping, and system tasks. Use w...
全栈 Python 自动化工具包,用于文件处理、数据抽取、PDF 操作、Excel/工作表自动化、网页爬取以及系统任务。使用 w...
ericlooi504
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 390
下载
💾 0
安装
1
版本
#latest

概述

Python Automation

Core Libraries Quick Reference

TaskLibraryInstallation
----------------------------
File systempathlib, shutil, osstdlib
CSVcsvstdlib
Excelopenpyxlpip install openpyxl
Excel (old)xlrd / xlwtpip install xlrd xlwt
PDF textPyMuPDF (fitz)pip install PyMuPDF
PDF tablescamelot-py / tabula-pypip install camelot-py
Web scrapingrequests + BeautifulSoup4pip install requests beautifulsoup4
Browser automationplaywright or seleniumpip install playwright
CLIargparse (stdlib) or clickstdlib / pip install click
Rich terminalrichpip install rich
File watchingwatchdogpip install watchdog
Schedulingschedule or cronpip install schedule

Common Patterns

1. Batch File Processing

from pathlib import Path

for f in Path(".").glob("**/*.txt"):
    content = f.read_text()
    # transform content
    f.write_text(content)

2. CSV Read/Write

import csv
with open("input.csv", newline="") as f:
    reader = csv.DictReader(f)
    for row in reader:
        print(row["column_name"])

with open("output.csv", "w", newline="") as f:
    writer = csv.writer(f)
    writer.writerow(["col1", "col2"])
    writer.writerow(["val1", "val2"])

3. Excel Generation

from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws["A1"] = "Hello"
ws["B1"] = 42
wb.save("output.xlsx")

4. Web Scraping

import requests
from bs4 import BeautifulSoup

resp = requests.get("https://example.com", timeout=10)
soup = BeautifulSoup(resp.text, "html.parser")
for link in soup.select("a[href]"):
    print(link["href"], link.text.strip())

Scripts

See scripts/ for ready-to-use automation scripts:

  • rename_batch.py — Batch rename files with pattern matching
  • csv_to_excel.py — Convert CSV files to Excel workbooks

Reference Files

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 03:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Docker Ops

ericlooi504
Docker 容器生命周期管理、健康检查、日志分析、清理、Docker Compose 编排与故障排查。用于 Codex 需要管理 Docker 时。
★ 0 📥 349

GTS Ecommerce Price Monitor

ericlooi504
自动监测 Shopee、Lazada、Amazon 等平台竞争对手的产品价格,提供提醒、报告和趋势分析,实现更智能的定价。
★ 0 📥 373

Web Scraper

ericlooi504
Python网页抓取工具包,实现数据提取、分页处理、反封锁技术、Selenium处理JS密集型网站以及结构化输出(JSON等)
★ 0 📥 348