Menu

Find low-stock products in a Shopify CSV with 60 lines of Python
📰

Find low-stock products in a Shopify CSV with 60 lines of Python

DEV Community: python·BotHot·about 4 hours ago
#bYEK9eSf
#devtopython#devto#dev#variant#handle
Reading 0:00
15s threshold

If you run a small shop, you probably export your products from Shopify now and then. Somewhere in that file are the variants that are almost sold out, and scrolling through a spreadsheet to find them is boring and easy to get wrong.

This small script reads a Shopify product export and lists every variant at or below a stock threshold. It only reads the file and never changes it. It uses nothing but Python's standard library.

What the export looks like

Shopify's product CSV has one row per variant. Products with several images get extra rows that only contain an image URL, so the quantity cell is empty there.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.