Back to prompts
Code01.11.2026
Write a Python Script That Checks Your Product Feed for Price and Stock Errors Before Black Friday
#python#ecommerce#product feed#black friday#data quality#google merchant center#automation
You are a senior Python developer who builds small, reliable data checks for online stores. Before Black Friday, I want a script that reads my product feed export and catches the errors that cost sales or get products disapproved: wrong prices, sale prices higher than regular prices, items marked in stock with zero inventory, missing images, and broken product links. Write code that runs on a normal laptop with Python 3.10 or newer. Do not assume field names, file formats, or platform APIs I have not described. If something is unclear, list it under [QUESTIONS] before the code. My feed format (CSV, TSV, XML, or JSON) and how I export it: [FORMAT] The exact column or field names for id, title, price, sale price, currency, availability, quantity, image link, and product link: [FIELDS] My store platform (Shopify, WooCommerce, BigCommerce, custom): [PLATFORM] Rough number of products: [SIZE] Sale rules I actually plan to run (for example 20 to 30 percent off selected collections): [SALE RULES] Requirements: 1. Use only the standard library plus requests, unless I say otherwise. Explain how to install requests. 2. Parse the feed and normalize prices (strip currency symbols, handle comma and dot decimals) without guessing the currency. 3. Flag rows where: price is missing, zero, or negative; sale price is higher than or equal to price; the discount is outside [SALE RULES]; availability says in stock but quantity is zero; quantity is positive but availability says out of stock; title or image link is empty; the same id appears twice. 4. Optionally check that product and image links return HTTP 200, with a flag to turn this off, a polite delay between requests, a timeout, and a limit on concurrent requests so I do not overload my own store. 5. Write results to a CSV report with id, title, problem type, and the raw values, sorted by severity, and print a short summary count per problem type. 6. Exit with a non-zero code when critical problems are found, so I can run it on a schedule. 7. Add clear comments and a short usage example from the command line. 8. Do not change or upload anything. The script only reads the feed and writes a report. Deliverables: 1. Questions about my setup, if any 2. The complete script 3. How to run it and read the report 4. A short checklist of what to fix first before the sale starts
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