मुख्य सामग्री पर जाएँ
Skillpedia
PDF, Word और स्लाइड7.8k · #13012

document-python-direct-exec

यह क्या करती है

यह स्किल AI एजेंट को स्प्रेडशीट, PDF और दस्तावेज़ के काम के लिए Python सीधे चलाना सिखाती है। यह उन लोगों के लिए है जिनके दस्तावेज़ काम शेल एजेंट की स्टेप सीमा या अस्पष्ट गड़बड़ियों में अटकते हैं।

कब इस्तेमाल करें

  • ✓जब दस्तावेज़ का काम कई चरणों का हो और शेल एजेंट की स्टेप सीमा पार हो सकती है।
  • ✓जब आपको सटीक लेआउट वाली PDF चेकलिस्ट, रिपोर्ट या फ़ॉर्म चाहिए।
  • ✓जब आप चाहते हैं कि गड़बड़ी होने पर साफ़ और तुरंत संदेश मिले।

Skill का लिंक

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-343937/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/spreadsheet-direct-python-merged-343937/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे ऑनबोर्डिंग के लिए एक PDF चेकलिस्ट और Excel ट्रैकर बनाइए। Python सीधे चलाइए, ताकि कोई गड़बड़ी हो तो साफ़ संदेश मिले।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट Python स्क्रिप्ट को फ़ाइल में लिखता है और उसे एक ही शेल चरण में चलाता है। शेल एजेंट की सीमाएं न होने से स्क्रिप्ट पूरा काम कर सकती है और गड़बड़ियां तुरंत दिखा सकती है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Direct Python Execution for Spreadsheet and Document Tasks

When to Use This Skill

Use direct run_shell with Python scripts for structured document operations when:

  • Spreadsheets: Reading or writing complex Excel files with multiple sheets, applying formulas, formatting, or data transformations
  • PDFs: Generating PDF checklists, reports, invoices, or forms with precise layout control
  • Documents: Creating Word documents, HTML reports, or other structured output formats
  • Complex Operations: The task involves multiple steps that could exceed agent step limits
  • Precision Needed: You need precise control over error handling, debugging, and library imports

Why Direct Execution?

The shell_agent tool can:

  • Hit maximum step limits on complex multi-step operations
  • Produce unexplained errors on formatting operations
  • Fail on intricate reads/writes due to iterative parsing
  • Fail to parse heredoc syntax correctly, causing 'unknown error' failures

Direct run_shell with Python is more reliable because it:

  • Executes in a single step with no iteration limits
  • Provides clearer, immediate error messages
  • Handles complex operations without step constraints
  • Gives full control over library imports and execution flow
  • Writing scripts to .py files first avoids shell_agent parsing issues with heredocs

How to Use

Recommended Pattern: Write Script to File First

For complex multi-line scripts, especially when using shell_agent as executor:

# Step 1: Write the Python script to a file
cat > process_document.py << 'EOF'
# Your document/spreadsheet code here
EOF

# Step 2: Execute the script
python3 process_document.py

Alternative Pattern: Inline Heredoc (Simple Scripts Only)

For short, simple scripts when NOT using shell_agent as the executor:

python3 << 'EOF'
# Your code here
EOF

Spreadsheet Examples

Example 1: Read and Transform Excel Data

import pandas as pd

# Load data from specific sheet
df = pd.read_excel('input.xlsx', sheet_name='Revenue')

# Apply transformations
df['Net_Revenue'] = df['Gross_Revenue'] * (1 - df['Tax_Rate'])

# Save results
df.to_excel('output.xlsx', index=False, sheet_name='Processed')

Example 2: Multi-Sheet Operations with openpyxl

from openpyxl import load_workbook

wb = load_workbook('tour_data.xlsx')

# Iterate through sheets
for sheet_name in wb.sheetnames:
    ws = wb[sheet_name]
    # Apply formatting or calculations
    for row in ws.iter_rows(min_row=2, max_col=5):
        # Process cells
        pass

wb.save('tour_data_processed.xlsx')

Example 3: Complex Formatting Operations

from openpyxl import load_workbook
from openpyxl.styles import Font, PatternFill, Alignment

wb = load_workbook('report.xlsx')
ws = wb.active

# Apply header styling
header_fill = PatternFill(start_color='4472C4', fill_type='solid')
header_font = Font(bold=True, color='FFFFFF')

for cell in ws[1]:
    cell.fill = header_fill
    cell.font = header_font
    cell.alignment = Alignment(horizontal='center')

wb.save('report_formatted.xlsx')

PDF Generation Examples

Example 4: Generate PDF Checklist with ReportLab

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch

def create_checklist(pdf_path, items):
    c = canvas.Canvas(pdf_path, pagesize=letter)
    width, height = letter
    
    # Title
    c.setFont("Helvetica-Bold", 16)
    c.drawString(1*inch, height - 1*inch, "Safety Checklist")
    
    # Checklist items
    c.setFont("Helvetica", 12)
    y_position = height - 1.5*inch
    
    for i, item in enumerate(items, 1):
        checkbox_x = 1*inch
        text_x = 1.3*inch
        c.drawString(checkbox_x, y_position, "☐")  # Empty checkbox
        c.drawString(text_x, y_position, f"{i}. {item}")
        y_position -= 0.3*inch
        
        # New page if needed
        if y_position < 1*inch:
            c.showPage()
            y_position = height - 1*inch
    
    c.save()
    print(f"Created checklist: {pdf_path}")

# Usage
items = [
    "Verify equipment is powered off",
    "Check safety gear is available",
    "Inspect work area for hazards",
    "Confirm emergency contacts are posted"
]
create_checklist('safety_checklist.pdf', items)

Example 5: Generate PDF Report with Tables

from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.
अक्सर पूछे जाने वाले सवाल

यह किन फ़ाइल प्रकारों को कवर करती है?

स्किल में स्प्रेडशीट, PDF चेकलिस्ट, रिपोर्ट और Word या HTML दस्तावेज़ों का उल्लेख है।

शेल एजेंट से क्यों बचें?

स्किल बताती है कि शेल एजेंट स्टेप सीमा पार कर सकते हैं या हेरडॉक पार्सिंग में फेल हो सकते हैं।

क्या एजेंट आउटपुट की जाँच करता है?

हां, स्किल एजेंट को निर्देश देती है कि सफलता की पुष्टि के लिए प्रिंट हुआ आउटपुट पढ़े।

जानकारी

लेखक का मूल विवरण

Use direct Python execution for reliable spreadsheet and document/PDF generation operations

repo: HKUDS/AgentPilot

लोकप्रियता

GitHub स्टार
7.8k
रैंकिंग में स्थान
#13012
लाइसेंस
MIT
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills