AdvancedReportsFree prompt

Automated Report Generation with Python and Scheduled Email Delivery

Automates report creation and distribution using Python, Pandas, and scheduled email delivery.

Build a Python script that automates the entire report generation pipeline: data extraction from a database, processing with Pandas, chart creation, export to PDF/Excel, and automatic email delivery.

At a glance

Access

Free prompt

Open to copy without upgrading.

Prompt objective

Build a Python script that automates the entire report generation pipeline: data extraction from a database, processing with Pandas, chart creation, export to PDF/Excel, and automatic email delivery.

Real use case

The BI analyst at Farma Express Network spends every Monday morning generating the same weekly sales report — three hours of repetitive work that could be automated in a Python script running automatically at 7 AM.

Customize these fields first

REPORT TYPECOMPANY NAMEFREQUENCYPostgreSQL/MySQL/BigQueryQUERY 1 — e.g., sales by branch for the weekQUERY 2 — e.g., current stock vs. minimum stockQUERY 3 — e.g., sales rep performanceKPI 1

Replace the placeholders with your own context before you run the prompt. That usually improves the first output more than adding more instructions later.

Prompt

Create a complete Python script to automate the [REPORT TYPE] report for [COMPANY NAME], which is currently generated manually every [FREQUENCY].\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 1 — Data Extraction:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`python\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n# Connection to [PostgreSQL/MySQL/BigQuery]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n# Use SQLAlchemy + pandas.read_sql()\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\nRequired queries:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n1. [QUERY 1 — e.g., sales by branch for the week]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n2. [QUERY 2 — e.g., current stock vs. minimum stock]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n3. [QUERY 3 — e.g., sales rep performance]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 2 — Data Processing with Pandas:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Data cleaning and transformation\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Derived calculations: [KPI 1], [KPI 2], [KPI 3]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Comparisons: current vs. prior period, actual vs. target\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Classification: rankings, ABC categorization, traffic light indicators\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Pivot tables for summaries\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 3 — Visualization with Matplotlib/Plotly:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Chart 1: [TYPE] showing [METRIC]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Chart 2: [TYPE] showing [METRIC]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Chart 3: [TYPE] showing [METRIC]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Style: company colors ([COLOR 1], [COLOR 2]), font [FONT]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Save as PNG for email inclusion\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 4 — Report Generation:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\nOption A — Formatted Excel (openpyxl):\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Multiple sheets with professional formatting\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Embedded charts\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Conditional formatting\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Header with company logo\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\nOption B — PDF (reportlab or weasyprint):\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Professional layout with header/footer\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Tables and charts embedded\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Page numbering\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 5 — Email Delivery:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`python\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n# SMTP with attachment (smtplib + email.mime)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n# Or [Resend/Brevo/SendGrid] API\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\`\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- HTML email body with KPI summary\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Attachment: complete report (Excel + PDF)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Recipient list by role:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n  - Executive leadership: executive summary\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n  - Managers: area-specific details\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n  - Operations: granular data\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Part 6 — Scheduling:**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Cron job (Linux): cron expression for [FREQUENCY]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Or Task Scheduler (Windows)\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Or GitHub Actions / Cloud Function\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Error handling: notification email on failure\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n- Execution log with timestamp\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n**Complete code, commented, with exception handling and environment variables for credentials.**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\nLibraries: pandas, sqlalchemy, matplotlib, openpyxl, smtplib, python-dotenv, schedule.

Open directly in an AI — the text is pre-filled:

How to use this prompt

  1. 1Replace the key placeholders first: REPORT TYPE, COMPANY NAME, FREQUENCY, PostgreSQL/MySQL/BigQuery.
  2. 2Replace any bracketed placeholders like [this] with your own context.
  3. 3Add extra background information when you want more tailored results.
  4. 4Combine multiple prompts in one conversation when you need a richer output.
  5. 5Save your best-performing prompts so they are easy to reuse later.

Next best step

Open the guide first, then branch only if you still need more.

A guide for technical builders choosing between prompts, coding workflows, and agent-based implementation.

If this prompt is close but not quite right, generate variants next. If the job is recurring, move into the course library after the guide.

Related prompts

View all

Monthly Executive Report with Variance Analysis and Recommendations

Structures a standardized monthly executive report with variance analysis (actual vs. budget) and actionable recommendations.

IntermediateFree prompt

Best for

Create a monthly executive report template that presents results clearly for leadership, with variance analysis, root causes, and recommendations prioritized by impact.

Copy-ready promptOpen prompt

Cohort and Retention Analysis for Recurring Revenue Businesses

Generates a complete cohort analysis report to understand retention patterns and identify critical churn windows.

AdvancedFree prompt

Best for

Develop a detailed cohort analysis that reveals behavioral patterns over time, identifies the critical churn window, and quantifies the financial impact of retention.

Copy-ready promptOpen prompt

Budget vs. Actual Variance Analysis Report for Financial Controllers

Develops a detailed budget variance report with decomposition of causes (price, volume, mix) and projections.

AdvancedFree prompt

Best for

Create a variance analysis framework that breaks down differences between budgeted and actual results into their components (price effect, volume effect, mix effect, exchange rate effect) to enable precise corrective action.

Copy-ready promptOpen prompt

Data Narrative for Annual Report with Strategic Insights

Transforms raw yearly data into a coherent strategic narrative for the company's annual report.

IntermediateFree prompt

Best for

Write the analytical narrative for the annual report, turning tables and charts into a story that connects past results with future strategic direction, in language appropriate for diverse stakeholders.

Copy-ready promptOpen prompt

Explore other prompt categories

Move sideways into adjacent libraries when the current category is not the full answer.

Free browsing stays open. Premium prompts unlock the reusable workflow layer.

Use the guides and role paths to validate the job first. Upgrade when you want the full prompt text, editable premium prompts, and the surrounding course paths in one place.

Free access

  • Browse guides, role paths, and category pages.
  • Preview prompts before you decide to upgrade.
  • Find the right starting point without friction.

Membership access

  • Unlock premium prompts and the full copy text.
  • See more workflow paths and course connections.
  • Keep the reusable templates in one place.
Chat on WhatsApp