Skip to main content

Python Prompt to Build an Excel Report Generator with Charts and Email

Build a Python Excel report generator with formatted sheets, charts, conditional formatting and automated email delivery.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt builds a Python Excel report generator for [report_type] reports aimed at [report_audience], generated [report_frequency] from [data_sources]. It covers the full cycle: a multi-sheet workbook structure, a pandas data pipeline, professional formatting, embedded charts, conditional formatting, a protected cover page, and automated email delivery. Because stakeholders judge these reports on polish, the prompt is deliberately specific about styles, number formats, and chart placement so the output looks hand-crafted, not dumped.

The variables control structure and presentation. [sheet_count] and [sheet_names] define the workbook layout with a Summary sheet aggregating the rest, while [excel_library] and [header_style] drive formatting including frozen panes and auto-filters. The pipeline runs [query_count] queries, computes [calculated_fields], and aggregates by [grouping_fields], with results cached during development to avoid re-fetching. [chart_count] and [chart_types] place embedded charts at explicit cells, [highlight_rules] and [outlier_threshold] add conditional formatting and color scales, and [recipients] with [email_method] and [retention_count] handle delivery and archiving so the manual step disappears entirely.

When to use it

  • Automating a recurring Excel report a team currently rebuilds by hand each period.
  • Producing a polished multi-sheet workbook with a Summary tab aggregating the rest.
  • Pulling from [data_sources] and shaping the data with a pandas pipeline.
  • Embedding charts and conditional formatting that stakeholders expect to look professional.
  • Highlighting performance with rules like [highlight_rules] and outlier detection.
  • Delivering the finished file by email to [recipients] and archiving past copies automatically.

Example output

You get a report-generator implementation with code: a [sheet_count]-sheet workbook ([sheet_names]) with frozen panes, auto-filters, and an aggregating Summary sheet; a pandas pipeline running [query_count] queries against [data_sources], computing [calculated_fields], and grouping by [grouping_fields]; professional formatting via [excel_library] with [header_style] headers and proper number formats; [chart_count] embedded charts ([chart_types]) placed at specific cells; conditional formatting for [highlight_rules] and outliers beyond [outlier_threshold]; a protected cover page; and delivery emailing to [recipients] via [email_method] while keeping [retention_count] archived copies.

Pro tips

  • Be specific about [header_style], number formats, and [chart_types]; vague formatting requests yield generic-looking workbooks that stakeholders distrust.
  • Build the Summary sheet to pull from the other [sheet_names] so a single read gives the headline numbers.
  • Cache query results during development so iterating on formatting does not re-hit [data_sources] every run.
  • Place each chart at an explicit cell and size with [chart_dimensions]; letting the library auto-place charts usually overlaps your data or pushes it off the visible area.
  • Define [highlight_rules] in business terms (for example quota bands) so the conditional formatting communicates, not just decorates.
  • Tie generation to [report_frequency] and [email_method] delivery so the workbook is produced and sent without anyone touching it, and keep [retention_count] archived copies so prior periods stay available for comparison.

Frequently Asked Questions

Which Excel library does this use?
It defaults to `[excel_library]`, openpyxl with pandas integration. openpyxl handles formatting, charts, and conditional formatting in `.xlsx` files, while pandas does the data shaping. You can substitute another library, but the formatting steps assume openpyxl's API by default.
Can it pull data from multiple sources?
Yes. The pipeline connects to `[data_sources]`, which can include both a database and an API, runs `[query_count]` queries or calls, then merges and transforms the results with pandas. Caching during development avoids re-fetching while you iterate on the report's formatting.
Does it email the report automatically?
Yes. The delivery step saves a timestamped file, emails it to `[recipients]` via `[email_method]` with a summary in the body, and archives previous reports keeping `[retention_count]` copies. This removes the manual generate-and-send step from the recurring workflow entirely.
How does the conditional formatting work?
It applies rules defined in `[highlight_rules]`, such as coloring cells by quota band, plus color scales, data bars, and outlier marking beyond `[outlier_threshold]` standard deviations. Expressing rules in business terms makes the formatting communicate meaning rather than just adding decoration.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Python & Automation Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support