Save csv file in my github account

Summary

I have my streamlit connected with my github account. I have converted a dataframe into csv format and I need to save that csv file in the folder of my github account so that I can use that csv file further in my code. Any idea how to do that?

Code snippet:

def convert_df(df):
    return df.to_csv().encode('utf-8')
csv_file=convert_df(final)

Hi @qwertyf09,

Your best bet would probably be to use GitHub’s API to commit the file to your repo. The API docs are here and this seems to be an example of committing a file via Python.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.