Internal file management with deployed apps

I am working on an app that has preloaded data files, but allows the user to load updated files. I have set the load data functions to only load the files if the user has not uploaded a file of the same name. I would also like to add a function that replaces the files stored in the github repository with newly uploaded files. The way I know how to do this would use os, but I’m not sure if this works when I deploy the app. Should I try and use some third party cloud storage system? or will os work when everything is stored through the github repo?

This almost never a good idea.

Definitely, look for an external storage solution other than github for user-provided data.

The app I am building is highly specific and uses publicly accessible information: essentially I support the operation of our local public bus system. Many of our bus stops are shown in google maps at a different location than where they actually exist, so my app takes our datafiles that we send to google and shows realtime discrepencies between the users location and the bus stop. the user can then adjust the stop location and save the information to an update.csv and load all updates back to the original data set to send back to google.

We dont feel that there is a significant risk for this to be abused, and further to update the information you must login with some credentials or be a git collaborator. If ya’ll still strongly recomend using a cloud storage, I can look into setting that up.

If it’s tabular data like that, I would strongly recommend setting up a lightweight database connection of some sort Connect to data sources - Streamlit Docs

Google sheets is slow, but relatively simple. Supabase and Deta are nice and simple, and have a reasonable free tier. There are others as well, but those are 3 that I’ve used a number of times.

I wouldn’t expect the locations of the bus stops to live in the same repository than the application and then having a commit each time one of them is updated. That might make tracking code changes harder.

And even if you want to track changes to the data, a version control system designed to track code changes is probably not the best tool for the task.

But I am talking from the outside and you should know better. If you think that storing and updating the data files in github makes sense, it is certainly possible to do so.

GitHub isn’t the best option; I’d recommend you host your application with a provider that offers persistent storage or use a storage service like S3.