question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set worksheet contents using Pandas DataFrame

See original GitHub issue

For 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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
burnashcommented, Nov 29, 2016

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.

0reactions
robin900commented, Jun 5, 2018

Closing issue, as gspread-dataframe PyPI package has been in release for over a year now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found