{"id":19044258,"url":"https://github.com/arturogonzalezm/streamlit_crud","last_synced_at":"2026-05-17T04:32:05.420Z","repository":{"id":243772514,"uuid":"813403070","full_name":"arturogonzalezm/streamlit_crud","owner":"arturogonzalezm","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-11T03:23:06.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T08:14:37.418Z","etag":null,"topics":["python3","python311","streamlit","streamlit-webapp"],"latest_commit_sha":null,"homepage":"","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/arturogonzalezm.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-11T02:49:02.000Z","updated_at":"2024-11-12T09:16:39.000Z","dependencies_parsed_at":"2024-06-11T04:16:57.196Z","dependency_job_id":"0f69a5c9-5282-46f2-a4b1-be878b4097cc","html_url":"https://github.com/arturogonzalezm/streamlit_crud","commit_stats":null,"previous_names":["arturogonzalezm/update_snowflake_tables_from_streamlit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Fstreamlit_crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Fstreamlit_crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Fstreamlit_crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2Fstreamlit_crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arturogonzalezm","download_url":"https://codeload.github.com/arturogonzalezm/streamlit_crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240100558,"owners_count":19747689,"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":["python3","python311","streamlit","streamlit-webapp"],"created_at":"2024-11-08T22:45:20.166Z","updated_at":"2026-05-09T16:30:21.914Z","avatar_url":"https://github.com/arturogonzalezm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/arturogonzalezm/update_snowflake_tables_from_streamlit/graph/badge.svg?token=aPB4a2ulm9)](https://codecov.io/gh/arturogonzalezm/update_snowflake_tables_from_streamlit)\n[![PyLint](https://github.com/arturogonzalezm/update_snowflake_tables_from_streamlit/actions/workflows/workflow.yml/badge.svg)](https://github.com/arturogonzalezm/update_snowflake_tables_from_streamlit/actions/workflows/workflow.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\n# StreamLit CRUD App\n\nThis project is a Streamlit application for editing Snowflake tables. The application allows users to select a table from Snowflake, edit the data, and apply changes (update, insert, delete) directly to the Snowflake database.\n\n## Project Structure\n\n```python\nstreamlit_crud/\n│\n├── app.py\n├── backend/\n│ ├── init.py\n│ ├── data_operations.py\n│ ├── snowflake_connection.py\n│ └── sql_statements.py\n├── tests/\n│ ├── init.py\n│ ├── test_data_operations.py\n│ ├── test_snowflake_connection.py\n│ └── test_sql_statements.py\n```\n\n## Sequence Diagram\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant StreamlitApp\n    participant DataOperations\n    participant SQLStatements\n    participant SnowflakeConnection\n\n    User-\u003e\u003eStreamlitApp: Select Table\n    StreamlitApp-\u003e\u003eDataOperations: get_tables()\n    DataOperations-\u003e\u003eSnowflakeConnection: session\n    SnowflakeConnection--\u003e\u003eDataOperations: return session\n    DataOperations--\u003e\u003eStreamlitApp: return tables\n\n    User-\u003e\u003eStreamlitApp: Edit Data\n    StreamlitApp-\u003e\u003eDataOperations: get_dataset(tabname)\n    DataOperations-\u003e\u003eSnowflakeConnection: session\n    SnowflakeConnection--\u003e\u003eDataOperations: return session\n    DataOperations--\u003e\u003eStreamlitApp: return dataset\n\n    User-\u003e\u003eStreamlitApp: Submit Changes\n    StreamlitApp-\u003e\u003eSQLStatements: process_cols(edited_rows)\n    StreamlitApp-\u003e\u003eSQLStatements: select_cols(dataset, idx)\n    StreamlitApp-\u003e\u003eSQLStatements: insert_cols(added_rows, tabname)\n    StreamlitApp-\u003e\u003eSQLStatements: delete_cols(idx, dataset, tabname)\n    SQLStatements--\u003e\u003eStreamlitApp: return SQL statements\n\n    StreamlitApp-\u003e\u003eSnowflakeConnection: Execute SQL Statements\n    SnowflakeConnection--\u003e\u003eStreamlitApp: return execution result\n\n    StreamlitApp-\u003e\u003eUser: Display Success/Error Message\n```\n\n### Files Description\n\n- `main.py`: The main Streamlit application file that includes the UI for selecting and editing Snowflake tables.\n- `backend/`: Directory containing the backend logic.\n  - `__init__.py`: Indicates that the directory is a Python package.\n  - `data_operations.py`: Functions for interacting with Snowflake tables (e.g., `get_dataset`, `get_tables`).\n  - `snowflake_connection.py`: Singleton class for managing the Snowflake connection.\n  - `sql_statements.py`: Functions for generating SQL statements (e.g., `process_cols`, `select_cols`, `insert_cols`, `delete_cols`).\n- `tests/`: Directory containing the unit tests.\n  - `__init__.py`: Indicates that the directory is a Python package.\n  - `test_data_operations.py`: Unit tests for the `data_operations.py` module.\n  - `test_snowflake_connection.py`: Unit tests for the `snowflake_connection.py` module.\n  - `test_sql_statements.py`: Unit tests for the `sql_statements.py` module.\n\n## Running the Application\n\nTo run the Streamlit application, execute the following command in your terminal:\n\n```sh\nstreamlit run app.py\n```\n\nThis will start the Streamlit server and open the application in your default web browser.\n\n## Running the Tests\n\nTo run the unit tests, execute the following command in your terminal:\n\n```sh\npytest\n```\n\nThis will run all the tests in the `tests/` directory and display the results in the terminal.\n\n## Class Diagram\n\n```mermaid\nclassDiagram\n    class SnowflakeConnection {\n        -session: Session\n        +session: Session\n        +_create_session(): Session\n    }\n\n    class data_operations {\n        +get_dataset(table_name: str): DataFrame\n        +get_tables(): DataFrame\n    }\n\n    class sql_statements {\n        +process_cols(columns: dict): str\n        +select_cols(df: DataFrame, idx: int): str\n        +insert_cols(cols: dict, tabname: str): str\n        +delete_cols(idx: int, df: DataFrame, tabname: str): str\n    }\n\n    SnowflakeConnection --\u003e data_operations : Uses\n    SnowflakeConnection --\u003e sql_statements : Uses\n```\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Fstreamlit_crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturogonzalezm%2Fstreamlit_crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Fstreamlit_crud/lists"}