skillfed

gspread-pandas

A package to easily open an instance of a Google spreadsheet and interact with worksheets through Pandas DataFrames.

gspread-pandas v4.2.1 355.2K downloads/30d#7,293 on PyPI412
Permissive license BSD Active released

What it is and what it does

gspread-pandas wraps gspread and pandas to simplify bidirectional data exchange with Google Sheets. It reads spreadsheets into DataFrames and writes DataFrames back to sheets, automatically handling headers, multi-level indexes, merged cells, and frozen rows. The package targets data analysts and scientists but works for anyone automating workflows between Google Sheets and Python.

Key features include automatic type inference (convert_types), layout detection for sheets with titles or blank rows (detect_layout), and intelligent append operations that match DataFrame columns to existing sheet headers by name rather than position. Optional AI-powered matching via OpenAI-compatible endpoints can handle column renames and stacked headers when configured. The package handles token refresh, retries on quota limits, and supports both OAuth and Service Account authentication.

Use it for:

  • Extract data from a messy Google Sheet into a pandas DataFrame for analysis, with automatic type conversion and layout detection.
  • Push analysis results from a Jupyter notebook back to a Google Sheet, preserving headers and matching columns by name.
  • Automate periodic data imports from Google Sheets into a headless Python script for ETL or reporting workflows.
  • Append new rows to an existing Google Sheet from a DataFrame, automatically aligning columns to the sheet's current headers.
  • Handle spreadsheets with multi-level headers or merged cells by leveraging built-in support for complex layouts.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Bridges Google Sheets and pandas DataFrames, letting you read spreadsheets into DataFrames and write DataFrames back to sheets with automatic header handling, type inference, and layout detection.

Yes. The package is actively maintained (last commit 2026-08-13), has low install friction, no known vulnerabilities, and solves a real pain point—bridging Google Sheets and pandas without boilerplate. It supports Python 3.9+, carries a permissive BSD license, and is in production-stable status. Install it if you regularly move data between Google Sheets and pandas.

Install

gspread-pandas on PyPI

pip

pip install gspread-pandas

uv

uv add gspread-pandas

poetry

poetry add gspread-pandas

Installing gspread-pandas

Before you install

Low friction: pure Python wheel with five straightforward runtime dependencies (gspread, pandas, decorator, google-auth, google-auth-oauthlib). Actively maintained—last commit 2026-08-13, 412 repository stars, production-stable classifier.

License in practice

BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for both open and closed projects.

Quickstart

pip install gspread-pandas

from gspread_pandas import Spread
import pandas as pd

spread = Spread('spreadsheet_name')
df = spread.sheet_to_df()
spread.df_to_sheet(df, replace=True)

Requires Python 3.9+, gspread 6, and pandas 2 or 3. Google client credentials (OAuth or Service Account) must be configured at ~/.config/gspread_pandas/google_secret.json or via environment variables before use.

Verify before relying

  • Whether the optional AI-powered column matching (via GSPREAD_PANDAS_AI_API_KEY) incurs costs or requires external API subscriptions.
  • Performance characteristics when handling very large datasets or high-frequency API calls against Google Sheets quota limits.
  • Actual monthly download volume and user base size.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — gspread, pandas, decorator, google-auth, google-auth-oauthlib
Maintenance actively maintained — 2 days since the last release
Last repo commit
First released
Downloads 355,210/month — #7,293 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gspread_pandas-4.2.1-py3-none-any.whl

Keywords: gspread, pandas, google, spreadsheets

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Office/Business :: Financial :: Spreadsheet

Tags

google sheets pandas integrationread write google spreadsheets dataframeautomate google sheets with pythongspread wrapper pandasspreadsheet data extraction pythongoogle drive sheets api wrapperpandas dataframe to google sheets
google-sheetsdataframe-iospreadsheet-automation

More Spreadsheet packages