30 Claude Prompts That Write Python Code
Describe the task and Claude returns a real, runnable Python script, commented and ready to run. Prompts for automation, pandas data analysis, web scraping, API clients, file and OS tasks, and command-line apps.
In short: This page contains 30 copy-paste ready prompts, organized into 6 categories with a description and pro tip for each. The first 15 prompts are free instantly โ no signup needed. Hand-curated and tested by the AI Academy team.
Automation Scripts
5 promptsBulk File Renamer & Organizer
1/30You are a senior Python automation engineer. <context> I need a single self-contained Python script that batch-renames and sorts files in a folder. It must run as-is and include a dry-run mode so I can preview every change before anything is touched. </context> <inputs> - Target folder: [PATH] - Rename pattern: [E.G. {date}_{index}_{originalname}] - Sort into subfolders by: [EXTENSION / DATE / KEYWORD] - Files to include: [ALL / GLOB LIKE *.jpg] - Conflict rule: [SKIP / APPEND NUMBER] </inputs> <task> Write a script that scans the folder, builds new names from the pattern, optionally moves each file into a subfolder by the chosen key, then applies the changes. Add a --dry-run flag that prints every planned rename and move without executing, and print a summary of how many files were processed. </task> <constraints> - Standard library only (os, pathlib, shutil, argparse, datetime); no third-party deps. - Never overwrite silently; honor the conflict rule and skip hidden or system files. - Comment each step; add docstrings and a main() guarded by if __name__ == '__main__'. </constraints> <format> Return the complete .py file in one code block, then a short note on how to run it (including the dry-run flag) and how to change the naming pattern. </format>
Produces a runnable, dry-run-safe Python script that batch-renames and organizes files in a folder, ready to run.
Pro tip: Run it with --dry-run first and paste the output back to Claude to fine-tune the naming pattern before touching real files.
Scheduled Email Report Sender
2/30You are a Python automation engineer who builds reliable back-office scripts. <context> I need a self-contained Python script that generates a summary and emails it on a schedule. It should run from cron or Task Scheduler and be safe to re-run. </context> <inputs> - Data source: [CSV PATH / SQL QUERY / API URL] - What the report summarizes: [E.G. DAILY SALES TOTALS] - Recipients: [EMAIL ADDRESSES] - SMTP details: [HOST, PORT, USERNAME] - Send frequency: [DAILY / WEEKLY] </inputs> <task> Write a script that loads the data, computes the summary (totals, counts, top items), formats it as a clean HTML email body with a plain-text fallback, and sends it via SMTP with TLS. Read credentials from environment variables, log each run, and exit non-zero on failure so the scheduler can alert. </task> <constraints> - Use standard library smtplib, email, os, logging; note any optional deps in a comment. - Never hardcode the password; read SMTP_PASSWORD from the environment. - Include a --dry-run that prints the email instead of sending; PEP 8, docstrings, main guard. </constraints> <format> Return the full script in one code block, then a short note with the exact cron line and the environment variables to set. </format>
Generates a runnable Python script that builds and emails a scheduled summary report via SMTP, ready to run.
Pro tip: Tell Claude your exact columns and the one metric that matters most so the summary leads with the number you actually check.
Drop-Folder Watcher That Triggers Actions
3/30You are a Python automation engineer. <context> I need a self-contained script that watches a folder and automatically processes any new file that lands in it, the kind of drop-folder automation I can leave running. </context> <inputs> - Folder to watch: [PATH] - File types to react to: [E.G. *.pdf, *.csv] - Action on new file: [MOVE / CONVERT / UPLOAD / RUN COMMAND] - Where processed files go: [DESTINATION PATH] - Poll interval in seconds: [E.G. 5] </inputs> <task> Write a watcher that polls the folder on the given interval, detects newly added files (tracking what it has already seen), runs the chosen action on each, moves them to the destination, and logs every event. Wait until a file's size is stable before processing (it may still be writing) and keep running until Ctrl+C. </task> <constraints> - Prefer the standard library (pathlib, time, shutil, logging); if you use watchdog, list it as a dependency with a pip line. - Idempotent and crash-safe: never process the same file twice; catch and log per-file errors without stopping the loop. - Clean shutdown on KeyboardInterrupt; docstrings and main guard. </constraints> <format> Return the complete script in one code block, then a note on running it as a background process and swapping in a different action. </format>
Builds a runnable folder-watcher script that auto-processes new files as they arrive, ready to run.
Pro tip: Describe the exact action (e.g. convert to PDF then move) and Claude slots it into the per-file handler you can extend later.
Automated Backup Script with Rotation
4/30You are a systems automation engineer who writes dependable backup tooling. <context> I need a self-contained Python backup script that archives folders, timestamps them, and rotates out old backups so the disk never fills. It must be safe to run from a scheduler. </context> <inputs> - Folders to back up: [ONE OR MORE PATHS] - Backup destination: [PATH OR MOUNTED DRIVE] - Archive format: [ZIP / TAR.GZ] - How many backups to keep: [E.G. 7] - Exclude patterns: [E.G. *.tmp, node_modules] </inputs> <task> Write a script that compresses the source folders into a timestamped archive in the destination, skips the exclude patterns, verifies the archive was created and is non-empty, then deletes the oldest archives beyond the keep count. Log the size and duration of each run and exit non-zero on any failure. </task> <constraints> - Standard library only (pathlib, zipfile or tarfile, argparse, logging, datetime). - Verify before pruning; never delete old backups if the new one failed. - Comment each phase; PEP 8, docstrings, main guard; a --dry-run that lists what it would archive and prune. </constraints> <format> Return the full script in one code block, then a short note with the scheduler command and how to change the retention count. </format>
Produces a runnable Python backup script with timestamped archives and safe rotation, ready to run.
Pro tip: Add your largest excludable folders to the exclude list so backups stay small and fast enough to run nightly.
Website Uptime & Health Monitor
5/30You are a Python automation engineer who builds lightweight monitoring tools. <context> I need a self-contained Python script that checks whether a list of URLs is up, measures response time, and alerts me when something is down or slow. </context> <inputs> - URLs to monitor: [LIST OF URLS] - Alert threshold: [E.G. STATUS != 200 OR RESPONSE > 2s] - Alert channel: [SLACK WEBHOOK / EMAIL / CONSOLE] - Check interval in seconds: [E.G. 60] - Request timeout in seconds: [E.G. 10] </inputs> <task> Write a monitor that requests each URL, records status code and latency, flags failures and slow responses against the threshold, and sends an alert to the chosen channel only when a URL's state changes (up to down or down to up) to avoid spam. Keep a rolling in-memory state, print a status line each cycle, and loop until Ctrl+C. </task> <constraints> - Use requests (list it as a dependency) plus standard library; handle timeouts and connection errors gracefully. - Only alert on state change, not every failed cycle; clean shutdown on KeyboardInterrupt. - Docstrings, comments, main guard; the webhook URL comes from an environment variable. </constraints> <format> Return the complete script in one code block, then a note on running it continuously and wiring up the Slack webhook. </format>
Builds a runnable Python uptime and latency monitor that alerts only on state changes, ready to run.
Pro tip: Set the alert channel to console first to watch it work, then swap in your Slack webhook once the thresholds feel right.
XML tags are just the start. Learn the full Claude workflow.
A growing library of 300+ hands-on AI tutorials covering Claude, ChatGPT, and 50+ tools. New tutorials added every week.
Data Analysis (pandas)
5 promptsCSV Cleaning & Profiling Pipeline
6/30You are a data engineer who writes clean, reproducible pandas pipelines. <context> I have a messy CSV and need one self-contained Python script that loads it, profiles it, cleans it, and writes a tidy output file, runnable end to end. </context> <inputs> - Input CSV path: [PATH] - Known issues: [E.G. MIXED DATE FORMATS, BLANKS, DUPLICATES] - Columns and expected types: [COLUMN: TYPE, ...] - Rows to drop or keep rules: [E.G. DROP ROWS WITH NO EMAIL] - Output path: [CLEANED CSV PATH] </inputs> <task> Write a script that reads the CSV, prints a profile (row and column counts, dtypes, null counts, duplicate count, sample values), then cleans it: strip and normalize strings, coerce types, parse dates, drop or flag duplicates, handle missing values per the rules, and standardize column names to snake_case. Save the cleaned CSV and print a before-and-after summary. </task> <constraints> - Use pandas (list the pip line); load with explicit dtypes where known. - Never mutate the input file; write to the output path only. No silent coercion; report rows that failed to parse. - Docstrings, comments explaining each cleaning step, main guard. </constraints> <format> Return the full script in one code block, then a note on how to adapt the cleaning rules and read the profile output. </format>
Generates a runnable pandas script that profiles and cleans a messy CSV into a tidy output file, ready to run.
Pro tip: Paste the first five rows of your real CSV so Claude tailors the type coercion and date parsing to your actual data.
Sales Dataset EDA & Summary
7/30You are a data analyst who writes clear exploratory analysis in pandas. <context> I need a self-contained Python script that runs a full exploratory data analysis on a sales dataset and prints an insight-focused summary I can read in the terminal. </context> <inputs> - Dataset path: [CSV PATH] - Key columns: [DATE, PRODUCT, REGION, REVENUE, QUANTITY] - Business questions: [E.G. TOP PRODUCTS, GROWTH TREND, BEST REGION] - Date range to analyze: [ALL / SPECIFIC RANGE] </inputs> <task> Write a script that loads the data, validates the key columns exist, then computes and prints: overall totals and averages, revenue by product and region ranked, month-over-month trend, top and bottom performers, and obvious anomalies (nulls, negatives, outliers). Present each finding as a labeled section with a small table, and end with a plain-language key-takeaways list. </task> <constraints> - Use pandas; group and aggregate rather than looping over rows. - Every table gets a clear header; format currency and percentages readably. - Comment the reasoning behind each metric; docstrings and main guard; fail with a clear message if a key column is missing. </constraints> <format> Return the full script in one code block, then a note on pointing it at your file and adding a new business question. </format>
Produces a runnable pandas EDA script that prints ranked tables and plain-language takeaways for a sales dataset, ready to run.
Pro tip: List your top business question first; Claude makes that the headline metric instead of burying it under generic stats.
Two-File Merge & Reconciliation Report
8/30You are a data analyst who specializes in reconciling datasets. <context> I have two files that should match (for example a system export versus a spreadsheet) and need a self-contained Python script that merges them and reports every discrepancy. </context> <inputs> - File A path and role: [PATH, E.G. CRM EXPORT] - File B path and role: [PATH, E.G. FINANCE SHEET] - Key column(s) to join on: [E.G. ORDER_ID] - Columns to compare: [E.G. AMOUNT, STATUS] - Tolerance for numeric diffs: [E.G. 0.01] </inputs> <task> Write a script that loads both files, joins them on the key(s), and produces a reconciliation report: rows only in A, rows only in B, matched rows where compared values differ (with the two values side by side and the delta), and a clean summary count of each category. Write the mismatches to an output CSV and print the summary. </task> <constraints> - Use pandas; handle duplicate keys and type mismatches explicitly rather than crashing. - Respect the numeric tolerance when flagging differences; treat blank versus zero carefully. - Comment the join logic; docstrings and main guard; clear messages if a key column is missing in either file. </constraints> <format> Return the full script in one code block, then a note on reading the report and adjusting the tolerance. </format>
Builds a runnable pandas reconciliation script that merges two files and reports every mismatch, ready to run.
Pro tip: Tell Claude how blanks and zeros should be treated in your data; that one rule changes which rows get flagged.
Time-Series Resampling & Rolling Metrics
9/30You are a data analyst fluent in pandas time-series work. <context> I have timestamped data and need a self-contained Python script that resamples it and computes rolling metrics for reporting, runnable end to end. </context> <inputs> - Data path: [CSV PATH] - Timestamp column: [COLUMN NAME] - Value column(s): [E.G. VISITS, REVENUE] - Resample frequency: [DAILY / WEEKLY / MONTHLY] - Rolling window: [E.G. 7-PERIOD MOVING AVERAGE] </inputs> <task> Write a script that parses the timestamp column, sets it as a datetime index, resamples the values to the chosen frequency (sum or mean as appropriate), and adds rolling average, period-over-period percentage change, and cumulative total columns. Print the resulting table, save it to CSV, and print the peak and trough periods. </task> <constraints> - Use pandas; handle missing timestamps and timezone-naive versus aware dates safely. - Do not silently fill gaps; state whether missing periods are zero-filled or left as NaN. - Comment the resample and rolling choices; docstrings and main guard. </constraints> <format> Return the full script in one code block, then a note on switching the frequency and window size. </format>
Generates a runnable pandas time-series script with resampling, rolling averages, and period-over-period change, ready to run.
Pro tip: State whether missing days mean zero or unknown; it flips whether Claude zero-fills or leaves gaps, changing your averages.
Group-By Aggregation to Excel Report
10/30You are a data analyst who builds report-ready spreadsheets from raw data. <context> I need a self-contained Python script that aggregates a raw dataset and exports a formatted multi-sheet Excel report, runnable in one go. </context> <inputs> - Source data path: [CSV PATH] - Group-by dimensions: [E.G. REGION, MONTH] - Metrics to aggregate: [E.G. SUM(REVENUE), COUNT(ORDERS), AVG(TICKET)] - Pivot layout: [DIMENSION IN ROWS, ANOTHER IN COLUMNS] - Output Excel path: [PATH] </inputs> <task> Write a script that loads the data, computes the grouped aggregations, builds a pivot table for the chosen layout, and writes a multi-sheet .xlsx file: a Summary sheet with totals, a By Group sheet with the aggregation, and a Pivot sheet. Add a bold header row and freeze the top row on each sheet. </task> <constraints> - Use pandas plus openpyxl (list the pip line); use a pandas ExcelWriter context manager. - Numbers formatted with thousands separators; never overwrite the source file. - Comment the aggregation and formatting; docstrings and main guard. </constraints> <format> Return the full script in one code block, then a note on adding a sheet or changing the metrics. </format>
Builds a runnable pandas script that aggregates data into a formatted multi-sheet Excel report, ready to run.
Pro tip: Name the exact metrics with their aggregation (sum versus average) so the numbers on every sheet mean what you expect.
Web Scraping
5 promptsStatic HTML Scraper to CSV
11/30You are a Python web-scraping engineer who writes polite, robust scrapers. <context> I need a self-contained Python script that scrapes structured data from a static web page and saves it to CSV, runnable as-is. </context> <inputs> - Target URL: [URL] - Data I want per item: [E.G. TITLE, PRICE, LINK] - CSS selector for each item block: [SELECTOR OR FIND IT] - Output CSV path: [PATH] - Politeness: [DELAY BETWEEN REQUESTS] </inputs> <task> Write a scraper that fetches the page with a real User-Agent, parses it with BeautifulSoup, extracts the listed fields for each item (guessing sensible selectors if I did not supply them), and writes rows to CSV with a header. Handle missing fields gracefully, respect the request delay, and print how many items were scraped. </task> <constraints> - Use requests and beautifulsoup4 (list the pip line); set a descriptive User-Agent and a timeout. - Note robots.txt guidance in a comment; never hammer the server, honor the delay. - Handle HTTP errors and empty results with clear messages; docstrings and main guard. </constraints> <format> Return the full script in one code block, then a note on finding the right selectors and extending it to more fields. </format>
Produces a runnable requests plus BeautifulSoup scraper that extracts page data to CSV, ready to run.
Pro tip: Paste a snippet of the page's HTML around one item and Claude will lock in exact selectors instead of guessing.
Paginated Listings Scraper
12/30You are a Python web-scraping engineer. <context> I need a self-contained Python script that scrapes data across multiple paginated pages of a listing site and combines everything into one CSV. </context> <inputs> - Base listing URL: [URL WITH PAGE PARAM, E.G. ?page=] - Fields per listing: [E.G. NAME, PRICE, RATING, URL] - How to detect the last page: [MAX PAGE NUMBER / NEXT BUTTON GONE / EMPTY RESULTS] - Delay between pages: [SECONDS] - Output CSV path: [PATH] </inputs> <task> Write a scraper that iterates through pages, extracts each listing's fields, follows pagination until the stop condition, deduplicates by URL, and writes all results to one CSV. Print progress per page and a final count. Make it resume-friendly: skip pages already saved if run again. </task> <constraints> - Use requests and beautifulsoup4 (pip line); descriptive User-Agent, timeout, and the given delay between pages. - Stop cleanly at the last page, never loop forever; cap max pages as a safety net. - Handle transient errors with a short retry; docstrings, comments, main guard. </constraints> <format> Return the full script in one code block, then a note on adapting the pagination detection and the retry count. </format>
Builds a runnable Python scraper that walks paginated listings into one deduplicated CSV, ready to run.
Pro tip: Tell Claude exactly how the site signals the last page; that single detail prevents both infinite loops and missed pages.
HTML Table Extractor
13/30You are a Python data-extraction engineer. <context> I need a self-contained Python script that pulls one or more HTML tables from a web page and saves each as a clean CSV, runnable in one command. </context> <inputs> - Page URL: [URL] - Which table(s): [ALL / THE ONE WITH THESE HEADERS] - Header handling: [FIRST ROW IS HEADER / NO HEADER] - Cleanup needed: [E.G. STRIP FOOTNOTES, PARSE NUMBERS] - Output folder: [PATH] </inputs> <task> Write a script that fetches the page and extracts tables, cleans the cells (strip whitespace, remove footnote markers, coerce numeric-looking columns to numbers), names each output file by the table's caption or index, and writes one CSV per table. Print a short preview of each extracted table. </task> <constraints> - Use pandas.read_html with a requests-fetched User-Agent, plus lxml and beautifulsoup4 (list pip lines); fall back gracefully if a table is malformed. - Preserve column order; report how many tables were found and saved. - Comment the cleanup steps; docstrings and main guard. </constraints> <format> Return the full script in one code block, then a note on selecting a specific table and tuning the number parsing. </format>
Generates a runnable Python script that extracts and cleans HTML tables into per-table CSVs, ready to run.
Pro tip: Name a header you know is in the table you want; Claude filters to that one instead of dumping every table on the page.
Sitemap & Internal Link Crawler
14/30You are a Python engineer who builds respectful site crawlers. <context> I need a self-contained Python script that crawls a site from its homepage or sitemap, collects internal URLs, and reports their status, runnable as-is. </context> <inputs> - Start URL or sitemap: [URL] - Stay on domain?: [YES, SAME DOMAIN ONLY] - Max pages to crawl: [E.G. 500] - What to collect: [URL, STATUS CODE, TITLE, DEPTH] - Output CSV path: [PATH] </inputs> <task> Write a crawler that starts from the URL (parsing the sitemap if given), follows internal links breadth-first up to the max, records status code, page title, and crawl depth for each URL, flags broken links (4xx and 5xx) and redirects, and writes everything to CSV. Respect robots.txt and a polite delay, and never leave the target domain. </task> <constraints> - Use requests and beautifulsoup4 (pip line); parse robots.txt with urllib.robotparser and obey it. - Deduplicate URLs, cap total pages, and add a per-request delay; handle timeouts and loops safely. - Docstrings, comments on the BFS queue logic, main guard. </constraints> <format> Return the full script in one code block, then a note on reading the broken-link report and raising the page cap. </format>
Builds a runnable Python site crawler that maps internal links and flags broken URLs to CSV, ready to run.
Pro tip: Point it at your XML sitemap instead of the homepage for a faster, more complete crawl of pages you actually publish.
Hidden JSON API Scraper
15/30You are a Python web-scraping engineer who prefers hidden JSON APIs over brittle HTML parsing. <context> A page loads its data from a background JSON endpoint visible in the browser Network tab. I need a self-contained Python script that calls that endpoint directly and saves the results, far more reliable than scraping the rendered HTML. </context> <inputs> - JSON endpoint URL: [URL FROM NETWORK TAB] - Required headers or params: [E.G. AUTH, PAGE, LIMIT] - Fields I want from the JSON: [E.G. id, name, price] - Pagination scheme: [OFFSET / CURSOR / PAGE NUMBER] - Output format: [CSV / JSON LINES] </inputs> <task> Write a script that calls the endpoint with the given headers and params, walks the pagination scheme until exhausted, extracts the requested fields from the JSON (handling nested keys), and writes the flattened records to the chosen format. Print the total records fetched and handle rate-limit responses (429) with backoff. </task> <constraints> - Use requests (pip line); parse JSON safely and skip records missing required fields with a logged warning. - Respect 429 and Retry-After with exponential backoff; add a small delay between pages. - Comment the pagination and flattening logic; docstrings and main guard. </constraints> <format> Return the full script in one code block, then a note on finding the endpoint in the Network tab and mapping nested fields. </format>
Produces a runnable Python script that pulls data from a page's hidden JSON API with pagination, ready to run.
Pro tip: Copy the request as cURL from your browser's Network tab and paste it in; Claude translates the headers and params exactly.
API Clients
5 promptsReusable REST API Client Class
16/30You are a senior Python engineer who writes clean, reusable API client libraries. <context> I need a self-contained Python module: a reusable REST client class I can import and use, with sessions, retries, and pagination handled for me. </context> <inputs> - API base URL: [URL] - Auth type: [API KEY HEADER / BEARER TOKEN / NONE] - Endpoints I use most: [E.G. GET /users, POST /orders] - Pagination style: [PAGE / CURSOR / LINK HEADER] - Rate limit to respect: [E.G. 60 REQ/MIN] </inputs> <task> Write a client class that wraps a requests.Session, injects auth, exposes get/post/put/delete helpers plus a paginate() generator that yields all items across pages, retries transient errors (429 and 5xx) with exponential backoff, and raises a clear custom exception carrying the response body on failure. Add typed method stubs for the listed endpoints and a short usage example under the main guard. </task> <constraints> - Use requests (pip line) and standard typing; read the API key or token from an environment variable, never hardcoded. - Timeouts on every request; respect the rate limit; log requests at debug level. - Full docstrings, type hints, and comments; PEP 8. </constraints> <format> Return the complete module in one code block, then a note on importing it and adding a new endpoint method. </format>
Generates a runnable, reusable Python REST client class with retries and pagination, ready to import and use.
Pro tip: List your two most-used endpoints with their params and Claude writes typed methods for them, not just a generic wrapper.
Token-Authenticated Service Wrapper
17/30You are a Python integrations engineer. <context> I need a self-contained Python wrapper around a specific service's API that handles token auth (including refresh) and gives me clean, named methods, runnable with a usage example. </context> <inputs> - Service and base URL: [E.G. INTERNAL BILLING API, URL] - Auth flow: [STATIC TOKEN / OAUTH CLIENT CREDENTIALS WITH REFRESH] - Operations I need: [E.G. LIST INVOICES, CREATE INVOICE, GET CUSTOMER] - Required fields per operation: [DESCRIBE] - Error cases to handle: [E.G. 401 REFRESH, 404 NOT FOUND] </inputs> <task> Write a wrapper class that obtains a token (refreshing automatically on 401 for the client-credentials flow), exposes one clearly named method per operation with typed parameters and return values, validates required fields before sending, and maps API errors to descriptive Python exceptions. Include a runnable example calling one read and one write method. </task> <constraints> - Use requests (pip line); read client id and secret or token from environment variables only. - Cache the token until expiry and refresh transparently; timeouts and retries on transient failures. - Type hints, docstrings, comments on the auth flow; main guard with the example. </constraints> <format> Return the complete module in one code block, then a note on the environment variables and adding another operation. </format>
Builds a runnable Python API wrapper with token auth and refresh plus named operation methods, ready to use.
Pro tip: Spell out the exact operations you call and their required fields; Claude turns each into a validated, self-documenting method.
Concurrent Rate-Limited Batch Fetcher
18/30You are a Python engineer who writes fast, well-behaved concurrent clients. <context> I have many API calls to make and need a self-contained Python script that runs them concurrently but stays under the rate limit, runnable as-is. </context> <inputs> - Endpoint template: [E.G. https://api.example.com/items/{id}] - The list of ids or params: [PATH TO CSV OR INLINE LIST] - Concurrency limit: [E.G. 10 IN FLIGHT] - Rate limit: [E.G. 100 REQ/MIN] - Output path: [JSON LINES / CSV] </inputs> <task> Write a script that reads the inputs, fires requests concurrently with a bounded worker pool, enforces the rate limit with a token-bucket or sliding-window limiter, retries failures with backoff, and streams results to the output file as they complete so a crash does not lose everything. Print a periodic progress count and a final success and failure tally. </task> <constraints> - Use concurrent.futures or asyncio with aiohttp; pick one and justify it in a comment; list any pip deps. - Never exceed the concurrency or rate limit; handle 429 with Retry-After. - Write results incrementally; docstrings, comments on the limiter, main guard. </constraints> <format> Return the full script in one code block, then a note on tuning concurrency versus rate limit and resuming a partial run. </format>
Produces a runnable Python batch fetcher that runs API calls concurrently under a strict rate limit, ready to run.
Pro tip: Give Claude the real rate limit from the API docs; it sizes the limiter to that number so you get speed without 429s.
Webhook Receiver with Signature Verification
19/30You are a backend Python engineer who builds secure webhook endpoints. <context> I need a self-contained Python webhook receiver (Flask) that verifies signatures, parses the payload, and acts on events, runnable locally for testing. </context> <inputs> - Provider: [E.G. STRIPE / GITHUB / CUSTOM] - Signature scheme: [E.G. HMAC-SHA256 OF BODY WITH SHARED SECRET, HEADER NAME] - Events to handle: [E.G. payment.succeeded, subscription.canceled] - Action per event: [E.G. WRITE TO DB, ENQUEUE JOB, LOG] - Port: [E.G. 5000] </inputs> <task> Write a Flask app with a POST /webhook route that reads the raw body, verifies the HMAC signature in constant time against the shared secret, rejects invalid or replayed requests (timestamp tolerance), routes valid events to a handler function per event type, and returns 200 quickly for accepted events. Include a small helper that generates a valid test signature so I can curl it locally. </task> <constraints> - Use Flask (pip line) and standard hmac and hashlib; read the secret from an environment variable. - Constant-time comparison (hmac.compare_digest); verify BEFORE parsing JSON; reject stale timestamps. - Docstrings, comments on the verification, main guard running the dev server. </constraints> <format> Return the complete app in one code block, then a note on the environment variable, the test curl command, and moving to a production server. </format>
Builds a runnable Flask webhook receiver with constant-time signature verification and event routing, ready to run.
Pro tip: Name your provider's exact signature header and scheme so Claude verifies it the way the provider actually signs requests.
API-to-SQLite Incremental Sync
20/30You are a Python data-integration engineer. <context> I need a self-contained Python script that pulls records from an API and syncs them into a local SQLite database, running incrementally so re-runs only fetch what changed. </context> <inputs> - API list endpoint: [URL] - Unique record id field: [E.G. id] - Updated-at field for incremental sync: [E.G. updated_at] - Fields to store: [FIELD: TYPE, ...] - SQLite file path: [PATH] </inputs> <task> Write a script that creates the SQLite table if missing (with the given schema and a primary key), reads the last sync timestamp from a small state table, fetches only records updated since then (paginating as needed), and upserts them into the database in a transaction. Print how many rows were inserted versus updated and store the new high-water mark. Make it safe to run repeatedly. </task> <constraints> - Use requests (pip line) and the standard library sqlite3; parameterized queries only, never string-format SQL. - Upsert with INSERT ... ON CONFLICT; wrap each batch in a transaction; store state so partial runs resume. - Docstrings, comments on the incremental logic, main guard. </constraints> <format> Return the full script in one code block, then a note on scheduling it and adding a new field to the schema. </format>
Generates a runnable Python script that incrementally syncs an API into a local SQLite database, ready to run.
Pro tip: Confirm the API's updated-at field name; the whole incremental sync hinges on filtering by it so re-runs stay cheap.
File & OS Tasks
5 promptsRecursive Duplicate File Finder
21/30You are a Python systems engineer who writes safe file-management tools. <context> I need a self-contained Python script that finds duplicate files under a folder by content, not just name, and helps me remove them safely, runnable with a preview mode. </context> <inputs> - Root folder: [PATH] - File types to consider: [ALL / SPECIFIC EXTENSIONS] - What to do with duplicates: [REPORT ONLY / DELETE / HARDLINK / MOVE TO FOLDER] - Which copy to keep: [OLDEST / NEWEST / SHORTEST PATH] - Minimum file size to check: [E.G. 1KB] </inputs> <task> Write a script that walks the tree, groups files first by size then confirms duplicates by hashing (reading in chunks so large files do not blow memory), and reports each duplicate set with the keeper marked. In report mode it only prints; in an action mode it applies the chosen operation, but only after a confirmation prompt or a --yes flag. Print the total space that can be reclaimed. </task> <constraints> - Standard library only (os, pathlib, hashlib, argparse); hash in chunks; skip symlinks. - Destructive actions require --yes or an interactive confirmation; never delete the keeper. - Docstrings, comments on the two-pass hashing, main guard. </constraints> <format> Return the full script in one code block, then a note on running the safe preview first and choosing the keep rule. </format>
Produces a runnable Python script that finds content-duplicate files and reclaims space safely, ready to run.
Pro tip: Run in report-only mode first; the two-pass size-then-hash approach makes the preview fast and the delete exact.
Bulk Image Resizer & Converter
22/30You are a Python engineer who builds image-processing utilities with Pillow. <context> I need a self-contained Python script that batch-resizes and converts images in a folder, runnable as-is and non-destructive by default. </context> <inputs> - Source folder: [PATH] - Target size: [E.G. MAX 1200PX LONG EDGE / EXACT 800x800] - Output format: [JPEG / PNG / WEBP] - Quality or compression: [E.G. JPEG 82] - Output folder: [PATH] </inputs> <task> Write a script that finds images in the source folder, resizes each while preserving aspect ratio (or crops to exact size if requested), converts to the target format, strips or preserves EXIF as chosen, and writes to the output folder keeping original filenames with the new extension. Skip non-images, report each file's before-and-after dimensions and size, and print the total space saved. </task> <constraints> - Use Pillow (pip install pillow); never overwrite originals, write to the output folder only. - Handle RGBA-to-JPEG conversion (flatten on white) and EXIF orientation; skip corrupt files with a warning. - Docstrings, comments, main guard; a --dry-run listing planned conversions. </constraints> <format> Return the full script in one code block, then a note on adjusting quality and adding a watermark step later. </format>
Builds a runnable Pillow script that batch-resizes and converts images non-destructively, ready to run.
Pro tip: Set the long-edge cap rather than exact dimensions so mixed portrait and landscape images all shrink correctly.
Log File Parser & Summarizer
23/30You are a Python engineer who builds log-analysis tooling. <context> I need a self-contained Python script that parses a log file and prints a useful summary: error counts, top offenders, and a timeline, runnable in the terminal. </context> <inputs> - Log file path (or glob): [PATH] - Log format: [E.G. COMMON LOG FORMAT / JSON LINES / CUSTOM REGEX] - What to count: [E.G. STATUS CODES, ERROR TYPES, IPs, ENDPOINTS] - Time window: [ALL / LAST N HOURS] - Top-N to show: [E.G. 10] </inputs> <task> Write a script that reads the log (streaming line by line so it handles huge files), parses each line per the format, and prints: total lines, counts by the chosen dimension ranked top-N, error rate over time bucketed by hour, the most frequent endpoints, and a sample of the most common error lines. Handle unparseable lines by counting them separately. </task> <constraints> - Standard library only (re, collections, argparse, gzip for .gz logs); stream, do not load the whole file. - Compile regexes once; never crash on a malformed line, tally it as unparsed. - Docstrings, comments on the parsing regex, main guard. </constraints> <format> Return the full script in one code block, then a note on adapting the regex to your log format and adding a new metric. </format>
Generates a runnable Python log parser that streams a log file into ranked counts and an hourly timeline, ready to run.
Pro tip: Paste three real log lines and Claude writes the exact parsing regex instead of assuming a standard format.
PDF Merge, Split & Extract Tool
24/30You are a Python engineer who builds document-processing utilities. <context> I need a self-contained Python script that merges, splits, and extracts pages from PDFs on the command line, runnable as-is. </context> <inputs> - Mode: [MERGE / SPLIT / EXTRACT PAGES] - Input file(s) or folder: [PATHS] - For split: [EVERY N PAGES / AT SPECIFIC PAGE NUMBERS / ONE FILE PER PAGE] - For extract: [PAGE RANGE, E.G. 3-7] - Output path or folder: [PATH] </inputs> <task> Write a CLI with three subcommands: merge (combine multiple PDFs in the given order into one file), split (break a PDF by the chosen rule), and extract (pull a page range into a new PDF). Preserve bookmarks where possible, validate that inputs exist and are real PDFs, and print what was written. Use argparse subcommands so it reads like a real tool. </task> <constraints> - Use pypdf (pip install pypdf); never overwrite an existing output without a --force flag. - Validate page numbers against the document length with clear errors; skip encrypted PDFs with a warning. - Docstrings, comments, main guard with argparse subcommands. </constraints> <format> Return the full script in one code block, then a note on the exact commands for merge, split, and extract. </format>
Builds a runnable Python CLI that merges, splits, and extracts pages from PDFs, ready to run.
Pro tip: Use the extract subcommand with a page range to pull one section out of a big report without touching the original.
Directory Tree Size Analyzer
25/30You are a Python systems engineer. <context> I need a self-contained Python script that analyzes disk usage under a folder and shows me where the space actually goes, runnable in the terminal like a scriptable du. </context> <inputs> - Root folder: [PATH] - Depth to report: [E.G. TOP 2 LEVELS] - Sort by: [SIZE DESC / FILE COUNT] - Highlight files larger than: [E.G. 100MB] - Output: [CONSOLE TABLE / CSV] </inputs> <task> Write a script that walks the tree, sums sizes per directory (including nested contents), and prints a ranked tree up to the chosen depth with human-readable sizes and each folder's share of the total. Separately list individual files above the size threshold. Handle permission errors gracefully and show the grand total. Optionally export the full breakdown to CSV. </task> <constraints> - Standard library only (os, pathlib, argparse); count each file once; skip symlinks to avoid double counting and loops. - Human-readable sizes (KB/MB/GB); catch and report permission errors without stopping. - Docstrings, comments on the recursive sizing, main guard. </constraints> <format> Return the full script in one code block, then a note on changing the depth and threshold. </format>
Produces a runnable Python disk-usage analyzer that ranks folders by size with a big-file list, ready to run.
Pro tip: Set the large-file threshold to spot the handful of files eating your disk before you go deleting whole folders.
Most people use 10% of Claude. Tutorials unlock the rest.
AI Academy: 300+ hands-on tutorials on Claude, ChatGPT, Midjourney, and 50+ AI tools. New tutorials added every week.
Small Apps & CLIs
5 promptsArgparse To-Do Manager CLI
26/30You are a Python engineer who builds clean command-line tools. <context> I need a self-contained Python CLI to manage a to-do list from the terminal, with data saved between runs, runnable as-is. </context> <inputs> - Storage: [JSON FILE / SQLITE] - Fields per task: [E.G. TITLE, DUE DATE, PRIORITY, DONE] - Commands I want: [ADD, LIST, DONE, REMOVE, EDIT] - List filters and sorting: [E.G. BY DUE DATE, SHOW ONLY OPEN] - Where to store the file: [PATH, DEFAULT ~/.todos.json] </inputs> <task> Write a CLI using argparse subcommands for each command, persisting tasks to the chosen store between runs. add creates a task, list prints a formatted table with filters and sorting, done marks complete, remove deletes by id, and edit updates fields. Assign stable ids, format the table with aligned columns and a friendly empty state, and confirm each action. </task> <constraints> - Standard library only (argparse, json or sqlite3, pathlib, datetime); create the store on first run. - Validate dates and ids with clear errors; never corrupt the file on a crash, write atomically. - Docstrings, comments, main guard with argparse subcommands. </constraints> <format> Return the complete tool in one code block, then a note on the commands and where data is stored. </format>
Generates a runnable argparse to-do CLI with persistent storage and subcommands, ready to run.
Pro tip: Pick SQLite over JSON if you will have hundreds of tasks; tell Claude and it swaps the storage layer cleanly.
Expense Tracker CLI with SQLite
27/30You are a Python engineer who builds practical personal-finance tools. <context> I need a self-contained Python CLI to log expenses and see summaries, backed by SQLite, runnable as-is. </context> <inputs> - Fields per expense: [DATE, AMOUNT, CATEGORY, NOTE] - Categories: [E.G. FOOD, TRANSPORT, RENT, FUN] - Reports I want: [MONTHLY TOTAL, BY CATEGORY, BUDGET VS ACTUAL] - Monthly budget per category: [OPTIONAL AMOUNTS] - Database path: [PATH] </inputs> <task> Write a CLI with subcommands: add (log an expense), list (filter by month and category), report (monthly totals, breakdown by category with percentages, and budget-versus-actual if budgets are set), and export (write a CSV). Store data in SQLite with a proper schema, validate amounts and dates, and format money and the report tables clearly. </task> <constraints> - Standard library only (argparse, sqlite3, datetime, csv); parameterized SQL only. - Validate that amount is a positive number and the date parses; friendly errors, no tracebacks for user mistakes. - Docstrings, comments, main guard with argparse subcommands. </constraints> <format> Return the complete tool in one code block, then a note on the commands and setting category budgets. </format>
Builds a runnable SQLite-backed expense tracker CLI with reports and CSV export, ready to run.
Pro tip: Set category budgets so the report subcommand flags overspending automatically instead of you eyeballing the totals.
Password Generator & Strength Checker CLI
28/30You are a Python engineer with a security mindset. <context> I need a self-contained Python CLI that generates strong passwords and rates the strength of ones I paste in, runnable as-is. </context> <inputs> - Default length: [E.G. 20] - Character sets: [LOWER, UPPER, DIGITS, SYMBOLS, WHICH ARE ON] - Options: [EXCLUDE AMBIGUOUS CHARS / PASSPHRASE MODE WITH WORDS] - Number to generate at once: [E.G. 5] - Strength rules: [E.G. ENTROPY BITS, COMMON-PASSWORD CHECK] </inputs> <task> Write a CLI with two subcommands: gen (produce N passwords of the given length and character sets, or a word-based passphrase, using a cryptographically secure source) and check (rate a password's strength by estimated entropy, character variety, length, and whether it matches obvious weak patterns, returning a score and specific improvement tips). Never write generated passwords to logs. </task> <constraints> - Use the secrets module for all randomness, never random for passwords; standard library only. - Estimate entropy honestly based on the pool size and length; explain the score. - Docstrings, comments, main guard with argparse subcommands. </constraints> <format> Return the complete tool in one code block, then a note on the commands and adjusting the strength thresholds. </format>
Produces a runnable Python CLI that generates secure passwords and scores password strength, ready to run.
Pro tip: Turn on passphrase mode for logins you type by hand; it gives high entropy that is far easier to remember than symbols.
Markdown-to-HTML Note Converter CLI
29/30You are a Python engineer who builds small static-content tools. <context> I need a self-contained Python CLI that converts a folder of Markdown notes into styled, standalone HTML pages with an index, runnable as-is. </context> <inputs> - Source folder of .md files: [PATH] - Output folder: [PATH] - Styling: [MINIMAL / DARK / MY OWN CSS FILE] - Extras: [TABLE OF CONTENTS / CODE HIGHLIGHTING / GENERATE INDEX PAGE] - Site title: [TITLE FOR THE INDEX] </inputs> <task> Write a CLI that reads each Markdown file, converts it to HTML, wraps it in a clean responsive template with the chosen styling, and writes one HTML file per note plus an index.html linking them all with titles pulled from each file's first heading. Preserve relative links between notes and copy over referenced images. Print what was generated. </task> <constraints> - Use the markdown package (pip install markdown); everything else standard library. - Self-contained output (inline CSS) so pages work offline; never overwrite the source files. - Docstrings, comments, main guard with argparse. </constraints> <format> Return the complete tool in one code block, then a note on running it and swapping in custom CSS. </format>
Generates a runnable Python CLI that turns a folder of Markdown notes into a styled static HTML site, ready to run.
Pro tip: Keep the first line of each note as an H1 title; the converter uses it for both the page title and the index link text.
Terminal Pomodoro Timer
30/30You are a Python engineer who builds friendly terminal apps. <context> I need a self-contained Python CLI Pomodoro timer that runs focus and break intervals in the terminal with a live countdown and notifications, runnable as-is. </context> <inputs> - Focus length in minutes: [E.G. 25] - Short break and long break: [E.G. 5 / 15] - Cycles before a long break: [E.G. 4] - Notification style: [TERMINAL BELL / DESKTOP NOTIFICATION / BOTH] - Session log: [APPEND COMPLETED SESSIONS TO A FILE?] </inputs> <task> Write a CLI that runs the Pomodoro cycle: a live-updating single-line countdown for each focus and break interval, a clear banner when switching phases, a bell or desktop notification at each transition, and a session summary at the end. Track completed focus sessions this run and optionally append each to a log file with a timestamp. Exit cleanly on Ctrl+C, printing the summary. </task> <constraints> - Standard library first (time, argparse, datetime); if desktop notifications need a package, list it and degrade gracefully to the terminal bell if unavailable. - The countdown must update in place (carriage return), not spam new lines; clean shutdown on Ctrl+C. - Docstrings, comments, main guard. </constraints> <format> Return the complete tool in one code block, then a note on the commands and enabling desktop notifications. </format>
Builds a runnable Python terminal Pomodoro timer with live countdown, notifications, and session logging, ready to run.
Pro tip: Enable the session log so you can count how many focus blocks you actually complete in a day, not just how many you planned.
Frequently Asked Questions
Prompts are the starting line. Tutorials are the finish.
A growing library of 300+ hands-on tutorials on ChatGPT, Claude, Midjourney, and 50+ AI tools. New tutorials added every week.
7-day free trial. Cancel anytime.