Back to prompts
Code23.11.2026
Write a Python Script That Tracks Return Deadlines for Your Black Friday and Cyber Monday Purchases
#python#csv#returns#black friday#cyber monday#personal finance#automation
You are a careful Python developer who writes small, readable scripts for everyday personal automation. I am buying gifts and deals during Black Friday and Cyber Monday from several stores, and every store has a different return window, holiday return extension, and condition. I want a script that reads a simple list of my purchases and tells me which returns are coming due, so I do not miss a deadline on something I want to send back. Write the script and explain how to run it. Use only standard, well known libraries and the details I give you. Do not assume store return policies, holiday extensions, or dates I did not provide. If something is missing, mark it [NEEDS INPUT]. How I will keep my purchase list (CSV file, spreadsheet exported to CSV) and its file name: [FILE] The columns I have or want, such as store, item, order number, price paid, order date, delivery date, return window in days, holiday return deadline if the store published one, and return status: [COLUMNS] My time zone and today's date format preference: [TIME ZONE AND FORMAT] How many days of warning I want before a deadline: [WARNING DAYS] Python version I have and whether I can install packages with pip: [ENVIRONMENT] Whether I want a reminder output only in the terminal, as a CSV, or as calendar events (.ics) I can import: [OUTPUT] Requirements: 1. Read [FILE] with the csv module from the standard library, validate that the required columns from [COLUMNS] exist, and print a clear message listing any missing columns. 2. Calculate each item's deadline: use the holiday return deadline column if it is filled in; otherwise add the return window in days to the delivery date, or to the order date if the delivery date is empty, and state in the output which rule was used. Add a comment that stores may count days differently and I should confirm on the store's own policy page. 3. Skip items whose return status is kept, returned, or refunded, and treat any other value as open. 4. Group open items into overdue, due within [WARNING DAYS], and later, sorted by deadline, and show store, item, order number, price paid, deadline, and days left. 5. Show the total value of items still inside their return window, using only the prices in the file, and never guess missing prices. 6. If [OUTPUT] includes CSV or .ics, write a deadline report CSV and, for .ics, one all day event per open item with the item and store in the title, built with the standard library or the icalendar package if pip is allowed. 7. Handle a missing file, empty rows, bad dates, and non numeric return windows with clear warnings instead of a crash, and keep processing the other rows. 8. Never send purchase data anywhere; keep everything local and say so in a comment at the top. 9. Include a sample CSV with five rows covering a holiday deadline, a window counted from delivery, a missing delivery date, an already returned item, and a bad date, plus the expected output. Deliverables: 1. Complete Python script with comments 2. Sample CSV template and test data 3. Install and run instructions 4. Expected output for the sample data 5. Notes on limits and how to confirm each store's real return policy 6. One or two small extensions, such as a weekly reminder with a scheduler
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.
Tip
Fill every placeholder before you run the prompt. Keep one clear goal per run, then refine with a follow-up if needed.
When to use this prompt
- •Good for first drafts in Code
- •Keep variables filled so the model has enough context
- •Review AI output before sending or publishing