{"id":24649,"library":"st-gsheets-connection","title":"Streamlit GSheets Connection","description":"A Streamlit Connection for Google Sheets, providing a simple interface to read and write data using the official Streamlit Connections API. Current version is 0.1.0, with moderate release cadence.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/streamlit/gsheets-connection","tags":["streamlit","google-sheets","connection","gsheets"],"install":[{"cmd":"pip install st-gsheets-connection","lang":"bash","label":"Pip install"}],"dependencies":[{"reason":"Required as the framework for the connection.","package":"streamlit","optional":false},{"reason":"Underlying Google Sheets API client.","package":"gspread","optional":false}],"imports":[{"note":"The module is st_gsheets_connection, not a submodule of streamlit.","wrong":"from streamlit.gsheets import GSheetsConnection","symbol":"GSheetsConnection","correct":"from st_gsheets_connection import GSheetsConnection"}],"quickstart":{"code":"import streamlit as st\nfrom st_gsheets_connection import GSheetsConnection\n\nconn = st.connection(\"gsheets\", type=GSheetsConnection)\ndf = conn.read(worksheet=\"Sheet1\")\nst.dataframe(df)","lang":"python","description":"Basic example: creates a connection and reads a worksheet into a Pandas DataFrame."},"warnings":[{"fix":"Use `conn = st.connection(\"gsheets\", type=GSheetsConnection)` instead of `GSheetsConnection(...)` directly.","message":"Version 0.1.0 includes a breaking change: the connection now requires Streamlit's new `st.connection` API. Old pattern using `GSheetsConnection` directly without `st.connection` no longer works.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Install with `pip install st-gsheets-connection`, then import with `from st_gsheets_connection import GSheetsConnection`.","message":"The package name on PyPI is `st-gsheets-connection`, but the import module is `st_gsheets_connection`. Hyphen vs underscore mismatch often causes import errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Pin gspread to <6.0 or use gspread-dataframe compatible with gspread 6.0.","message":"`gspread` version 6.0 is not compatible with the latest version of `gspread-dataframe`. Ensure you install compatible versions.","severity":"deprecated","affected_versions":"0.0.4+"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install st-gsheets-connection` and then import with `from st_gsheets_connection import GSheetsConnection`.","cause":"Installed the package but the import name is different. The package uses hyphen, import uses underscore.","error":"ModuleNotFoundError: No module named 'st_gsheets_connection'"},{"fix":"Use `st.connection(\"gsheets\", type=GSheetsConnection)` and let Streamlit handle instantiation.","cause":"Trying to instantiate GSheetsConnection directly with `type` argument that is only meant for `st.connection`.","error":"TypeError: GSheetsConnection() got multiple values for argument 'type'"},{"fix":"Provide credentials via Streamlit secrets as `[connections.gsheets]` with `service_account` JSON or `type = \"service_account\"`.","cause":"Passed an unsupported type for credentials in `st.connection`.","error":"ValueError: The 'credentials' argument must be a dict, a path to a service account file, or None."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}