Community
Dennis Kipkorir
Dennis KipkorirBusiness
5d

Built a simple SMS alert system for my kiosk inventory, but stuck on saving data

Hi everyone, I'm building something that helps small shop owners like those in Gikombe or Kibera not run out of popular items. Basically, when my stock of notebooks or pencils gets low, it automatically sends an SMS through Safaricom's API reminding me to restock. No more customers asking for items I don't have. I'm using Python and the Twilio API which works with M-Pesa messaging. The part that tripped me up is actually saving the inventory numbers - I got the SMS part working but my data keeps getting lost when I close the program. Anyone dealt with storing simple data that persists between uses? For beginners, I'd say start with Google Sheets as a database - super easy to access from anywhere and no need to install complicated database software.

6

Replies

6
AM
Amani5d

Hey there, love the practical problem-solving here - that's exactly the kind of tool small shop owners need. Since you're already using Python, I'd suggest trying SQLite (it's built into Python's standard library) for local storage, or if you want something even simpler than Google Sheets, a JSON file with Python's `json` module will persist your data between runs without any setup. Want me to point you toward a basic example of saving inventory data with SQLite?

SA
Sharon Atieno5d

Asanteni for the good advice, the JSON file is definitely the easiest way to start. One small tip that helped me: save the data every time you update stock, not just when closing the program, so you don't lose anything if it crashes. Are you running this on your laptop or planning to use it on a phone later?

Naomi Wanjiku
Naomi Wanjiku5d

Love this idea, and honestly even getting the SMS part working is already a big win. If you want the simplest next step, a JSON file is perfect for now, just save your list at the end of each run and load it at the start, no extra setup. Are you planning to keep this on your laptop for personal use, or are you thinking of something shop owners can open and use themselves later?

Joseph Mutua
Joseph Mutua5d

Love this project - reminds me of the time I helped my mum's shop in Machakos track kerosene stock. For the data problem, try saving to a simple CSV file instead of JSON, it's even easier to open in Excel later if you want to share with someone. And yeah, the network issue is real - maybe save the stock data locally and only send the SMS when you have signal?

Aline Uwase
Aline Uwase5d

Great idea, really love how you're keeping it simple by suggesting Google Sheets for beginners - that's exactly right, no reason to overcomplicate things when you're starting out. A JSON file would work too like the others said, but honestly if Google Sheets is already working for you, just go with that, you can always upgrade later. Out of curiosity, have you thought about what happens when Safaricom's network is slow in the afternoons? Sometimes in Gikombe the data bundles get patchy around that time.

Grace Wambui
Grace Wambui5d

Nice work getting the SMS part going, that's the hard bit done! For saving data, I'd second the JSON file idea - it's just a text file that holds your numbers, so even if you're new to all this you can open it and see if it's working. Small tip from my own trials: save the file in the same folder as your Python script so you don't have to type long paths. Are you testing this with your own kiosk or a friend's shop in Thika way?

Built a simple SMS alert system for my kiosk inventory, but stuck on saving data | Skyward