heres the code: import gspread
from oauth2client.service_account import ServiceAccountCredentials
Define the path to your credentials and the Google Sheets ID
creds_path = "your json here"
sheet_id = "your google ID here"
Set up the Google Sheets API client
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name(creds_path, scope)
client = gspread.authorize(creds)
Open the Google Sheet
sheet = client.open_by_key(sheet_id).sheet1
List of codes to be inserted into the Google Sheet
codes = [
"1 ITO", "2", "3 UH1", "4", "5 E8W", "6 JHI", "7", "8 NOO", "9 5VG", "10 AFM",
"11 7S0", "12 X3X", "13 XKE", "14", "15 PFD", "16 XBI", "17 ASK", "18 XR6",
"19 F2J", "20 XQA", "21 V7K", "22 YUS", "23 GXE", "24 E23", "25 50E", "26 5SL",
"27 I27", "28 H5Y", "29 EA2", "30 BJ9", "31 C4Q", "32 DZP", "33 KIJ", "34 AAY",
"35 RB3", "36 RZ4", "37 OM7", "38", "39 YGG", "40 YID", "41 GM3", "42 KUU",
"43 P7J", "44 DGZ", "45 UOE", "46 XIM", "47 BS7", "48 B9A", "49", "50 CA6",
"51 3TB", "52 BSY", "53 DY3", "54 KOV", "55 X8L", "56 S1J", "57 SCO", "58",
"59 8CB", "60 4RW", "61 JRU", "62", "63 Y86", "64", "65 LWB", "66 GIK", "67 JUE",
"68", "69", "70", "71", "72 WJ", "73", "74 HLH", "75", "76", "77", "78", "79",
"80", "81", "82 G58", "83 XOO", "84 DYA", "85 ROX", "86 0EE", "87 SVK", "88 GC7",
"89 7A1", "90 BP8", "91 PXK", "92 UJ9", "93 M43", "94 9AE", "95 NXD", "96 QLW",
"97 Z08", "98 V54", "99 QPO", "100 DBU", "101 337", "102 BQ6", "103 V4H", "104 OMQ",
"105 W26", "106 FZX", "107 SXE", "108 CC0", "109 5PM", "110 BEJ", "111 CDB",
"112 YLD", "113 Z3C", "114 JBS", "115 PBP", "116 PEJ", "117 TQO", "118 5NJ",
"119 IC4", "120 LSR", "121 HBX", "122 LTZ", "123 IEC", "124 ZYV", "125 EYG",
"126 ING", "127 YGQ", "128 L5Q", "129 1BR", "130 E28", "131 NKC", "132 ES1",
"133 1Y2", "134 T1X", "135 9WA", "136 PGP", "137 4WI", "138 5MT", "139 A21",
"140 A2R", "141 1I9", "142 KQT", "143 LU3", "144 PXH", "145 LV1", "146 PQJ",
"147 MDH", "148 GOY", "149 P00", "150 YJ4", "151 S7L", "152 CUV", "153 D36",
"154 BGU", "155 3V4", "156 FZB", "157 O3B", "158 XJL", "159 ZC2", "160 J5C",
"161 STU", "162 RMD", "163 QB0", "164 3TR", "165 2P3", "166 51E", "167 Y8O",
"168 LHK", "169 NYL", "170 G6W", "171 OBI", "172 N0A", "173 SRL", "174 HW9",
"175 XQU", "176 KC8", "177 ZF1", "178 SW8", "179 JWI", "180 E90", "181 NA6",
"182 325", "183 VFT", "184 461", "185 EAQ", "186 ZOW", "187 WSE", "188 MST",
"189 ATA", "190 L7X", "191 LOR", "192 UGO", "193 AVX", "194 27W", "195 3KH",
"196 FW1", "197 037", "198 HF5", "199 DQY", "200 KBD", "201 R9B", "202 K7Z",
"203 DR0", "204 MI3", "205 R6J", "206 SH3", "207 UH3", "208 NIF", "209 ON5",
"210 7XB", "211 9H1", "212 31E", "213 XCB", "214 7UV", "215 XMI", "216 9L7",
"217 G20", "218 QJC", "219 1AQ", "220 NW8", "221 705", "222 X01", "223 STM",
"224 Z9K"
]
Prepare data for batch update
values = [[code] for code in codes]
Update the Google Sheet with the codes in a single batch
sheet.update('A1:A224', values)
print("Data has been updated in the Google Sheet.") copy it please sub and enjoy the code