{"id":19871325,"url":"https://github.com/mehdislr/streamlit-survey","last_synced_at":"2025-03-01T00:47:17.935Z","repository":{"id":245603641,"uuid":"815298572","full_name":"MehdiSlr/Streamlit-Survey","owner":"MehdiSlr","description":"The Streamlit Survey application is designed to create and manage surveys using Streamlit and Google Sheets. To run the program, check the link below 👇🏻","archived":false,"fork":false,"pushed_at":"2024-06-22T17:49:56.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T16:34:56.291Z","etag":null,"topics":["analytics","gsheets","python","streamlit","survey"],"latest_commit_sha":null,"homepage":"https://st-survey.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MehdiSlr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-14T19:52:57.000Z","updated_at":"2024-06-22T17:51:51.000Z","dependencies_parsed_at":"2024-06-23T01:25:22.780Z","dependency_job_id":null,"html_url":"https://github.com/MehdiSlr/Streamlit-Survey","commit_stats":null,"previous_names":["mehdislr/streamlit-survey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiSlr%2FStreamlit-Survey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiSlr%2FStreamlit-Survey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiSlr%2FStreamlit-Survey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiSlr%2FStreamlit-Survey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MehdiSlr","download_url":"https://codeload.github.com/MehdiSlr/Streamlit-Survey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241295177,"owners_count":19939771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","gsheets","python","streamlit","survey"],"created_at":"2024-11-12T16:11:56.237Z","updated_at":"2025-03-01T00:47:17.908Z","avatar_url":"https://github.com/MehdiSlr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streamlit Survey Application\n\n## Overview\n\nThe Streamlit Survey application is designed to create and manage surveys using Streamlit and Google Sheets. This app allows users to fill out surveys and view results directly within the Streamlit interface, leveraging Google Sheets for data storage and management.\n\n## Features\n\nSurvey Creation and Submission: Users can take the survey directly from the app.\nResults Display: View survey results in real-time.\nGoogle Sheets Integration: Read and write survey data to a Google Sheet.\nStreamlit Components: Utilizes Streamlit's interactive widgets and layout options.\n\n## Installation\n\nTo install the necessary dependencies, run:\n\n```bash\npip install -r requirements.txt\n```\n\n## Requirements\n\n- `Python` 3.8 or higher\n- `streamlit`\n- `gspread`\n- `gspread-pandas`\n- `gspread-dataframe`\n- `gspread-formatting`\n- `pandas`\n- `duckdb`\n- `sql-metadata`\n- `validators`\n\n## Usage\n\n1. Clone the Repository:\n\n```bash\ngit clone https://github.com/MehdiSlr/Streamlit-Survey.git\ncd Streamlit-Survey\n```\n\n2. Create API Key in google cloud console and give access in your Google Sheet.\n\n3. Create `secrets.toml` file in `.streamlit` directory in the root of the project based on the API Key json file you created in google cloud console.:\n\n```toml\n[secrets]\n\n[connections.gsheets]\nspreadsheet = \"YOUR_SPREADSHEET_URL\"\nworksheet = \"YOUR_WORKSHEET_GID\"\ntype= \"service_account\"\nproject_id = \"YOUR_PROJECT_ID\"\nprivate_key_id = \"YOUR_PRIVATE_KEY_ID\"\nprivate_key = \"YOUR_PRIVATE_KEY\"\nclient_email = \"YOUR_CLIENT_EMAIL\"\nclient_id = \"YOUR_CLIENT_ID\"\nauth_uri = \"https://accounts.google.com/o/oauth2/auth\"\ntoken_uri = \"https://oauth2.googleapis.com/token\"\nauth_provider_x509_cert_url = \"https://www.googleapis.com/oauth2/v1/certs\"\nclient_x509_cert_url = \"https://www.googleapis.com/robot/v1/metadata/x509/streamlit-gsheets%40api-class-423418.iam.gserviceaccount.com\"\nuniverse_domain = \"googleapis.com\"\n```\n\n4. Run the Application:\n\n```bash\nstreamlit run main.py\n```\n\n## Main Scripts\n\n- `main.py`: The entry point of the application. It includes the main layout and navigation buttons for taking the survey and viewing results.\n- `Public_Sheet_Example.py`: Example script demonstrating how to connect to a public Google Sheet and read data using GSheetsConnection.\n\n## Google Sheets Connection\n\nIn the `Public_Sheet_Example.py`, the connection to Google Sheets is established using a public URL:\n\n```python\nfrom streamlit_gsheets import GSheetsConnection\n\nurl = \"https://docs.google.com/spreadsheets/d/your_sheet_id/edit?usp=sharing\"\nconn = st.connection(\"gsheets\", type=GSheetsConnection)\ndf = conn.read(spreadsheet=url, usecols=[0, 1])\nst.dataframe(df)\n```\n\n## Survey Navigation\n\nThe main.py script uses Streamlit's button components to navigate between different pages:\n\n```python\ncol1, col2 = st.columns(2)\n\nwith col1:\n    if st.button(\"Take the Survey\", use_container_width=True, type=\"primary\"):\n        st.switch_page(\"pages/Survey.py\")\n\nwith col2:\n    if st.button(\"See Survey Results\", use_container_width=True):\n        st.switch_page(\"pages/Result.py\")\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.\n\n## Acknowledgements\n\n- Using [Streamlit](https://streamlit.io) API, gspread, gspread-pandas, gspread-dataframe, gspread-formatting, pandas, duckdb, sql-metadata, and validators.\n- Using [Google Sheets](https://docs.google.com/spreadsheets/) API.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\nThis project was created by [Mehdi Slr](https://github.com/MehdiSlr).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdislr%2Fstreamlit-survey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehdislr%2Fstreamlit-survey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdislr%2Fstreamlit-survey/lists"}