Using Google Sheets in Python: Finding and Updating Cells

  Рет қаралды 30,068

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 68
@sohntv8105
@sohntv8105 5 жыл бұрын
Lol this channel is seriously underrated. Every software engineering job ive had so far (2 lol) I have used this channel to get my tickets done at work. From making rest api's in flask to doing google spreadsheets in python in tandem with sqlalchemy. Thank you good sir.
@jappagtakhan
@jappagtakhan 3 жыл бұрын
when stackoverflow, reddit, google fails here you are a video from 2018 that is very helpful. great work! i have subscribe to your channel. thanks a lot
@vinayaksudalai9114
@vinayaksudalai9114 4 жыл бұрын
Loads Of Love Man ! You're a Life Saver ! I can't thank you enough ! I really owe you one !
@SilvianDragan
@SilvianDragan 4 жыл бұрын
Excellent video dude. Keep this stuff up!
@iandthopper
@iandthopper 6 жыл бұрын
Thank you. Excellent video.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@mr_jacklu8014
@mr_jacklu8014 4 жыл бұрын
Yes, this video definitely helped! Thanks Anthony.
@phil9947
@phil9947 3 жыл бұрын
You rock. Thank you so much.
@yuvigerstein
@yuvigerstein 5 жыл бұрын
Great stuff, so happy to learn from you :)
@prettyprinted
@prettyprinted 5 жыл бұрын
Glad you like my videos. Thanks for watching.
@biurai.com-biuruofisuadmin2799
@biurai.com-biuruofisuadmin2799 4 жыл бұрын
Just found video and subscribed !:)) Amazing
@normprokup9313
@normprokup9313 6 жыл бұрын
I'm glad I discovered your channel. You have covered several topics that I'm really interested in learning about, and your explanations are very clear. Have you (or have you considered) doing a video introduction to the Google Drive API?
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll definitely consider that one. There are a ton of useful Google APIs.
@ChanchalChhabra1
@ChanchalChhabra1 3 жыл бұрын
explained everything very nicely. Could you please also share info on how to add/append new rows and delete rows in google sheet? If you already have video on it, please share. Thanks!
@liam898
@liam898 6 жыл бұрын
So helpful. thank you!
@prettyprinted
@prettyprinted 6 жыл бұрын
Thanks for watching!
@fatmaabdelraouf1134
@fatmaabdelraouf1134 6 жыл бұрын
Thank you for the great videos.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@MobiadsSolution
@MobiadsSolution 3 жыл бұрын
Hey dude, nice tips. I needed to update the record in the cell after found record in same row and fix the error if not found. Thanks
@s_p_a_c_e_m_a_n
@s_p_a_c_e_m_a_n 5 жыл бұрын
Awesome Video!
@prettyprinted
@prettyprinted 5 жыл бұрын
I'm glad you like it. Thanks for watching!
@prajitkumar6027
@prajitkumar6027 3 жыл бұрын
hello , as i have created dataframe with pandas and getting print output. Now i have established api connection with google sheet and able to manipulate rows and columns ie adding rows and columns etc but not getting the data filled in the sheet. can you help me for any leads?
@shinkevin3379
@shinkevin3379 4 жыл бұрын
Thanks for your tutorial! How do we update the color of a cell or the color of row(column) through Python? Could you make a video for this? I am using Python Colab. Thanks!
@mreavey2000
@mreavey2000 5 жыл бұрын
Thanks for this. I'm just starting with gspread -- can't find an example of this: how would I insert values into a new column on a given worksheet? Would I need to loop and insert cell by cell? The challenge I have is I don't know how long the list of values will be. I will be getting it from a JSON response and formatting into a list. Thanks!
@prettyprinted
@prettyprinted 5 жыл бұрын
You would get all the cells you want update, and then you would loop to update each cell. github.com/burnash/gspread#updating-cells
@vaibhavrothe873
@vaibhavrothe873 6 жыл бұрын
Thanks a lot!
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
@kishorep3668
@kishorep3668 5 жыл бұрын
Could you make another video which write list of data into columns based on dates as column name? Thanks
@paulgerhard5170
@paulgerhard5170 2 жыл бұрын
when the content of the cell is a hyperlink, print acell does not return any value. Can you help?
@Tenly2009
@Tenly2009 3 жыл бұрын
2 questions: How would you find the last cell containing text in a specific column ? (Or the first empty cell - for if I wanted to appended to an existing list…) How would you restrict your find command to a single column instead of the entire worksheet ?
@bernnardofranciscorodrigue6338
@bernnardofranciscorodrigue6338 5 жыл бұрын
Excellent video! Helped me a lot! Is there any way that I could "jump" a column using append_row? For example: append_row(1,2,3,4, ,6) and write nothing in the fifth column?
@prettyprinted
@prettyprinted 5 жыл бұрын
You should be able to do that. Just pass an empty for the column you want to skip over.
@darrenc2370
@darrenc2370 5 жыл бұрын
Hi! this 'find' function is really useful! but how can i call it without python but using the REST api with http request? i am creating an app using cocos creator targeting on web, and i do not know of any client library that i can use for my target platform and engine combination.
@ВолодимирТруба-л7т
@ВолодимирТруба-л7т 6 жыл бұрын
Great tutorial, how to append a list into column a googlespread?
@prettyprinted
@prettyprinted 6 жыл бұрын
I'm not sure what you mean. A Python list into a spread sheet? What do you want the result to look like in the spread sheet?
@AndersonSouza-ux1hk
@AndersonSouza-ux1hk 6 жыл бұрын
Hello Anthony. Is there anyway to export Google spreadsheet to XML with Python?
@prettyprinted
@prettyprinted 6 жыл бұрын
Yes, it's not a direct conversion between the two, but because you can read your Google sheet in Python and because there are ways to create XML from Python, you can do this. I'd look for XML libraries (or just hand write the XML) to accomplish this.
@AndersonSouza-ux1hk
@AndersonSouza-ux1hk 6 жыл бұрын
@@prettyprinted thanks. It's worked.
@gtasanandreas684
@gtasanandreas684 Жыл бұрын
Can i update an empty cell? let's say that it was the same row but i need to check whether i.e column H or J is empty or not, it it is empty then you can append the data, if it's not then skip row, is there a function to do that kind of thing?
@prettyprinted
@prettyprinted Жыл бұрын
I'm not sure if there's a function, but you could just read the cell first and then use an if statement to determine what you do after that point.
@DLVSolutions
@DLVSolutions 5 жыл бұрын
Thanks so much for this. Could you give us an idea on how to write a script that enables Python to find the first row available and write there? Im having a bit of a challenge in getting this to work. :) Thanks so much!
@prettyprinted
@prettyprinted 5 жыл бұрын
I'm going to remake this video soon, so I can cover what you mentioned.
@VivekKBangaru
@VivekKBangaru 6 жыл бұрын
Thanks.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome!
@xbossxyt5630
@xbossxyt5630 6 жыл бұрын
Thank you for the great videos. I got a question, how can access sheet 2 and 3 4 5 etc.. I've created a different var for it ending with .sheet2 but gave me an error (AttributeError: 'Spreadsheet' object has no attribute 'sheet2')
@prettyprinted
@prettyprinted 6 жыл бұрын
This may help you: stackoverflow.com/questions/33570749/python-gspread-library-only-writes-to-worksheet-labeled-sheet1
@xbossxyt5630
@xbossxyt5630 6 жыл бұрын
Thank you very much.
@ukaszkwiecinski1781
@ukaszkwiecinski1781 4 жыл бұрын
how can I update a whole row?
@dominicdill
@dominicdill 5 жыл бұрын
Why don't you need to identify a spreadsheet ID in your script? developers.google.com/sheets/api/guides/concepts says to always include one Also, if your workbook has multiple sheets, how do you identify which one you are pulling from? Say I want cell A2 from sheet 2, not sheet 1. I tried changing the sheet1 in the open command to the name of my second sheet, but that didnt work.
@dannyl4050
@dannyl4050 6 жыл бұрын
For some reason im getting a MODULENotFoundError: No module named 'oauth2client". I know the client is installed. Any idea why that is? Im using pycharm
@prettyprinted
@prettyprinted 6 жыл бұрын
Is that the only package it fails for in Pycharm? Because it's a pretty straightforward package to install.
@SqrAwySailor
@SqrAwySailor 6 жыл бұрын
How do I update a Data Frame to a Google Sheet? I tried using .update_cell() but, of course, that puts the entire Data Frame inside a single cell. How do I spread out the data amongst several rows and columns?
@obsidiansiriusblackheart
@obsidiansiriusblackheart 6 жыл бұрын
please make one where you get the top row of every sheet in the spreadsheet (eg if you had sheet1-4 and wanted all rows where the top row had a value in it)
@prettyprinted
@prettyprinted 6 жыл бұрын
I'll see what I can do.
@cristianalexismejia
@cristianalexismejia 6 жыл бұрын
Hello my brother, thank's for the video I don't find the data that I'm seek then I get an error how can I fix it
@eugenepilat8685
@eugenepilat8685 5 жыл бұрын
Use try except construction
@biaotang5011
@biaotang5011 6 жыл бұрын
hi Bro ,when I update_to_cells() ,I got a error like this below: gspread.v4.exceptions.APIError: { "error": { "code": 400, "message": "Requested writing within range ['sheet1'!A5:A6], but tried writing to column [B]", "status": "INVALID_ARGUMENT" } } I have no idea to solve it ,can you kindly show me some advises.
@liam898
@liam898 6 жыл бұрын
wks.update_acell('B2','newvalue')
@naveenlocks2974
@naveenlocks2974 6 жыл бұрын
Hello sir, can u make a video on styling wtforms in flask.... Such that the form looks too pretty.. I mean.. like transparent forms and something else like that... But show how to style wtforms in flask....
@prettyprinted
@prettyprinted 6 жыл бұрын
Yeah, I'll cover that in the future.
@naveenlocks2974
@naveenlocks2974 6 жыл бұрын
I just got a problem in django... I have created my own user model for usernames and other things.....i cannot use authenticate function since it is not inbuilt user model... So i did some authentication on my own with some logics... But now i want to use loginrequired decorator... How to use it for my custom model... Or how can i make a login required decorator ...i just have a project to do... Please help me with it... If u can't make a video on that ..plzz send some example codes to my email : naveenprolific123@gmail.com..... Thanks in advance
@buwwet515
@buwwet515 6 жыл бұрын
I was wondering how to convert the output from a cell to a variable, I can't find a way to do it.
@mmustho7740
@mmustho7740 6 жыл бұрын
some_variable = wks.acell('A2')
@vinsmokearifka
@vinsmokearifka 6 жыл бұрын
how to appending row down
@whatwasthat821
@whatwasthat821 4 жыл бұрын
Anybody knows how to filter by color with "get"? Maybe I blind or smth but didn't see that in the documentation. I basically need to filter my spreadsheet by 2 colors.
@liam898
@liam898 6 жыл бұрын
dat burp tho 5:57
@stillinmusic
@stillinmusic 6 жыл бұрын
Thank you!
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome! Thanks for watching.
Google Sheets - Python API, Read & Write Data
28:01
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 193 М.
How to Use Google Sheets in Python
17:03
Pretty Printed
Рет қаралды 71 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Top 18 Most Useful Python Modules
10:50
Tech With Tim
Рет қаралды 936 М.
Using Google Sheets with Python (COMPLETE Beginner GSpread Tutorial!)
16:27
Millibit Tutorials: Ruchir Baronia's Coding Clips
Рет қаралды 22 М.
Python Tutorial: Working with JSON Data using the json Module
20:34
Corey Schafer
Рет қаралды 1,1 МЛН
Google Sheets Database with Python Web Scraping
12:57
John Watson Rooney
Рет қаралды 33 М.
Reading Emails in Python with IMAP Tools
11:07
Pretty Printed
Рет қаралды 6 М.
Google Sheets and Python - Tutorial
9:56
Patrick Loeber
Рет қаралды 44 М.
Google Sheets API in Python | Writing Data To Google Sheets
12:51
Access and Edit Google Sheets with Python
5:11
JayMartMedia
Рет қаралды 25 М.
How to Use Google Sheets With Python
12:46
Pretty Printed
Рет қаралды 132 М.