document-python-direct
Skill by HKUDS
Runs Python scripts directly for spreadsheet and PDF work, such as Excel edits and PDF report generation. Written for AI assistants that need a more reliable path than shell_agent for complex document tasks.
Install document-python-direct
Built from the published package, never by AI.
git clone --depth 1 https://github.com/HKUDS/OpenSpace /tmp/OpenSpace && mkdir -p ~/.claude/skills && cp -r /tmp/OpenSpace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-f07ee1 ~/.claude/skills/document-python-directRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/HKUDS/OpenSpace /tmp/OpenSpace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/OpenSpace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-f07ee1 ~/.gemini/antigravity-cli/skills/document-python-directAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install document-python-direct in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Direct Python Execution for Document and Spreadsheet Tasks is an agent skill that tells an AI assistant to run Python scripts with run_shell for spreadsheet and PDF work. It covers reading and writing Excel files, applying formulas and formatting, and generating PDF reports, checklists, or forms. The skill names openpyxl, pandas, reportlab, fpdf2, xlrd, xlsxwriter and python-docx as common libraries.
The guide says a script should be written to a .py file first and then executed, because the shell_agent tool can hit step limits and fail on heredoc syntax. It includes examples for Excel transforms, multi-sheet work, formatting, reportlab and fpdf2 PDFs, and an error handling pattern. It is aimed at developers and agents who need reliable control over complex document operations.
Written from the project's SKILL.md and checked against it.
What it can do
- Excel reading and writingReads and writes complex Excel files with multiple sheets using openpyxl or pandas.
- Spreadsheet formattingApplies formulas, cell formatting and data transformations to spreadsheets.
- PDF reportsGenerates PDF reports with reportlab for complex layouts.
- PDF checklistsCreates simple PDF checklists and basic documents with fpdf2.
- Spreadsheet to PDF workflowProcesses spreadsheet data and writes a summary PDF in one script.
- Word documentsLists python-docx for creating and editing Word documents.
- Error handlingWraps scripts in try and except blocks with clear error messages.
What you need
- Python 3 with the python3 command
- Access to the run_shell tool
- pip to install openpyxl, pandas, reportlab or fpdf2
Try asking
- Process data.xlsx and save a formatted copy with a blue header row.
- Create a PDF safety checklist with four items using fpdf2.
- Read the Revenue sheet in input.xlsx and add a Net_Revenue column.
Good to know
- Not intended for simple single-cell reads or writes.
- Not for operations that need interactive user input.
- PDF text needs Unicode-compatible fonts to avoid encoding errors.
- Very large files may need chunked processing with pandas.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: benchmarks/gdpval/skills/spreadsheet-direct-python-merged-f07ee1/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to document-python-direct
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: common questions
When should I use this skill instead of shell_agent?
The source recommends it for complex multi-step spreadsheet or PDF work that may exceed agent step limits, or when heredoc parsing fails.
Which Python libraries does it cover?
It names openpyxl, pandas, xlrd, xlsxwriter, reportlab, fpdf2 and python-docx.
What should I do if a heredoc script fails with an unknown error?
The source says to write the script to a .py file and run it with python3 script.py, which it describes as more reliable.
How do I install document-python-direct?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is document-python-direct free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is document-python-direct safe to use?
It scores 86 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?
Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.
