document-python-direct-exec
Skill by HKUDS
Document Python Direct Exec guides an AI assistant to run Python scripts directly for spreadsheet and PDF or Word document tasks. It is aimed at complex, multi-step file work that the shell_agent tool may handle poorly.
Install document-python-direct-exec
Built from the published package, never by AI.
git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.claude/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-343937 ~/.claude/skills/document-python-direct-execRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install document-python-direct-exec in Claude Code
git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-343937 ~/.gemini/antigravity-cli/skills/document-python-direct-execAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install document-python-direct-exec in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill tells an AI assistant to use direct run_shell calls with Python scripts for structured document work. It covers Excel spreadsheets with multiple sheets, formulas and formatting, PDF checklists, reports, invoices and forms, and Word or HTML output. The source says this approach avoids shell_agent step limits, unclear formatting errors, and heredoc parsing failures.
The skill recommends writing a complex script to a .py file first, then running it with python3. It includes examples using pandas, openpyxl, reportlab and fpdf, plus error handling, a library reference table and troubleshooting notes. It is intended for users and assistants handling multi-step spreadsheet or document generation tasks in Python.
Written from the project's SKILL.md and checked against it.
What it can do
- Spreadsheet processingReads and writes multi-sheet Excel files, applies formulas, formatting and data transformations.
- PDF generationCreates PDF checklists, reports, invoices and forms with precise layout control using reportlab or fpdf.
- Word and HTML outputCreates Word documents with python-docx and HTML reports, and converts HTML to PDF with weasyprint.
- Script-file executionWrites complex Python scripts to a .py file and runs them with python3 to avoid heredoc issues.
- Troubleshooting guidanceGives fixes for FileNotFoundError, PermissionError, ModuleNotFoundError, MemoryError and PDF layout problems.
What you need
- Python 3 with python3 available in the shell
- Shell execution through run_shell
- pip install reportlab openpyxl pandas
- Other libraries as needed, such as fpdf, python-docx or weasyprint
Try asking
- Read the Revenue sheet from input.xlsx and add a Net_Revenue column.
- Generate a PDF safety checklist from these five items.
- Create a formatted Excel report with a styled header row.
Good to know
- Not intended for simple single-cell reads or writes.
- Not suited to operations that need interactive user input.
- Not suited to tasks where the agent must iteratively refine its approach.
- Suggests pandoc instead when a simpler CLI tool exists for the format.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-343937/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
.skill_id53 B -
SKILL.md11 KB
Alternatives to document-python-direct-exec
All alternatives →Creates importable JSON templates for the Obsidian Web Clipper. It is for users who want to clip a site, understand the available variables, or format clipped content.
Harness Creator builds, audits, and improves the instruction and state files that help AI coding agents stay reliable across sessions. It is for developers whose agents forget context, drift out of scope, or claim work is done too early.
Guides an assistant through extracting text from scanned PDFs, photographed pages, and images with OCR. Covers backends, language packs, force-OCR, and performance tuning.
Edits a named local file in place to remove AI-writing patterns, using minimal targeted changes and post-edit verification. Built for users who explicitly ask to clean, rewrite, or humanize that specific file.
Polishes, translates, or tightens existing academic manuscript prose while preserving facts, terminology, and evidence boundaries. Made for researchers revising drafts, including Chinese-to-English translation and LaTeX layout fixes.
Adds PDF form analysis and filling, table extraction, OCR, validation and batch processing to an AI assistant. Aimed at developers who run complex or high-volume PDF workflows.
Compare with obsidian-clipper-template-creator, harness-creator or xberg-extracting-with-ocr
document-python-direct-exec: common questions
Why use direct Python execution instead of shell_agent?
The source says shell_agent can hit step limits, give unexplained formatting errors, and fail to parse heredoc syntax. Direct run_shell with Python runs in a single step with clearer error messages.
Which Python libraries does this skill cover?
The source lists openpyxl, pandas, xlrd, xlsxwriter, reportlab, fpdf, python-docx and weasyprint, with a note on which to use for each task.
What should I do if a heredoc gives an unknown error?
The source recommends writing the Python script to a .py file first, then running it with python3 script.py. It says this is more reliable when shell_agent is the executor.
How do I install document-python-direct-exec?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is document-python-direct-exec free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is document-python-direct-exec safe to use?
It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to document-python-direct-exec?
Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.
