-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cell.expand('table') feature requests #1414
Comments
Hi thank you for this feature request. It's very interesting! I never thought of it ! Could you please confirm if I get your code correctly? I understand your function:
Right ? If so, it could be improved yes, and possibly the API has ways to help, or at least we could play with the API and the coordinates system as it can in some scenarios return a matrix of all values only, so it's then easy to compute the furthest value has at least or direction (bottom or right) is already given by the API |
We can take a look at it, we have a few things to work on first then, if it's easy it could land in 6.1.0 if not then it's gonna be in the next version after that (at least 6.2.0) |
hi @lavigne958 , I added a snippet with a rudimentary implementation of the
also, I'm not very familiar with the modules, but if you guide me on this I might be able to do a PR ? let me know :) |
yess, exactly that |
cool :) it sounds like it could be a useful function. Since it is unknown, it would involve getting the whole sheet, down and right, starting from Is there a way to get this in gspread currently? If so, we could add a " all_cells = worksheet.get()
table = utils.find_table(all_cells) I think that would be nice as this feature does not require extra requests, but only formatting of data we can get by existing means. Are you interested in trying to make a PR? We can help if so :) |
Agreed 🙃
I think, if you request an unbounded range from that cell, the API will return everything down from that point. Then all we need is to square it and remove everything after the first whitespace. 🤔 |
Add a new feature that allows a user to expand a cell range into a table. the expand will look for the right most cell with adjacent value. the expand will look for the bottom most cell with adjacent value. the expand will table down from top left celle range to bottom right value. closes #1414 Signed-off-by: Alexandre Lavigne <[email protected]>
Add a new feature that allows a user to expand a cell range into a table. the expand will look for the right most cell with adjacent value. the expand will look for the bottom most cell with adjacent value. the expand will table down from top left celle range to bottom right value. closes #1414 Signed-off-by: Alexandre Lavigne <[email protected]>
alright ! we made it ! next release will contain the new feature. |
In the past, I used to use xlwings library for Excel. In their API they have a very handy way of selecting "tables" starting for a specific cell.
you could use it, for example, to get data from a series of sheets that have table with variable size but always start from the cell
"A1"
. so you "expand" the selection similar to what you do when docmd+left_arrow
,cmd+down_arrow
on the worksheet,The usage is better explained in the documentation:
range.expand('table')
this is a snippet of the usage, expand have one of three arguments
"table", "right","down"
.I implemented the
"table"
version for myself just because I found it very handy.maybe there's a way of doing this using
gspread
, but I couldn't find it.Thanks in advance!
The text was updated successfully, but these errors were encountered: