Set worksheet contents using Pandas DataFrame
See original GitHub issueFor my own project work, I’ve written a function that sets the contents of a worksheet using a Pandas DataFrame. While similar in behavior to the feature offered by the pgsheets
package, it has additional features, especially the automatic chunking of DataFrame content to avoid the “API call limit” on large Google Sheet writes.
May I offer a pull request to gspread
to add this functionality?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
pandas.DataFrame.to_excel — pandas 1.5.2 documentation
To write to multiple sheets it is necessary to create an ExcelWriter object with a target file name, and specify a sheet in...
Read more >Example: Pandas Excel output with a worksheet table
An example of inserting a Pandas dataframe into an Excel worksheet table file using Pandas and XlsxWriter.
Read more >Python | Working with Pandas and XlsxWriter | Set – 2
Pandas writes Excel files using the XlsxWriter modules. XlsxWriter is a Python module ... Create a Pandas dataframe from some datetime data.
Read more >Pandas Write to Excel with Examples
Use pandas to_excel() function to write a DataFrame to an excel sheet with extension .xlsx. By default it writes a single DataFrame to...
Read more >How to save a new sheet in an existing excel file, using Pandas?
This code saves two DataFrames to two sheets, named "x1" and "x2" respectively. If I create two new DataFrames and try to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the suggestion and for the PR. I do use Pandas myself although not in conjunction with gspread.
We try to stick to the single responsibility principle in developing this library. At its best, it should only contain functionality related to accessing data and managing spreadsheets. Although widely accepted and used, Pandas is still not a core Python package. I don’t see a reason why gspread should support DataFrames.
That being said, I really don’t want to discourage you. You can make your own package, import gspread, inherit and extend the functionality you need. You will own the DataFrames functionality and maintainers of gspread will have less code to support.
I also plan to rework the docs, and maybe put an examples / cookbook section. We have the ancient GitHub Wiki pages for the project with a Cookbook section listing an example of handling DataFrames. We can update example and a link to your future library if it does better handling of DataFrames.
Closing issue, as
gspread-dataframe
PyPI package has been in release for over a year now.