Streamlit Application to Append Data

saurav dash
2 min readSep 8, 2022

--

I woke up and thought of putting my thoughts for creating a Web Application for appending data.

Requirements

We will write code in python. So, we need writer for data to append in csv file and for web application we need Streamlit

Requirements for the application
This is how our application will look like after completion.

Before going into python coding first make a csv file, So the name csv file will be data.csv

Let’s add some heading for the application.

Now let’s create variables and asking user to give their respected inputs for the entry in the csv

Making input variables for application.
Create header in .csv file

Let’s create a submit button for submission of values in which contain values of data.

st.button(“Submit Information”)

But this is not sufficient, we need to append the data into csv, So the workaround for this is as follows:

If the submit button is pressed append the data stored into the csv. So, we need a writer object which will append data but before that we have to open the csv with python code and apply the method of append, And at last close the file. Here we go for the code

submit logic in csv

Then add a message box at bottom after successful append of data.

st.info(“Data appended successfully.”)

Combined code

Find Code in my GitHub Repo

--

--