Repository navigation
v4.0.0
First release under new maintenance. The library now works with current gspread, and reading a sheet no longer leaves the awkward parts to the caller.
Breaking
- Requires gspread 6.
Client.authis nowClient.http_client.auth, following gspread's move of HTTP execution into a separateHTTPClient. - Requires Python 3.9 and pandas 2.0. gspread 6 needs 3.8 and pandas 2 needs 3.9, so the older versions the package advertised could not have worked.
Added
df_to_sheet(..., append=True)adds rows below the data already in a sheet, matching your columns to the headers that are there. A reordered or renamed frame lands in the right place instead of being written positionally. (#86)sheet_to_df(..., convert_types=True)gives columns their real dtypes instead of returning everything asobject. Strict: a column converts only when every non-empty value converts cleanly, so one strayN/Aleaves the column as text rather than quietly nulling that row. (#18)sheet_to_df(..., detect_layout=True)finds where the table starts, for sheets that open with a report title or a blank row.-1forunformatted_columns/formula_columns, meaning every column. (#56, thanks @ChristophBoerlin)folder_idonClient.move_fileandSpread.move, for destinations a path can't name. (#48, thanks @dtquandt)
All three of the first group work with no configuration and no new dependencies. Setting GSPREAD_PANDAS_AI_API_KEY additionally lets them call an OpenAI-compatible model for the harder cases — renames that don't look alike, stacked headers, types that only make sense from a column's name. The model is only ever asked for a small structured answer, nothing it returns is executed, and anything naming a column, header or type that isn't really there is discarded.
Fixed
- The rate-limit auto-retry had silently stopped retrying. It matched
"RESOURCE_EXHAUSTED"againststr(APIError), and gspread 6 no longer puts the status field there. It now reads the structured error. Client.expiryandhttp_client.login()raisedAttributeError. gspread only records credentials when it builds the session itself, and this package always hands one in.- No more pandas
FutureWarningabout silent downcasting when a sheet has a column of blanks. (#102, thanks @IvanKaramazov)
Verified
140 passed on Python 3.9 through 3.13, against both pandas 2.3.3 and 3.0.5.
Published by trusted publishing (OIDC) — no API token involved.