Python Automation Script Builder
Generate clean, production-ready Python automation scripts with error handling, logging, and documentation — for web scraping, file processing, API integration, and scheduled tasks.
Content
Write a production-ready Python automation script for the following task: Task Description: {{task_description}} Input Data: {{input_data}} Expected Output: {{expected_output}} External Services/APIs: {{external_services}} Run Schedule: {{run_schedule}} Error Handling Level: {{error_handling}} (basic / comprehensive / enterprise) Generate a complete Python script that includes: **1. Script Structure** - Proper module imports (standard library first, third-party second) - Configuration section with constants and environment variables - Main function with clear entry point - Helper functions with docstrings - `if __name__ == "__main__":` guard **2. Core Functionality** - Implement the exact task: {{task_description}} - Handle {{input_data}} as input - Produce {{expected_output}} as output - Integrate with {{external_services}} using proper auth patterns **3. Error Handling** - Try/except blocks for all external calls - Retry logic with exponential backoff for network operations - Graceful failure with meaningful error messages - Exit codes for CI/CD integration **4. Logging** - Python logging module setup (not print statements) - Log levels: DEBUG, INFO, WARNING, ERROR - Timestamp and context in log messages - Log file rotation config **5. Documentation** - Module docstring explaining purpose and usage - Function docstrings with Args and Returns - Inline comments for complex logic - README-ready usage example in docstring **6. Dependencies** - requirements.txt content - Any pip install commands needed **7. Testing Stub** - Basic pytest structure for the main functions
Related Prompts
API Documentation Writer (Developer-Friendly)
Generates comprehensive, developer-friendly API documentation from endpoint specs, including descriptions, request/response examples, error codes, and SDK snippets.
Docker Deployment Guide Generator
Creates a complete Docker containerization and deployment guide for any application, including Dockerfile, docker-compose, CI/CD, and production best practices.
AI Model Fine-Tuning Dataset Brief Generator
Generates a structured brief and example training data pairs for fine-tuning an LLM on a specific task, persona, or domain.
Chain-of-Thought Reasoning Generator
Generate step-by-step reasoning prompts that guide AI models through complex problem-solving with explicit logical steps.