PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Chat - (gpt-5.6)
Token size
3,698
Example input
[DELETE THIS TEXT AND PASTE YOUR BRIEF: TASK: describe the small program you want: what it does, what it takes as input, what it should output, and any rule it must follow β€” at least 10 words. Do not include names of individuals, companies, or products, confidential data, or secrets. Language: optional, Python by default or JavaScript. Leave blank for Python. Acceptance checks: optional, one to five sample inputs in words with the expected results. Leave blank and the tool writes them. Allowed libraries: optional, names of widely known libraries. Leave blank for the standard library only.]: TASK: A command-line program that reads a CSV file of support tickets with the columns ticket_id, category, opened, and closed (dates), and prints for each category the number of tickets and the average number of days to close, ignoring tickets that are not closed yet. Show the result as a table sorted by ticket count. Language: Python Acceptance checks: Allowed libraries: pandas
Example output
MODE: Standalone Pass 1 of 3 Future Code Maker situation: A Python command-line tool for analyzing support ticket closure statistics by category. πŸ” Detected: Language Python, program CSV support ticket analyzer, gaps K4 Data Link, K8 User Experience, K10 Detail Depth, K12 Final Check, defaults chosen for ISO date format, command-line usage, input validation, acceptance examples, pandas for CSV processing and data aggregation ──────────────────── 🟒 PROGRAM: Program name: Support Ticket Analyzer What it does: Reads a CSV file containing support tickets and groups closed tickets by category. Displays the number of closed tickets and their average closure time in days, sorted by ticket count from highest to lowest. Open tickets are excluded from both calculations. How to run: Install pandas with `python3 -m pip install pandas` Save the code as `ticket_analyzer.py`. Run: `python3 ticket_analyzer.py tickets.csv` β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ πŸ’» CODE β€” save as ticket_analyzer.py: ```python import argparse import sys import pandas as pd REQUIRED_COLUMNS = [ "ticket_id", "category", "opened", "closed", ] def analyze_tickets(filename): try: df = pd.read_csv(filename) except FileNotFoundError: raise ValueError(f"File not found: {filename}") except pd.errors.EmptyDataError: raise ValueError("The CSV file is empty.") except pd.errors.ParserError: raise ValueError("The CSV file could not be parsed.") missing = [ col for col in REQUIRED_COLUMNS if col not in df.columns ] if missing: raise ValueError( "Missing required columns: " + ", ".join(missing) ) if df.empty: raise ValueError("The CSV contains no tickets.") # Exclude tickets that have not been closed. df = df.dropna(subset=["closed"]).copy() if df.empty: print("No closed tickets found.") return # Parse dates. df["opened"] = pd.to_datetime( df["opened"], errors="coerce" ) df["closed"] = pd.to_datetime( df["closed"], errors="coerce" ) if df["opened"].isna().any(): raise ValueError( "One or more closed tickets have invalid opened dates." ) if df["closed"].isna().any(): raise ValueError( "One or more closed tickets have invalid closed dates." ) if df["category"].isna().any(): raise ValueError( "Closed tickets must have a category." ) if (df["closed"] < df["opened"]).any(): raise ValueError( "A ticket has a closed date before its opened date." ) # Calculate closure duration in days. df["days_to_close"] = ( df["closed"] - df["opened"] ).dt.total_seconds() / 86400 # Aggregate statistics by category. results = ( df.groupby("category") .agg( ticket_count=("ticket_id", "count"), average_days_to_close=("days_to_close", "mean"), ) .reset_index() ) # Sort by ticket count, then category. results = results.sort_values( by=["ticket_count", "category"], ascending=[False, True], ) results["average_days_to_close"] = ( results["average_days_to_close"].round(2) ) print("\nSupport Ticket Summary\n") print( results.to_string( index=False, formatters={ "average_days_to_close": "{:.2f}".format }, ) ) def main(): parser = argparse.ArgumentParser( description="Analyze support ticket closure statistics." ) parser.add_argument( "csv_file", help="Path to the support tickets CSV file", ) args = parser.parse_args() try: analyze_tickets(args.csv_file) except ValueError as error: print(f"Error: {error}", file=sys.stderr) sys.exit(1) if __name__ == "__main__": main() ``` β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ βœ… ACCEPTANCE CHECKS β€” run these yourself: a. CSV containing three closed tickets in Hardware and two in Software, with closure durations of 2, 4, 6, 3 and 5 days respectively. Expected result: Hardware has 3 tickets and an average of 4.00 days; Software has 2 tickets and an average of 4.00 days. Hardware appears first. b. CSV containing two closed tickets and one ticket with an empty closed date. Expected result: Only the two closed tickets contribute to category counts and averages. c. CSV containing tickets from three categories with different ticket counts. Expected result: Categories appear in descending order of ticket count. d. CSV containing only open tickets. Expected result: No closed tickets found. e. CSV missing the required closed column. Expected result: A clear error identifying the missing required column. ──────────────────── ℹ️ "This tool writes the code of one small program from your brief; it does not run or test it, choose for you, state working, security, performance, cost, market, legal, or feasibility conclusions, or predict how the code or an assistant will turn out. Run the acceptance checks and review the code yourself before relying on it." Assumptions made: * Date format: Standard dates recognizable by pandas, preferably YYYY-MM-DD. * Ticket counting: Only closed tickets are counted because unclosed tickets are excluded from the analysis. * Sorting: Highest ticket count first, with alphabetical category ordering for ties. * pandas: Used for CSV reading, date calculations, grouping and tabular output. * User experience: A CSV filename is supplied as a command-line argument. ❓ Want a change? Reply "change:" followed by one request, such as a different rule or output, to get an updated program. πŸ’‘ Go deeper: search "Future Function Finder" on PromptBase for what the software does, or "Future Innovation Finder" to test its idea. Want one direct prompt? Search "Universal Instruction Generator". βš™οΈ "Built for ChatGPT; other AI models, providers, and versions are untested. Use at your own discretion. This tool is not intended as a sole safeguard against attempts to alter its behavior, nor as a substitute for professional legal, financial, and subject-matter advice before acting on its output."
GPT

Future Code Maker

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
GPT-5.6
Tested icon
Guide icon
4 examples icon
Free credits icon
πŸ’» Describe a small program in plain language and get one complete Python or JavaScript file: a short summary, how to run it, the code, and 3-5 acceptance checks you run yourself. The tool fills gaps in your brief with simple defaults and lists them. Revise with up to two follow-up changes. ⚠️ Not engineering, code-review, legal, or security advice; code is not run or tested; no working, security, or performance claims; not liable for outcomes. Tested on ChatGPT; other models untested.
...more
Updated 2 days ago
Report
Browse Marketplace