コンテンツにスキップ

PyMySQL

PyMySQLに関するTipsです。主に、使い方をまとめてます。

使い方

基本編

公式ドキュメント

https://pymysql.readthedocs.io/en/latest/

参考記事: PythonでMySQLを操作する(PyMySQL)

https://python-work.com/pymysql/

事例

【MESH + Flask + MariaDB】温度・湿度タグから取得した温度情報をローカルWebサーバ経由でデータベースに追加する方法

https://qiita.com/7rikazhexde/items/ec8fc8f90acf45703d53

GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)する

コード

pymysql_bulk_incert.py
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
<!DOCTYPE html>
<html
  lang="en"

  data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
  data-a11y-animated-images="system" data-a11y-link-underlines="true"

  >



  <head>
    <meta charset="utf-8">
  <link rel="dns-prefetch" href="https://github.githubassets.com">
  <link rel="dns-prefetch" href="https://avatars.githubusercontent.com">
  <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
  <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">
  <link rel="preconnect" href="https://github.githubassets.com" crossorigin>
  <link rel="preconnect" href="https://avatars.githubusercontent.com">



  <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-7aa84bb7e11e.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-f65db3e8d171.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-a8258e3c6dda.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-7e97d834719c.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-01d869f460be.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-534f3e971240.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-a8cc7d138001.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-35e9dfdc4f9f.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-cf4cc5f62dfe.css" />

    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-d9abecd14f1e.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-93aded0ee8a1.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-8bed0685a4b5.css" />
    <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-4c2776832351.css" />





  <script type="application/json" id="client-env">{"locale":"en","featureFlags":["bypass_copilot_indexing_quota","copilot_immersive_file_preview","copilot_new_references_ui","copilot_attach_folder_reference","copilot_chat_repo_custom_instructions_preview","copilot_chat_retry_on_error","copilot_chat_persist_submitted_input","copilot_conversational_ux_history_refs","copilot_chat_shared_chat_input","copilot_chat_shared_topic_indicator","copilot_chat_shared_repo_sso_banner","copilot_editor_upsells","copilot_dotcom_chat_reduce_telemetry","copilot_free_limited_user","copilot_implicit_context","copilot_no_floating_button","copilot_smell_icebreaker_ux","dotcom_chat_client_side_skills","copilot_new_markdown_renderer","experimentation_azure_variant_endpoint","failbot_handle_non_errors","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_o3_mini_streaming","hovercard_accessibility","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","issues_react_include_bots_in_pickers","marketing_pages_search_explore_provider","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_copilot_vscode_link_update","site_proxima_australia_update","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates"]}</script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-f7c08526ccea.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-d7e6bc799724.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-25697e0f4c47.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-04ca94cb6e8a.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-f6da4b3fa34c.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a74b4e0a8a6b.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-f0c8a795d1fd.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-6dd1e7101b16.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-d018d1dc6e26.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-bb80ec-72267f4e3ff9.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-e3cbe28f1638.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-6cf3320416b8.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-69cfcc-ccab506ecf8c.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-439f48470426.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-87ff5f64f4e2.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-5316a27f9573.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-87a4ae-342d9bd8fe36.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-42e06545c1fa.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-d8de5f97949a.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-c05ae0218448.js"></script>

  <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_hotkey_dist_index_js-524e40420665.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_remote-form_dist_-d0eef7-5f58a29a0546.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_form-utils_form-utils_ts-ui_packages_input-navigation-behavior_input-navigation-b-a97423-f22f310ce426.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_diffs_blob-lines_ts-app_assets_modules_github_diffs_linkable-line-n-b8c0ea-35a29947a5f6.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/gist-028673183929.js"></script>


  <title>GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード · GitHub</title>



  <meta name="route-pattern" content="/:user_id/:gist_id(.:format)" data-turbo-transient>
  <meta name="route-controller" content="gists_gists" data-turbo-transient>
  <meta name="route-action" content="show" data-turbo-transient>


  <meta name="current-catalog-service-hash" content="56253a530ab9027b25719525dcbe6007461a3202218f6f5dfce5a601c121cbcb">


  <meta name="request-id" content="3400:B0650:92F26D:D45EF2:67ACB9C4" data-pjax-transient="true"/><meta name="html-safe-nonce" content="f0f3d956a7fcde96bdd300df27d74e7f17243d3ef4c31618940de1b71ba16b4f" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiIzNDAwOkIwNjUwOjkyRjI2RDpENDVFRjI6NjdBQ0I5QzQiLCJ2aXNpdG9yX2lkIjoiNTA0NDcyODYyNzUyMTY5ODI0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="82abbebda094620b8c2f141e06f95455b14c87c7d6ed0b26c9455842127dc0f0" data-pjax-transient="true"/>




  <meta name="github-keyboard-shortcuts" content="copilot" data-turbo-transient="true" />


  <meta name="selected-link" value="gist_code" data-turbo-transient>
  <link rel="assets" href="https://github.githubassets.com/">

    <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">

<meta name="octolytics-url" content="https://collector.github.com/github/collect" />

  <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;gist-id&gt;" data-turbo-transient="true" />






    <meta name="user-login" content="">



    <meta name="viewport" content="width=device-width">



      <meta name="description" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード - pymysql_bulk_incert.py">

      <link rel="search" type="application/opensearchdescription+xml" href="/opensearch-gist.xml" title="Gist">

    <link rel="fluid-icon" href="https://gist.github.com/fluidicon.png" title="GitHub">
    <meta property="fb:app_id" content="1401488693436528">
    <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c" />

      <meta name="twitter:image" content="https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード" /><meta name="twitter:description" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード - pymysql_bulk_incert.py" />
  <meta property="og:image" content="https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png" /><meta property="og:image:alt" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード - pymysql_bulk_incert.py" /><meta property="og:site_name" content="Gist" /><meta property="og:type" content="article" /><meta property="og:title" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード" /><meta property="og:url" content="https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c" /><meta property="og:description" content="GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード - pymysql_bulk_incert.py" /><meta property="article:author" content="262588213843476" /><meta property="article:publisher" content="262588213843476" />





      <meta name="hostname" content="gist.github.com">



        <meta name="expected-hostname" content="gist.github.com">


  <meta http-equiv="x-pjax-version" content="19570df372c915431e630b3241880e735bb3a62aca840f5b19749259e53dd909" data-turbo-track="reload">
  <meta http-equiv="x-pjax-csp-version" content="ace39c3b6632770952207593607e6e0be0db363435a8b877b1f96abe6430f345" data-turbo-track="reload">
  <meta http-equiv="x-pjax-css-version" content="1cbe62881c6683fcc2281e842b13c8c7970db68222aa70b3bfe0c6b84ec0866f" data-turbo-track="reload">
  <meta http-equiv="x-pjax-js-version" content="e13a42f66166738fd862f4a07cb4ce7db3a745dc035532d4d3660743d612125e" data-turbo-track="reload">

  <meta name="turbo-cache-control" content="no-preview" data-turbo-transient="">

      <link href="/7rikazhexde.atom" rel="alternate" title="atom" type="application/atom+xml">


  <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/gist-a35fdba7ad1d.css" />




    <meta name="turbo-body-classes" content="logged-out env-production page-responsive">


  <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">

  <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">

  <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000">
  <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png">
  <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon">

<meta name="theme-color" content="#1e2327">
<meta name="color-scheme" content="light dark" />



  </head>

  <body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
    <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">



    <div class="position-relative header-wrapper js-header-wrapper ">
      <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a>

      <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
    <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span>
</span>      

      <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-8e38c0ecf8b7.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-39d67dda35d5.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f09868a8643f.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-611691cca2f6.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-62da9f-2df2f32ec596.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-f7cc96ebae76.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-046dd323b6ce.js"></script>
<script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-294067067288.js"></script>
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.da836b3f0662dcfeb421.module.css" />

<react-partial
  partial-name="keyboard-shortcuts-dialog"
  data-ssr="false"
  data-attempted-ssr="false"
>

  <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script>
  <div data-target="react-partial.reactRoot"></div>
</react-partial>






            <div class="Header js-details-container Details flex-wrap flex-md-nowrap p-responsive" role="banner" >
  <div class="Header-item d-none d-md-flex">
    <a class="Header-link" data-hotkey="g d" aria-label="Gist Homepage " href="/">
  <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github v-align-middle d-inline-block d-md-none">
    <path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path>
</svg>
  <svg aria-hidden="true" height="24" viewBox="0 0 68 24" version="1.1" width="68" data-view-component="true" class="octicon octicon-logo-github v-align-middle d-none d-md-inline-block">
    <path d="M27.8 17.908h-.03c.013 0 .022.014.035.017l.01-.002-.016-.015Zm.005.017c-.14.001-.49.073-.861.073-1.17 0-1.575-.536-1.575-1.234v-4.652h2.385c.135 0 .24-.12.24-.283V9.302c0-.133-.12-.252-.24-.252H25.37V5.913c0-.119-.075-.193-.21-.193h-3.24c-.136 0-.21.074-.21.193V9.14s-1.636.401-1.741.416a.255.255 0 0 0-.195.253v2.021c0 .164.12.282.255.282h1.665v4.876c0 3.627 2.55 3.998 4.29 3.998.796 0 1.756-.252 1.906-.327.09-.03.135-.134.135-.238v-2.23a.264.264 0 0 0-.219-.265Zm35.549-3.272c0-2.69-1.095-3.047-2.25-2.928-.9.06-1.62.505-1.62.505v5.232s.735.506 1.83.536c1.545.044 2.04-.506 2.04-3.345ZM67 14.415c0 5.099-1.665 6.555-4.576 6.555-2.46 0-3.78-1.233-3.78-1.233s-.06.683-.135.773c-.045.089-.12.118-.21.118h-2.22c-.15 0-.286-.119-.286-.252l.03-16.514a.26.26 0 0 1 .255-.252h3.196a.26.26 0 0 1 .255.252v5.604s1.23-.788 3.03-.788l-.015-.03c1.8 0 4.456.67 4.456 5.767ZM53.918 9.05h-3.15c-.165 0-.255.119-.255.282v8.086s-.826.58-1.95.58c-1.126 0-1.456-.506-1.456-1.62v-7.06a.262.262 0 0 0-.255-.254h-3.21a.262.262 0 0 0-.256.253v7.596c0 3.27 1.846 4.087 4.381 4.087 2.085 0 3.78-1.145 3.78-1.145s.076.58.12.67c.03.074.136.133.24.133h2.011a.243.243 0 0 0 .255-.253l.03-11.103c0-.133-.12-.252-.285-.252Zm-35.556-.015h-3.195c-.135 0-.255.134-.255.297v10.91c0 .297.195.401.45.401h2.88c.3 0 .375-.134.375-.401V9.287a.262.262 0 0 0-.255-.252ZM16.787 4.01c-1.155 0-2.07.907-2.07 2.051 0 1.145.915 2.051 2.07 2.051a2.04 2.04 0 0 0 2.04-2.05 2.04 2.04 0 0 0-2.04-2.052Zm24.74-.372H38.36a.262.262 0 0 0-.255.253v6.08H33.14v-6.08a.262.262 0 0 0-.255-.253h-3.196a.262.262 0 0 0-.255.253v16.514c0 .133.135.252.255.252h3.196a.262.262 0 0 0 .255-.253v-7.06h4.966l-.03 7.06c0 .134.12.253.255.253h3.195a.262.262 0 0 0 .255-.253V3.892a.262.262 0 0 0-.255-.253Zm-28.31 7.313v8.532c0 .06-.015.163-.09.193 0 0-1.875 1.323-4.966 1.323C4.426 21 0 19.84 0 12.2S3.87 2.986 7.651 3c3.27 0 4.59.728 4.8.862.06.075.09.134.09.208l-.63 2.646c0 .134-.134.297-.3.253-.54-.164-1.35-.49-3.255-.49-2.205 0-4.575.623-4.575 5.543s2.25 5.5 3.87 5.5c1.38 0 1.875-.164 1.875-.164V13.94H7.321c-.165 0-.285-.12-.285-.253v-2.735c0-.134.12-.252.285-.252h5.61c.166 0 .286.118.286.252Z"></path>
</svg>
  <svg aria-hidden="true" height="24" viewBox="0 0 38 24" version="1.1" width="38" data-view-component="true" class="octicon octicon-logo-gist v-align-middle d-none d-md-inline-block">
    <path d="M7.05 13.095v-1.5h5.28v8.535c-1.17.555-2.925.96-5.385.96C1.665 21.09 0 17.055 0 12.045S1.695 3 6.945 3c2.43 0 3.96.495 4.92.99v1.575c-1.83-.75-3-1.095-4.92-1.095-3.855 0-5.22 3.315-5.22 7.59s1.365 7.575 5.205 7.575c1.335 0 2.97-.105 3.795-.51v-6.03H7.05Zm16.47 1.035h.045c3.33.3 4.125 1.425 4.125 3.345 0 1.815-1.14 3.615-4.71 3.615-1.125 0-2.745-.285-3.495-.585v-1.41c.705.255 1.83.54 3.495.54 2.43 0 3.09-1.035 3.09-2.13 0-1.065-.33-1.815-2.655-2.01-3.39-.3-4.095-1.5-4.095-3.12 0-1.665 1.08-3.465 4.38-3.465 1.095 0 2.34.135 3.375.585v1.41c-.915-.3-1.83-.54-3.405-.54-2.325 0-2.82.855-2.82 2.01 0 1.035.42 1.56 2.67 1.755Zm12.87-4.995v1.275h-3.63v7.305c0 1.425.795 2.01 2.25 2.01.3 0 .63 0 .915-.045v1.335c-.255.045-.75.075-1.035.075-1.965 0-3.75-.9-3.75-3.195v-7.5H28.8v-.72l2.34-.66V5.85l1.62-.465v3.75h3.63ZM16.635 9.09v9.615c0 .81.285 1.05 1.005 1.05v1.335c-1.71 0-2.58-.705-2.58-2.58V9.09h1.575Zm.375-3.495c0 .66-.51 1.17-1.17 1.17a1.14 1.14 0 0 1-1.155-1.17c0-.66.48-1.17 1.155-1.17s1.17.51 1.17 1.17Z"></path>
</svg>
</a>
  </div>

  <div class="Header-item d-md-none">
      <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="Header-link js-details-target btn-link">    <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-three-bars">
    <path d="M3.75 5.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Zm0 6a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Zm0 6a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"></path>
</svg>
</button>  </div>

  <div class="Header-item Header-item--full js-site-search flex-column flex-md-row width-full flex-order-2 flex-md-order-none mr-0 mr-md-3 mt-3 mt-md-0 Details-content--hidden-not-important d-md-flex">
      <div class="header-search flex-self-stretch flex-md-self-auto mr-0 mr-md-3 mb-3 mb-md-0">
    <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="position-relative js-quicksearch-form" role="search" aria-label="Site" data-turbo="false" action="/search" accept-charset="UTF-8" method="get">
      <div class="header-search-wrapper form-control input-sm js-chromeless-input-container">
        <input type="text"
          class="form-control input-sm js-site-search-focus header-search-input"
          data-hotkey="s,/"
          name="q"
          aria-label="Search"
          placeholder="Search…"
          autocorrect="off"
          autocomplete="off"
          autocapitalize="off">
      </div>

</form></div>


    <nav aria-label="Global" class="d-flex flex-column flex-md-row flex-self-stretch flex-md-self-auto">
  <a class="Header-link mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, go to all gists, text:all gists" href="/discover">All gists</a>

  <a class="Header-link mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, go to GitHub, text:Back to GitHub" href="https://github.com">Back to GitHub</a>

    <a class="Header-link d-block d-md-none mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, sign in" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="7346a0f34dd674e88fe2f34334839ed984c174e39aecabbb97958c0a1daa840c" href="https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c">
      Sign in
</a>
      <a class="Header-link d-block d-md-none mr-0 mr-md-3 py-2 py-md-0 border-top border-md-top-0 border-white-fade" data-ga-click="Header, sign up" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f65e34ea565e5f709f52cb43dcfaaafb071c8a9833a8c4adb813b93b548c9bbb" href="/join?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c&amp;source=header-gist">
        Sign up
</a></nav>

  </div>

  <div class="Header-item Header-item--full flex-justify-center d-md-none position-relative">
    <a class="Header-link" data-hotkey="g d" aria-label="Gist Homepage " href="/">
  <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github v-align-middle d-inline-block d-md-none">
    <path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path>
</svg>
  <svg aria-hidden="true" height="24" viewBox="0 0 68 24" version="1.1" width="68" data-view-component="true" class="octicon octicon-logo-github v-align-middle d-none d-md-inline-block">
    <path d="M27.8 17.908h-.03c.013 0 .022.014.035.017l.01-.002-.016-.015Zm.005.017c-.14.001-.49.073-.861.073-1.17 0-1.575-.536-1.575-1.234v-4.652h2.385c.135 0 .24-.12.24-.283V9.302c0-.133-.12-.252-.24-.252H25.37V5.913c0-.119-.075-.193-.21-.193h-3.24c-.136 0-.21.074-.21.193V9.14s-1.636.401-1.741.416a.255.255 0 0 0-.195.253v2.021c0 .164.12.282.255.282h1.665v4.876c0 3.627 2.55 3.998 4.29 3.998.796 0 1.756-.252 1.906-.327.09-.03.135-.134.135-.238v-2.23a.264.264 0 0 0-.219-.265Zm35.549-3.272c0-2.69-1.095-3.047-2.25-2.928-.9.06-1.62.505-1.62.505v5.232s.735.506 1.83.536c1.545.044 2.04-.506 2.04-3.345ZM67 14.415c0 5.099-1.665 6.555-4.576 6.555-2.46 0-3.78-1.233-3.78-1.233s-.06.683-.135.773c-.045.089-.12.118-.21.118h-2.22c-.15 0-.286-.119-.286-.252l.03-16.514a.26.26 0 0 1 .255-.252h3.196a.26.26 0 0 1 .255.252v5.604s1.23-.788 3.03-.788l-.015-.03c1.8 0 4.456.67 4.456 5.767ZM53.918 9.05h-3.15c-.165 0-.255.119-.255.282v8.086s-.826.58-1.95.58c-1.126 0-1.456-.506-1.456-1.62v-7.06a.262.262 0 0 0-.255-.254h-3.21a.262.262 0 0 0-.256.253v7.596c0 3.27 1.846 4.087 4.381 4.087 2.085 0 3.78-1.145 3.78-1.145s.076.58.12.67c.03.074.136.133.24.133h2.011a.243.243 0 0 0 .255-.253l.03-11.103c0-.133-.12-.252-.285-.252Zm-35.556-.015h-3.195c-.135 0-.255.134-.255.297v10.91c0 .297.195.401.45.401h2.88c.3 0 .375-.134.375-.401V9.287a.262.262 0 0 0-.255-.252ZM16.787 4.01c-1.155 0-2.07.907-2.07 2.051 0 1.145.915 2.051 2.07 2.051a2.04 2.04 0 0 0 2.04-2.05 2.04 2.04 0 0 0-2.04-2.052Zm24.74-.372H38.36a.262.262 0 0 0-.255.253v6.08H33.14v-6.08a.262.262 0 0 0-.255-.253h-3.196a.262.262 0 0 0-.255.253v16.514c0 .133.135.252.255.252h3.196a.262.262 0 0 0 .255-.253v-7.06h4.966l-.03 7.06c0 .134.12.253.255.253h3.195a.262.262 0 0 0 .255-.253V3.892a.262.262 0 0 0-.255-.253Zm-28.31 7.313v8.532c0 .06-.015.163-.09.193 0 0-1.875 1.323-4.966 1.323C4.426 21 0 19.84 0 12.2S3.87 2.986 7.651 3c3.27 0 4.59.728 4.8.862.06.075.09.134.09.208l-.63 2.646c0 .134-.134.297-.3.253-.54-.164-1.35-.49-3.255-.49-2.205 0-4.575.623-4.575 5.543s2.25 5.5 3.87 5.5c1.38 0 1.875-.164 1.875-.164V13.94H7.321c-.165 0-.285-.12-.285-.253v-2.735c0-.134.12-.252.285-.252h5.61c.166 0 .286.118.286.252Z"></path>
</svg>
  <svg aria-hidden="true" height="24" viewBox="0 0 38 24" version="1.1" width="38" data-view-component="true" class="octicon octicon-logo-gist v-align-middle d-none d-md-inline-block">
    <path d="M7.05 13.095v-1.5h5.28v8.535c-1.17.555-2.925.96-5.385.96C1.665 21.09 0 17.055 0 12.045S1.695 3 6.945 3c2.43 0 3.96.495 4.92.99v1.575c-1.83-.75-3-1.095-4.92-1.095-3.855 0-5.22 3.315-5.22 7.59s1.365 7.575 5.205 7.575c1.335 0 2.97-.105 3.795-.51v-6.03H7.05Zm16.47 1.035h.045c3.33.3 4.125 1.425 4.125 3.345 0 1.815-1.14 3.615-4.71 3.615-1.125 0-2.745-.285-3.495-.585v-1.41c.705.255 1.83.54 3.495.54 2.43 0 3.09-1.035 3.09-2.13 0-1.065-.33-1.815-2.655-2.01-3.39-.3-4.095-1.5-4.095-3.12 0-1.665 1.08-3.465 4.38-3.465 1.095 0 2.34.135 3.375.585v1.41c-.915-.3-1.83-.54-3.405-.54-2.325 0-2.82.855-2.82 2.01 0 1.035.42 1.56 2.67 1.755Zm12.87-4.995v1.275h-3.63v7.305c0 1.425.795 2.01 2.25 2.01.3 0 .63 0 .915-.045v1.335c-.255.045-.75.075-1.035.075-1.965 0-3.75-.9-3.75-3.195v-7.5H28.8v-.72l2.34-.66V5.85l1.62-.465v3.75h3.63ZM16.635 9.09v9.615c0 .81.285 1.05 1.005 1.05v1.335c-1.71 0-2.58-.705-2.58-2.58V9.09h1.575Zm.375-3.495c0 .66-.51 1.17-1.17 1.17a1.14 1.14 0 0 1-1.155-1.17c0-.66.48-1.17 1.155-1.17s1.17.51 1.17 1.17Z"></path>
</svg>
</a>
  </div>

    <div class="Header-item f4 mr-0" role="navigation" aria-label="Sign in or sign up">
      <a class="Header-link no-underline mr-3" data-ga-click="Header, sign in" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="7346a0f34dd674e88fe2f34334839ed984c174e39aecabbb97958c0a1daa840c" href="https://gist.github.com/auth/github?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c">
        Sign&nbsp;in
</a>        <a class="Header-link d-inline-block no-underline border color-border-default rounded px-2 py-1" data-ga-click="Header, sign up" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist header&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f65e34ea565e5f709f52cb43dcfaaafb071c8a9833a8c4adb813b93b548c9bbb" href="/join?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c&amp;source=header-gist">
          Sign&nbsp;up
</a>    </div>
</div>



      <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full">

        <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>
        <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>
        <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span>

    <button id="icon-button-65a4e26c-717f-4e47-88ec-aef7455ee7c8" aria-labelledby="tooltip-fcb1eb00-8f0e-403a-b7cf-5b381335c18f" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
</button><tool-tip id="tooltip-fcb1eb00-8f0e-403a-b7cf-5b381335c18f" for="icon-button-65a4e26c-717f-4e47-88ec-aef7455ee7c8" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip>



</div>
    </div>

  <div id="start-of-content" class="show-on-focus"></div>








    <div id="js-flash-container" class="flash-container" data-turbo-replace>




  <template class="js-flash-template">

<div class="flash flash-full   {{ className }}">
  <div >
    <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
    </button>
    <div aria-atomic="true" role="alert" class="js-flash-alert">

      <div>{{ message }}</div>

    </div>
  </div>
</div>
  </template>
</div>









  <div
    class="application-main "
    data-commit-hovercards-enabled
    data-discussion-hovercards-enabled
    data-issue-and-pr-hovercards-enabled
    data-project-hovercards-enabled
  >
        <div itemscope itemtype="http://schema.org/Code">
    <main id="gist-pjax-container">


  <div class="gist-detail-intro gist-banner pb-3">
    <div class="text-center container-lg px-3">
      <p class="lead">
        Instantly share code, notes, and snippets.
      </p>
    </div>
  </div>


<div class="gisthead pagehead pb-0 pt-3 mb-4">
  <div class="px-0">


<div class="mb-3 d-flex px-3 px-md-3 px-lg-5">
  <div class="flex-auto min-width-0 width-fit mr-3">
    <div class="d-flex">
      <div class="d-none d-md-block">
        <a class="mr-2 flex-shrink-0" data-hovercard-type="user" data-hovercard-url="/users/7rikazhexde/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/7rikazhexde"><img class="avatar avatar-user" src="https://avatars.githubusercontent.com/u/33836132?s=64&amp;v=4" width="32" height="32" alt="@7rikazhexde" /></a>
      </div>
      <div class="d-flex flex-column width-full">
        <div class="d-flex flex-row width-full">
          <h1 class="wb-break-word f3 text-normal mb-md-0 mb-1">
            <span class="author"><a data-hovercard-type="user" data-hovercard-url="/users/7rikazhexde/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/7rikazhexde">7rikazhexde</a></span><!--
                --><span class="mx-1 color-fg-muted">/</span><!--
                --><strong itemprop="name" class="css-truncate-target mr-1" style="max-width: 410px"><a href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c">pymysql_bulk_incert.py</a></strong>
          </h1>
        </div>

        <div class="note m-0">
          Last active
          <relative-time tense="past" datetime="2025-01-18T14:58:02Z" data-view-component="true">January 18, 2025 14:58</relative-time>
        </div>
      </div>
    </div>
  </div>
  <ul class="d-md-flex pagehead-actions float-none mr-2">
  </ul>
  <div class="d-inline-block d-md-none ml-auto">
    <action-menu data-select-variant="none" data-view-component="true" class="flex-self-start ml-auto d-inline-block">
  <focus-group direction="vertical" mnemonics retain>
    <button id="gist_options-button" popovertarget="gist_options-overlay" aria-controls="gist_options-list" aria-haspopup="true" aria-labelledby="tooltip-d086091b-2a4d-438b-b29b-8415783c6a39" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual">
    <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path>
</svg>
</button><tool-tip id="tooltip-d086091b-2a4d-438b-b29b-8415783c6a39" for="gist_options-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Show Gist options</tool-tip>


<anchored-position data-target="action-menu.overlay" id="gist_options-overlay" anchor="gist_options-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true">
  <div data-view-component="true" class="Overlay Overlay--size-auto">

      <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone">          <action-list>
  <div data-view-component="true">
    <ul aria-labelledby="gist_options-button" id="gist_options-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap">
        <li rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;DOWNLOAD_ZIP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f081fa7a4c33c099c94aa6f636b773193d84a5be1db7ece66cb1f892f0c8eec0" data-ga-click="Gist, download zip, location:gist overview" data-targets="action-list.items" data-item-id="download_from_gist_options" role="none" data-view-component="true" class="ActionListItem">


    <a tabindex="-1" id="item-ca14e22f-653a-44aa-98ee-a84c35cad8f6" href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c/archive/b769f4467661067d97560e0a492cc0e4d6488d86.zip" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-download">
    <path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"></path><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"></path>
</svg>
        </span>

        <span data-view-component="true" class="ActionListItem-label">
          Download ZIP
</span>      
</a>

</li>
</ul>    
</div></action-list>


</div>

</div></anchored-position>  </focus-group>
</action-menu>  </div>
  <ul class="d-md-flex d-none pagehead-actions float-none">


      <li>
          <a id="gist-star-button" href="/login?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist star button&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="0d5288fed96fb2eae308999b5294d57a8e5623cd7f8881c6acfb554f0040d5f4" aria-label="You must be signed in to star a gist" data-view-component="true" class="btn-with-count Button--secondary Button--small Button">  <span class="Button-content">
      <span class="Button-visual Button-leadingVisual">
        <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star">
    <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path>
</svg>
      </span>
    <span class="Button-label">Star</span>
      <span class="Button-visual Button-trailingVisual">
          <span class="d-flex" aria-hidden="true"><span title="0" data-view-component="true" class="Counter">0</span></span>
          <span class="sr-only">(<span title="0" data-view-component="true" class="Counter">0</span>)</span>
      </span>
  </span>
</a><tool-tip id="tooltip-7b1d1c7c-88a6-4657-9be8-24d8f8d00be5" for="gist-star-button" popover="manual" data-direction="n" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to star a gist</tool-tip>

      </li>
        <li>
            <a id="gist-fork-button" href="/login?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;gist fork button&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="b3f57393108ba2247a85e75ccd5c927f45f7c043e48e23da19766d344a89c66a" aria-label="You must be signed in to fork a gist" data-view-component="true" class="btn-with-count Button--secondary Button--small Button">  <span class="Button-content">
      <span class="Button-visual Button-leadingVisual">
        <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked">
    <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path>
</svg>
      </span>
    <span class="Button-label">Fork</span>
      <span class="Button-visual Button-trailingVisual">
          <span class="d-flex" aria-hidden="true"><span title="0" data-view-component="true" class="Counter">0</span></span>
          <span class="sr-only">(<span title="0" data-view-component="true" class="Counter">0</span>)</span>
      </span>
  </span>
</a><tool-tip id="tooltip-034217d9-03ca-4c09-9c4e-da72a9d44c4c" for="gist-fork-button" popover="manual" data-direction="n" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to fork a gist</tool-tip>

        </li>
  </ul>
</div>

  <ul class="d-flex d-md-none px-3 mb-2 pagehead-actions float-none" >
    <li>

<div data-view-component="true" class="flex-items-center d-inline-flex">
  <action-menu data-menu-input="gist-share-url-sized-down" data-select-variant="single" data-dynamic-label="" data-view-component="true" class="flex-shrink-0">
  <focus-group direction="vertical" mnemonics retain>
    <button id="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-button" popovertarget="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-overlay" aria-controls="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-list" aria-haspopup="true" type="button" data-view-component="true" class="rounded-right-0 border-right-0 Button--secondary Button--small Button">  <span class="Button-content">
    <span class="Button-label">Embed</span>
  </span>
    <span class="Button-visual Button-trailingAction">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down">
    <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path>
</svg>
    </span>
</button>


<anchored-position data-target="action-menu.overlay" id="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-overlay" anchor="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true">
  <div data-view-component="true" class="Overlay Overlay--size-auto">

      <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone">          <action-list>
  <div data-view-component="true">
    <ul aria-labelledby="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-button" id="action-menu-3fbd385f-6d9b-4507-8192-9c1e5368e16a-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap">
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="&lt;script src=&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&quot;&gt;&lt;/script&gt;" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;EMBED&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f0ad28f7880537321d5a7304aad48aa4ce631e27e0bef41209bd7b6c99924cc4" id="item-9b9bce59-9af3-4488-be98-6b033a502023" type="button" role="menuitemradio" aria-checked="true" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
           Embed
</span>      <span data-view-component="true" class="ActionListItem-description">Embed this gist in your website.</span>
</span></button>

</li>
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;SHARE&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f75b3cf42880b628cdcb1d911775e2ddbc48622da959305de39be85d1088e6f8" id="item-09849bbf-de61-484c-96b5-3e4f22579e59" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
           Share
</span>      <span data-view-component="true" class="ActionListItem-description">Copy sharable link for this gist.</span>
</span></button>

</li>
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="https://gist.github.com/ed55e9b55ac69742b8ed61d5ae06502c.git" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;USE_HTTPS&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="0e981f4a59f0410d2fb1de0b119587defd7163cce9a553d0cb41e4ae3904db17" id="item-d70c2771-983a-4d86-9fd1-e0e202b61cb4" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
          Clone via HTTPS
</span>      <span data-view-component="true" class="ActionListItem-description">Clone using the web URL.</span>
</span></button>

</li>
        <li role="presentation" aria-hidden="true" data-view-component="true" class="ActionList-sectionDivider"></li>
        <li target="_blank" rel="noopener noreferrer" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <a tabindex="-1" id="item-f856e71c-6a67-4868-ab79-dbc828d87211" href="https://docs.github.com/articles/which-remote-url-should-i-use" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-question">
    <path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.92 6.085h.001a.749.749 0 1 1-1.342-.67c.169-.339.436-.701.849-.977C6.845 4.16 7.369 4 8 4a2.756 2.756 0 0 1 1.637.525c.503.377.863.965.863 1.725 0 .448-.115.83-.329 1.15-.205.307-.47.513-.692.662-.109.072-.22.138-.313.195l-.006.004a6.24 6.24 0 0 0-.26.16.952.952 0 0 0-.276.245.75.75 0 0 1-1.248-.832c.184-.264.42-.489.692-.661.103-.067.207-.132.313-.195l.007-.004c.1-.061.182-.11.258-.161a.969.969 0 0 0 .277-.245C8.96 6.514 9 6.427 9 6.25a.612.612 0 0 0-.262-.525A1.27 1.27 0 0 0 8 5.5c-.369 0-.595.09-.74.187a1.01 1.01 0 0 0-.34.398ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        </span>

        <span data-view-component="true" class="ActionListItem-label">
                Learn more about clone URLs

</span>      
</a>

</li>
</ul>    
</div></action-list>


</div>

</div></anchored-position>  </focus-group>
</action-menu>    <primer-text-field class="FormControl width-full FormControl--fullWidth">
      <label for="gist-share-url-sized-down" class="sr-only FormControl-label">
        Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
</label>    
  <div class="FormControl-input-wrap FormControl-input-wrap--small">

      <input id="gist-share-url-sized-down" aria-label="Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;" value="&lt;script src=&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&quot;&gt;&lt;/script&gt;" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-706eab09-6822-4385-84a9-b37296ef4e20" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-sized-down" />
</div>
      <div class="FormControl-inlineValidation" id="validation-706eab09-6822-4385-84a9-b37296ef4e20" hidden="hidden">
  <span class="FormControl-inlineValidation--visual" data-target="primer-text-field.validationSuccessIcon" hidden><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-check-circle-fill">
    <path d="M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"></path>
</svg></span>
  <span class=" FormControl-inlineValidation--visual" data-target="primer-text-field.validationErrorIcon"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill">
    <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path>
</svg></span>
  <span></span>
</div>

</primer-text-field>
  <span data-view-component="true">
  <clipboard-copy id="clipboard-button" aria-label="Copy" for="gist-share-url-sized-down" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;COPY_URL&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="ccdaa49ded0e56999a67c385d04e99e248c7026fda62ce075a54bc4edb9d83ba" type="button" data-view-component="true" class="rounded-left-0 Button--secondary Button--small Button">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg style="display: none;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check color-fg-success">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
</clipboard-copy>  <div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div>
</span>

</div>
    </li>
    <li>
        <button href="https://desktop.github.com" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;OPEN_IN_DESKTOP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d7a99ac19579e6b291f9db0565b76dc3587a912af3d1ed7316b92734615a385a" data-platforms="windows,mac" id="icon-button-7f64b853-12a5-4291-8692-bc8c09ed7d87" aria-labelledby="tooltip-4bce90d9-896d-421a-afbc-9b70b53f28cd" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small js-remove-unless-platform">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-desktop-download Button-visual">
    <path d="m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z"></path><path d="M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z"></path>
</svg>
</button><tool-tip id="tooltip-4bce90d9-896d-421a-afbc-9b70b53f28cd" for="icon-button-7f64b853-12a5-4291-8692-bc8c09ed7d87" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Save 7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c to your computer and use it in GitHub Desktop.</tool-tip>


    </li>
  </ul>

<div class="d-flex flex-md-row flex-column px-0 pr-md-3 px-lg-5">
  <div class="flex-md-order-1 flex-order-2 flex-auto">
    <nav class="UnderlineNav box-shadow-none px-3 px-lg-0"
     aria-label="Gist"
     data-pjax="#gist-pjax-container">

  <div class="UnderlineNav-body">
    <a class="js-selected-navigation-item selected UnderlineNav-item" data-pjax="true" data-hotkey="g c" aria-current="page" data-selected-links="gist_code /7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c" href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon">
    <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path>
</svg>
      Code
</a>
      <a class="js-selected-navigation-item UnderlineNav-item" data-pjax="true" data-hotkey="g r" data-selected-links="gist_revisions /7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c/revisions" href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c/revisions">
        <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-commit UnderlineNav-octicon">
    <path d="M11.93 8.5a4.002 4.002 0 0 1-7.86 0H.75a.75.75 0 0 1 0-1.5h3.32a4.002 4.002 0 0 1 7.86 0h3.32a.75.75 0 0 1 0 1.5Zm-1.43-.75a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"></path>
</svg>
        Revisions
        <span title="6" data-view-component="true" class="Counter">6</span>
</a>

  </div>
</nav>

  </div>

  <div class="d-md-flex d-none flex-items-center flex-md-order-2 flex-order-1" data-multiple>

<div data-view-component="true" class="flex-items-center d-inline-flex">
  <action-menu data-menu-input="gist-share-url-original" data-select-variant="single" data-dynamic-label="" data-view-component="true" class="flex-shrink-0">
  <focus-group direction="vertical" mnemonics retain>
    <button id="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-button" popovertarget="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-overlay" aria-controls="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-list" aria-haspopup="true" type="button" data-view-component="true" class="rounded-right-0 border-right-0 Button--secondary Button--small Button">  <span class="Button-content">
    <span class="Button-label">Embed</span>
  </span>
    <span class="Button-visual Button-trailingAction">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down">
    <path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path>
</svg>
    </span>
</button>


<anchored-position data-target="action-menu.overlay" id="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-overlay" anchor="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true">
  <div data-view-component="true" class="Overlay Overlay--size-auto">

      <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone">          <action-list>
  <div data-view-component="true">
    <ul aria-labelledby="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-button" id="action-menu-4e90ca55-3e4e-4beb-ab62-6f7f395438bf-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap">
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="&lt;script src=&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&quot;&gt;&lt;/script&gt;" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;EMBED&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f0ad28f7880537321d5a7304aad48aa4ce631e27e0bef41209bd7b6c99924cc4" id="item-599613ce-ab1f-487f-9b4f-6acf5c06e5fd" type="button" role="menuitemradio" aria-checked="true" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
           Embed
</span>      <span data-view-component="true" class="ActionListItem-description">Embed this gist in your website.</span>
</span></button>

</li>
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;SHARE&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f75b3cf42880b628cdcb1d911775e2ddbc48622da959305de39be85d1088e6f8" id="item-93556f50-4253-4ead-9d82-3ca137013a2f" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
           Share
</span>      <span data-view-component="true" class="ActionListItem-description">Copy sharable link for this gist.</span>
</span></button>

</li>
        <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <button value="https://gist.github.com/ed55e9b55ac69742b8ed61d5ae06502c.git" tabindex="-1" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;USE_HTTPS&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="0e981f4a59f0410d2fb1de0b119587defd7163cce9a553d0cb41e4ae3904db17" id="item-d63a2b7a-891b-4f32-b37f-b994da0d9b27" type="button" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
      <span data-view-component="true" class="ActionListItem-descriptionWrap">
        <span data-view-component="true" class="ActionListItem-label">
          Clone via HTTPS
</span>      <span data-view-component="true" class="ActionListItem-description">Clone using the web URL.</span>
</span></button>

</li>
        <li role="presentation" aria-hidden="true" data-view-component="true" class="ActionList-sectionDivider"></li>
        <li target="_blank" rel="noopener noreferrer" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem">


    <a tabindex="-1" id="item-84becdf0-2c0c-4b8c-944a-614d67a918cd" href="https://docs.github.com/articles/which-remote-url-should-i-use" role="menuitemradio" aria-checked="false" data-view-component="true" class="ActionListContent ActionListContent--visual16">
        <span class="ActionListItem-visual ActionListItem-action--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check ActionListItem-singleSelectCheckmark">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
        </span>
        <span class="ActionListItem-visual ActionListItem-visual--leading">
          <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-question">
    <path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.92 6.085h.001a.749.749 0 1 1-1.342-.67c.169-.339.436-.701.849-.977C6.845 4.16 7.369 4 8 4a2.756 2.756 0 0 1 1.637.525c.503.377.863.965.863 1.725 0 .448-.115.83-.329 1.15-.205.307-.47.513-.692.662-.109.072-.22.138-.313.195l-.006.004a6.24 6.24 0 0 0-.26.16.952.952 0 0 0-.276.245.75.75 0 0 1-1.248-.832c.184-.264.42-.489.692-.661.103-.067.207-.132.313-.195l.007-.004c.1-.061.182-.11.258-.161a.969.969 0 0 0 .277-.245C8.96 6.514 9 6.427 9 6.25a.612.612 0 0 0-.262-.525A1.27 1.27 0 0 0 8 5.5c-.369 0-.595.09-.74.187a1.01 1.01 0 0 0-.34.398ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
        </span>

        <span data-view-component="true" class="ActionListItem-label">
                Learn more about clone URLs

</span>      
</a>

</li>
</ul>    
</div></action-list>


</div>

</div></anchored-position>  </focus-group>
</action-menu>    <primer-text-field class="FormControl width-full FormControl--fullWidth">
      <label for="gist-share-url-original" class="sr-only FormControl-label">
        Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
</label>    
  <div class="FormControl-input-wrap FormControl-input-wrap--small">

      <input id="gist-share-url-original" aria-label="Clone this repository at &amp;lt;script src=&amp;quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;" value="&lt;script src=&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c.js&quot;&gt;&lt;/script&gt;" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-8f28048e-29e0-4282-9cf0-954fc59e554d" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-original" />
</div>
      <div class="FormControl-inlineValidation" id="validation-8f28048e-29e0-4282-9cf0-954fc59e554d" hidden="hidden">
  <span class="FormControl-inlineValidation--visual" data-target="primer-text-field.validationSuccessIcon" hidden><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-check-circle-fill">
    <path d="M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0Zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938Z"></path>
</svg></span>
  <span class=" FormControl-inlineValidation--visual" data-target="primer-text-field.validationErrorIcon"><svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill">
    <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path>
</svg></span>
  <span></span>
</div>

</primer-text-field>
  <span data-view-component="true">
  <clipboard-copy id="clipboard-button" aria-label="Copy" for="gist-share-url-original" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;COPY_URL&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="ccdaa49ded0e56999a67c385d04e99e248c7026fda62ce075a54bc4edb9d83ba" type="button" data-view-component="true" class="rounded-left-0 Button--secondary Button--small Button">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg style="display: none;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check color-fg-success">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
</clipboard-copy>  <div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div>
</span>

</div>

    <div class="ml-2">
        <button href="https://desktop.github.com" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;OPEN_IN_DESKTOP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="d7a99ac19579e6b291f9db0565b76dc3587a912af3d1ed7316b92734615a385a" data-platforms="windows,mac" id="icon-button-ecc452d4-2594-4ddc-9d81-b14b727ba33a" aria-labelledby="tooltip-c7fe4da7-9b78-4d06-bc65-2ca7148e9358" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--small js-remove-unless-platform">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-desktop-download Button-visual">
    <path d="m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z"></path><path d="M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z"></path>
</svg>
</button><tool-tip id="tooltip-c7fe4da7-9b78-4d06-bc65-2ca7148e9358" for="icon-button-ecc452d4-2594-4ddc-9d81-b14b727ba33a" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Save 7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c to your computer and use it in GitHub Desktop.</tool-tip>


    </div>

    <div class="ml-2">
      <a class="btn btn-sm" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;clone_or_download.click&quot;,&quot;payload&quot;:{&quot;feature_clicked&quot;:&quot;DOWNLOAD_ZIP&quot;,&quot;git_repository_type&quot;:&quot;GIST&quot;,&quot;gist_id&quot;:121509117,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f081fa7a4c33c099c94aa6f636b773193d84a5be1db7ece66cb1f892f0c8eec0" data-ga-click="Gist, download zip, location:gist overview" href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c/archive/b769f4467661067d97560e0a492cc0e4d6488d86.zip">Download ZIP</a>
    </div>
  </div>
</div>


  </div>
</div>

<div class="container-lg px-3">
  <div class="repository-content gist-content" >

  <div>
      <div itemprop="about">
    GoogleSpreadSheetからDLしたCSVファイルをMariaDBにレコード一括追加(BULK INSERT)するPythonコード
  </div>

        <div class="js-gist-file-update-container js-task-list-container">
  <div id="file-pymysql_bulk_incert-py" class="file my-2">
      <div class="file-header d-flex flex-md-items-center flex-items-start">
        <div class="file-actions flex-order-2 pt-0">
          <a href="/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c/raw/b769f4467661067d97560e0a492cc0e4d6488d86/pymysql_bulk_incert.py" data-view-component="true" class="Button--secondary Button--small Button">  <span class="Button-content">
    <span class="Button-label">Raw</span>
  </span>
</a>

        </div>
        <div class="file-info pr-4 d-flex flex-md-items-center flex-items-start flex-order-1 flex-auto">
          <span class="mr-1">
            <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square color-fg-muted">
    <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path>
</svg>
          </span>
          <a class="wb-break-all" href="#file-pymysql_bulk_incert-py">
            <strong class="user-select-contain gist-blob-name css-truncate-target">
              pymysql_bulk_incert.py
            </strong>
          </a>
        </div>
      </div>

    <div itemprop="text"
      class="Box-body p-0 blob-wrapper data type-python  gist-border-0"
      style="overflow: auto" tabindex="0" role="region"
      aria-label="file-pymysql_bulk_incert-py"
    >


<div class="js-check-bidi js-blob-code-container blob-code-content">

  <template class="js-file-alert-template">
  <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center">
  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <span>
      This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a>
    </span>


  <div data-view-component="true" class="flash-action">        <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn">    Show hidden characters
</a>
</div>
</div></template>
<template class="js-line-alert-template">
  <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e">
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
</span></template>

  <table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip data-tagsearch-path="pymysql_bulk_incert.py">
        <tr>
          <td id="file-pymysql_bulk_incert-py-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td>
          <td id="file-pymysql_bulk_incert-py-LC1" class="blob-code blob-code-inner js-file-line"><span class=pl-k>import</span> <span class=pl-s1>os</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td>
          <td id="file-pymysql_bulk_incert-py-LC2" class="blob-code blob-code-inner js-file-line"><span class=pl-k>import</span> <span class=pl-s1>random</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td>
          <td id="file-pymysql_bulk_incert-py-LC3" class="blob-code blob-code-inner js-file-line"><span class=pl-k>import</span> <span class=pl-s1>time</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td>
          <td id="file-pymysql_bulk_incert-py-LC4" class="blob-code blob-code-inner js-file-line"><span class=pl-k>from</span> <span class=pl-s1>typing</span> <span class=pl-k>import</span> <span class=pl-v>Any</span>, <span class=pl-v>List</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td>
          <td id="file-pymysql_bulk_incert-py-LC5" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td>
          <td id="file-pymysql_bulk_incert-py-LC6" class="blob-code blob-code-inner js-file-line"><span class=pl-k>import</span> <span class=pl-s1>pandas</span> <span class=pl-k>as</span> <span class=pl-s1>pd</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td>
          <td id="file-pymysql_bulk_incert-py-LC7" class="blob-code blob-code-inner js-file-line"><span class=pl-k>import</span> <span class=pl-s1>pymysql</span>.<span class=pl-s1>cursors</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td>
          <td id="file-pymysql_bulk_incert-py-LC8" class="blob-code blob-code-inner js-file-line"><span class=pl-k>from</span> <span class=pl-s1>dotenv</span> <span class=pl-k>import</span> <span class=pl-s1>load_dotenv</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td>
          <td id="file-pymysql_bulk_incert-py-LC9" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td>
          <td id="file-pymysql_bulk_incert-py-LC10" class="blob-code blob-code-inner js-file-line"><span class=pl-en>print</span>(<span class=pl-s>&quot;Connect to DB&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td>
          <td id="file-pymysql_bulk_incert-py-LC11" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L12" class="blob-num js-line-number js-blob-rnum" data-line-number="12"></td>
          <td id="file-pymysql_bulk_incert-py-LC12" class="blob-code blob-code-inner js-file-line"><span class=pl-c># DB access setting required</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L13" class="blob-num js-line-number js-blob-rnum" data-line-number="13"></td>
          <td id="file-pymysql_bulk_incert-py-LC13" class="blob-code blob-code-inner js-file-line"><span class=pl-en>load_dotenv</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L14" class="blob-num js-line-number js-blob-rnum" data-line-number="14"></td>
          <td id="file-pymysql_bulk_incert-py-LC14" class="blob-code blob-code-inner js-file-line"><span class=pl-s1>conn</span> <span class=pl-c1>=</span> <span class=pl-s1>pymysql</span>.<span class=pl-c1>connect</span>(</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L15" class="blob-num js-line-number js-blob-rnum" data-line-number="15"></td>
          <td id="file-pymysql_bulk_incert-py-LC15" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>host</span><span class=pl-c1>=</span><span class=pl-en>str</span>(<span class=pl-s1>os</span>.<span class=pl-c1>environ</span>[<span class=pl-s>&quot;HOST&quot;</span>]),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L16" class="blob-num js-line-number js-blob-rnum" data-line-number="16"></td>
          <td id="file-pymysql_bulk_incert-py-LC16" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>port</span><span class=pl-c1>=</span><span class=pl-en>int</span>(<span class=pl-s1>os</span>.<span class=pl-c1>environ</span>[<span class=pl-s>&quot;PORT&quot;</span>]),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L17" class="blob-num js-line-number js-blob-rnum" data-line-number="17"></td>
          <td id="file-pymysql_bulk_incert-py-LC17" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>user</span><span class=pl-c1>=</span><span class=pl-en>str</span>(<span class=pl-s1>os</span>.<span class=pl-c1>environ</span>[<span class=pl-s>&quot;USER&quot;</span>]),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L18" class="blob-num js-line-number js-blob-rnum" data-line-number="18"></td>
          <td id="file-pymysql_bulk_incert-py-LC18" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>password</span><span class=pl-c1>=</span><span class=pl-en>str</span>(<span class=pl-s1>os</span>.<span class=pl-c1>environ</span>[<span class=pl-s>&quot;PASSWORD&quot;</span>]),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L19" class="blob-num js-line-number js-blob-rnum" data-line-number="19"></td>
          <td id="file-pymysql_bulk_incert-py-LC19" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>database</span><span class=pl-c1>=</span><span class=pl-en>str</span>(<span class=pl-s1>os</span>.<span class=pl-c1>environ</span>[<span class=pl-s>&quot;DATABASE&quot;</span>]),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L20" class="blob-num js-line-number js-blob-rnum" data-line-number="20"></td>
          <td id="file-pymysql_bulk_incert-py-LC20" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>cursorclass</span><span class=pl-c1>=</span><span class=pl-s1>pymysql</span>.<span class=pl-c1>cursors</span>.<span class=pl-c1>DictCursor</span>,</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L21" class="blob-num js-line-number js-blob-rnum" data-line-number="21"></td>
          <td id="file-pymysql_bulk_incert-py-LC21" class="blob-code blob-code-inner js-file-line">)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L22" class="blob-num js-line-number js-blob-rnum" data-line-number="22"></td>
          <td id="file-pymysql_bulk_incert-py-LC22" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L23" class="blob-num js-line-number js-blob-rnum" data-line-number="23"></td>
          <td id="file-pymysql_bulk_incert-py-LC23" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L24" class="blob-num js-line-number js-blob-rnum" data-line-number="24"></td>
          <td id="file-pymysql_bulk_incert-py-LC24" class="blob-code blob-code-inner js-file-line"><span class=pl-c># Bulk Insert</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L25" class="blob-num js-line-number js-blob-rnum" data-line-number="25"></td>
          <td id="file-pymysql_bulk_incert-py-LC25" class="blob-code blob-code-inner js-file-line"><span class=pl-k>def</span> <span class=pl-en>insert_data_bulk</span>(<span class=pl-s1>values</span>: <span class=pl-v>List</span>[<span class=pl-smi>Any</span>]) <span class=pl-c1>-&gt;</span> <span class=pl-c1>None</span>:</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L26" class="blob-num js-line-number js-blob-rnum" data-line-number="26"></td>
          <td id="file-pymysql_bulk_incert-py-LC26" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>&quot;Insert bulk data&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L27" class="blob-num js-line-number js-blob-rnum" data-line-number="27"></td>
          <td id="file-pymysql_bulk_incert-py-LC27" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L28" class="blob-num js-line-number js-blob-rnum" data-line-number="28"></td>
          <td id="file-pymysql_bulk_incert-py-LC28" class="blob-code blob-code-inner js-file-line">    <span class=pl-k>with</span> <span class=pl-s1>conn</span>:</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L29" class="blob-num js-line-number js-blob-rnum" data-line-number="29"></td>
          <td id="file-pymysql_bulk_incert-py-LC29" class="blob-code blob-code-inner js-file-line">        <span class=pl-k>with</span> <span class=pl-s1>conn</span>.<span class=pl-c1>cursor</span>() <span class=pl-k>as</span> <span class=pl-s1>cursor</span>:</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L30" class="blob-num js-line-number js-blob-rnum" data-line-number="30"></td>
          <td id="file-pymysql_bulk_incert-py-LC30" class="blob-code blob-code-inner js-file-line">            <span class=pl-c># insert record</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L31" class="blob-num js-line-number js-blob-rnum" data-line-number="31"></td>
          <td id="file-pymysql_bulk_incert-py-LC31" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>insert_sql</span> <span class=pl-c1>=</span> <span class=pl-s>&quot;INSERT INTO ec_sol_db1.ec_sol_tbl1 (cameratype, date, num, foo1, foo2, foo3, foo4, foo5) values (%s, %s, %s, %s, %s, %s, %s, %s)&quot;</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L32" class="blob-num js-line-number js-blob-rnum" data-line-number="32"></td>
          <td id="file-pymysql_bulk_incert-py-LC32" class="blob-code blob-code-inner js-file-line">            <span class=pl-c># insert_sql = &quot;INSERT INTO `ec_sol_tbl1` (`cameratype`,`date`, `num`, `foo1`, `foo2`, `foo3`, `foo4`, `foo5`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)&quot;</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L33" class="blob-num js-line-number js-blob-rnum" data-line-number="33"></td>
          <td id="file-pymysql_bulk_incert-py-LC33" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>cursor</span>.<span class=pl-c1>executemany</span>(<span class=pl-s1>insert_sql</span>, <span class=pl-s1>values</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L34" class="blob-num js-line-number js-blob-rnum" data-line-number="34"></td>
          <td id="file-pymysql_bulk_incert-py-LC34" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L35" class="blob-num js-line-number js-blob-rnum" data-line-number="35"></td>
          <td id="file-pymysql_bulk_incert-py-LC35" class="blob-code blob-code-inner js-file-line">        <span class=pl-c># Commit and execute transaction</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L36" class="blob-num js-line-number js-blob-rnum" data-line-number="36"></td>
          <td id="file-pymysql_bulk_incert-py-LC36" class="blob-code blob-code-inner js-file-line">        <span class=pl-s1>conn</span>.<span class=pl-c1>commit</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L37" class="blob-num js-line-number js-blob-rnum" data-line-number="37"></td>
          <td id="file-pymysql_bulk_incert-py-LC37" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L38" class="blob-num js-line-number js-blob-rnum" data-line-number="38"></td>
          <td id="file-pymysql_bulk_incert-py-LC38" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># End processing</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L39" class="blob-num js-line-number js-blob-rnum" data-line-number="39"></td>
          <td id="file-pymysql_bulk_incert-py-LC39" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>cursor</span>.<span class=pl-c1>close</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L40" class="blob-num js-line-number js-blob-rnum" data-line-number="40"></td>
          <td id="file-pymysql_bulk_incert-py-LC40" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L41" class="blob-num js-line-number js-blob-rnum" data-line-number="41"></td>
          <td id="file-pymysql_bulk_incert-py-LC41" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L42" class="blob-num js-line-number js-blob-rnum" data-line-number="42"></td>
          <td id="file-pymysql_bulk_incert-py-LC42" class="blob-code blob-code-inner js-file-line"><span class=pl-k>def</span> <span class=pl-en>main</span>() <span class=pl-c1>-&gt;</span> <span class=pl-c1>None</span>:</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L43" class="blob-num js-line-number js-blob-rnum" data-line-number="43"></td>
          <td id="file-pymysql_bulk_incert-py-LC43" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># Generate data</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L44" class="blob-num js-line-number js-blob-rnum" data-line-number="44"></td>
          <td id="file-pymysql_bulk_incert-py-LC44" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>values</span> <span class=pl-c1>=</span> []</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L45" class="blob-num js-line-number js-blob-rnum" data-line-number="45"></td>
          <td id="file-pymysql_bulk_incert-py-LC45" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>ct</span> <span class=pl-c1>=</span> <span class=pl-s>&quot;serial111&quot;</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L46" class="blob-num js-line-number js-blob-rnum" data-line-number="46"></td>
          <td id="file-pymysql_bulk_incert-py-LC46" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># load csv(Exported from GoogleSpreadSheet)</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L47" class="blob-num js-line-number js-blob-rnum" data-line-number="47"></td>
          <td id="file-pymysql_bulk_incert-py-LC47" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># GoogleSpreadSheet Date Format</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L48" class="blob-num js-line-number js-blob-rnum" data-line-number="48"></td>
          <td id="file-pymysql_bulk_incert-py-LC48" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># https://www.ablebits.com/office-addins-blog/google-sheets-change-date-format/</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L49" class="blob-num js-line-number js-blob-rnum" data-line-number="49"></td>
          <td id="file-pymysql_bulk_incert-py-LC49" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>df</span> <span class=pl-c1>=</span> <span class=pl-s1>pd</span>.<span class=pl-c1>read_csv</span>(<span class=pl-s>&quot;sample_data1.csv&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L50" class="blob-num js-line-number js-blob-rnum" data-line-number="50"></td>
          <td id="file-pymysql_bulk_incert-py-LC50" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># convert datetime64</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L51" class="blob-num js-line-number js-blob-rnum" data-line-number="51"></td>
          <td id="file-pymysql_bulk_incert-py-LC51" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># dtype: object -&gt; dtype: datetime64[ns]</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L52" class="blob-num js-line-number js-blob-rnum" data-line-number="52"></td>
          <td id="file-pymysql_bulk_incert-py-LC52" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># 2022/1/1 3:00 -&gt; 2022-01-01 03:00:00</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L53" class="blob-num js-line-number js-blob-rnum" data-line-number="53"></td>
          <td id="file-pymysql_bulk_incert-py-LC53" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>df</span>[<span class=pl-s>&quot;date&quot;</span>] <span class=pl-c1>=</span> <span class=pl-s1>pd</span>.<span class=pl-c1>to_datetime</span>(<span class=pl-s1>df</span>[<span class=pl-s>&quot;date&quot;</span>])</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L54" class="blob-num js-line-number js-blob-rnum" data-line-number="54"></td>
          <td id="file-pymysql_bulk_incert-py-LC54" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L55" class="blob-num js-line-number js-blob-rnum" data-line-number="55"></td>
          <td id="file-pymysql_bulk_incert-py-LC55" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>&quot;Generate data&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L56" class="blob-num js-line-number js-blob-rnum" data-line-number="56"></td>
          <td id="file-pymysql_bulk_incert-py-LC56" class="blob-code blob-code-inner js-file-line">    <span class=pl-k>for</span> <span class=pl-s1>timestamp</span>, <span class=pl-s1>num</span> <span class=pl-c1>in</span> <span class=pl-en>zip</span>(<span class=pl-s1>df</span>[<span class=pl-s>&quot;date&quot;</span>], <span class=pl-s1>df</span>[<span class=pl-s>&quot;num&quot;</span>]):</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L57" class="blob-num js-line-number js-blob-rnum" data-line-number="57"></td>
          <td id="file-pymysql_bulk_incert-py-LC57" class="blob-code blob-code-inner js-file-line">        <span class=pl-s1>dt_str</span> <span class=pl-c1>=</span> <span class=pl-s1>timestamp</span>.<span class=pl-c1>strftime</span>(<span class=pl-s>&quot;%Y-%m-%d %H:%M:%S&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L58" class="blob-num js-line-number js-blob-rnum" data-line-number="58"></td>
          <td id="file-pymysql_bulk_incert-py-LC58" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L59" class="blob-num js-line-number js-blob-rnum" data-line-number="59"></td>
          <td id="file-pymysql_bulk_incert-py-LC59" class="blob-code blob-code-inner js-file-line">        <span class=pl-s1>num</span> <span class=pl-c1>=</span> <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L60" class="blob-num js-line-number js-blob-rnum" data-line-number="60"></td>
          <td id="file-pymysql_bulk_incert-py-LC60" class="blob-code blob-code-inner js-file-line">        <span class=pl-s1>foo_count_list</span> <span class=pl-c1>=</span> [</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L61" class="blob-num js-line-number js-blob-rnum" data-line-number="61"></td>
          <td id="file-pymysql_bulk_incert-py-LC61" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L62" class="blob-num js-line-number js-blob-rnum" data-line-number="62"></td>
          <td id="file-pymysql_bulk_incert-py-LC62" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L63" class="blob-num js-line-number js-blob-rnum" data-line-number="63"></td>
          <td id="file-pymysql_bulk_incert-py-LC63" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L64" class="blob-num js-line-number js-blob-rnum" data-line-number="64"></td>
          <td id="file-pymysql_bulk_incert-py-LC64" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L65" class="blob-num js-line-number js-blob-rnum" data-line-number="65"></td>
          <td id="file-pymysql_bulk_incert-py-LC65" class="blob-code blob-code-inner js-file-line">            <span class=pl-s1>random</span>.<span class=pl-c1>randint</span>(<span class=pl-c1>0</span>, <span class=pl-c1>5</span>),</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L66" class="blob-num js-line-number js-blob-rnum" data-line-number="66"></td>
          <td id="file-pymysql_bulk_incert-py-LC66" class="blob-code blob-code-inner js-file-line">        ]</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L67" class="blob-num js-line-number js-blob-rnum" data-line-number="67"></td>
          <td id="file-pymysql_bulk_incert-py-LC67" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L68" class="blob-num js-line-number js-blob-rnum" data-line-number="68"></td>
          <td id="file-pymysql_bulk_incert-py-LC68" class="blob-code blob-code-inner js-file-line">        <span class=pl-c># ct, timestamp, num, foo1, foo2, foo3, foo4, foo5</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L69" class="blob-num js-line-number js-blob-rnum" data-line-number="69"></td>
          <td id="file-pymysql_bulk_incert-py-LC69" class="blob-code blob-code-inner js-file-line">        <span class=pl-s1>values</span>.<span class=pl-c1>append</span>(</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L70" class="blob-num js-line-number js-blob-rnum" data-line-number="70"></td>
          <td id="file-pymysql_bulk_incert-py-LC70" class="blob-code blob-code-inner js-file-line">            [</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L71" class="blob-num js-line-number js-blob-rnum" data-line-number="71"></td>
          <td id="file-pymysql_bulk_incert-py-LC71" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>ct</span>,</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L72" class="blob-num js-line-number js-blob-rnum" data-line-number="72"></td>
          <td id="file-pymysql_bulk_incert-py-LC72" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>dt_str</span>,</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L73" class="blob-num js-line-number js-blob-rnum" data-line-number="73"></td>
          <td id="file-pymysql_bulk_incert-py-LC73" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>num</span>,</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L74" class="blob-num js-line-number js-blob-rnum" data-line-number="74"></td>
          <td id="file-pymysql_bulk_incert-py-LC74" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>foo_count_list</span>[<span class=pl-c1>0</span>],</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L75" class="blob-num js-line-number js-blob-rnum" data-line-number="75"></td>
          <td id="file-pymysql_bulk_incert-py-LC75" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>foo_count_list</span>[<span class=pl-c1>1</span>],</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L76" class="blob-num js-line-number js-blob-rnum" data-line-number="76"></td>
          <td id="file-pymysql_bulk_incert-py-LC76" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>foo_count_list</span>[<span class=pl-c1>2</span>],</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L77" class="blob-num js-line-number js-blob-rnum" data-line-number="77"></td>
          <td id="file-pymysql_bulk_incert-py-LC77" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>foo_count_list</span>[<span class=pl-c1>3</span>],</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L78" class="blob-num js-line-number js-blob-rnum" data-line-number="78"></td>
          <td id="file-pymysql_bulk_incert-py-LC78" class="blob-code blob-code-inner js-file-line">                <span class=pl-s1>foo_count_list</span>[<span class=pl-c1>4</span>],</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L79" class="blob-num js-line-number js-blob-rnum" data-line-number="79"></td>
          <td id="file-pymysql_bulk_incert-py-LC79" class="blob-code blob-code-inner js-file-line">            ]</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L80" class="blob-num js-line-number js-blob-rnum" data-line-number="80"></td>
          <td id="file-pymysql_bulk_incert-py-LC80" class="blob-code blob-code-inner js-file-line">        )</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L81" class="blob-num js-line-number js-blob-rnum" data-line-number="81"></td>
          <td id="file-pymysql_bulk_incert-py-LC81" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>f&quot;Length of data: <span class=pl-s1><span class=pl-kos>{</span><span class=pl-en>len</span>(<span class=pl-s1>values</span>)<span class=pl-kos>}</span></span><span class=pl-cce>\n</span>&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L82" class="blob-num js-line-number js-blob-rnum" data-line-number="82"></td>
          <td id="file-pymysql_bulk_incert-py-LC82" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L83" class="blob-num js-line-number js-blob-rnum" data-line-number="83"></td>
          <td id="file-pymysql_bulk_incert-py-LC83" class="blob-code blob-code-inner js-file-line">    <span class=pl-c># Bulk Insert</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L84" class="blob-num js-line-number js-blob-rnum" data-line-number="84"></td>
          <td id="file-pymysql_bulk_incert-py-LC84" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>&quot;Insert data&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L85" class="blob-num js-line-number js-blob-rnum" data-line-number="85"></td>
          <td id="file-pymysql_bulk_incert-py-LC85" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L86" class="blob-num js-line-number js-blob-rnum" data-line-number="86"></td>
          <td id="file-pymysql_bulk_incert-py-LC86" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>start_time</span> <span class=pl-c1>=</span> <span class=pl-s1>time</span>.<span class=pl-c1>perf_counter</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L87" class="blob-num js-line-number js-blob-rnum" data-line-number="87"></td>
          <td id="file-pymysql_bulk_incert-py-LC87" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>f&quot;Start:<span class=pl-s1><span class=pl-kos>{</span><span class=pl-en>str</span>(<span class=pl-s1>start_time</span>)<span class=pl-kos>}</span></span>[sec]&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L88" class="blob-num js-line-number js-blob-rnum" data-line-number="88"></td>
          <td id="file-pymysql_bulk_incert-py-LC88" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L89" class="blob-num js-line-number js-blob-rnum" data-line-number="89"></td>
          <td id="file-pymysql_bulk_incert-py-LC89" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>insert_data_bulk</span>(<span class=pl-s1>values</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L90" class="blob-num js-line-number js-blob-rnum" data-line-number="90"></td>
          <td id="file-pymysql_bulk_incert-py-LC90" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L91" class="blob-num js-line-number js-blob-rnum" data-line-number="91"></td>
          <td id="file-pymysql_bulk_incert-py-LC91" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>end_time</span> <span class=pl-c1>=</span> <span class=pl-s1>time</span>.<span class=pl-c1>perf_counter</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L92" class="blob-num js-line-number js-blob-rnum" data-line-number="92"></td>
          <td id="file-pymysql_bulk_incert-py-LC92" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>f&quot;End:<span class=pl-s1><span class=pl-kos>{</span><span class=pl-en>str</span>(<span class=pl-s1>end_time</span>)<span class=pl-kos>}</span></span>[sec]&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L93" class="blob-num js-line-number js-blob-rnum" data-line-number="93"></td>
          <td id="file-pymysql_bulk_incert-py-LC93" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L94" class="blob-num js-line-number js-blob-rnum" data-line-number="94"></td>
          <td id="file-pymysql_bulk_incert-py-LC94" class="blob-code blob-code-inner js-file-line">    <span class=pl-s1>elasped_time</span> <span class=pl-c1>=</span> <span class=pl-s1>end_time</span> <span class=pl-c1>-</span> <span class=pl-s1>start_time</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L95" class="blob-num js-line-number js-blob-rnum" data-line-number="95"></td>
          <td id="file-pymysql_bulk_incert-py-LC95" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>print</span>(<span class=pl-s>f&quot;elapsed_time: <span class=pl-s1><span class=pl-kos>{</span><span class=pl-s1>elasped_time</span><span class=pl-kos>}</span></span>[sec]<span class=pl-cce>\n</span>&quot;</span>)</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L96" class="blob-num js-line-number js-blob-rnum" data-line-number="96"></td>
          <td id="file-pymysql_bulk_incert-py-LC96" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L97" class="blob-num js-line-number js-blob-rnum" data-line-number="97"></td>
          <td id="file-pymysql_bulk_incert-py-LC97" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L98" class="blob-num js-line-number js-blob-rnum" data-line-number="98"></td>
          <td id="file-pymysql_bulk_incert-py-LC98" class="blob-code blob-code-inner js-file-line"><span class=pl-k>if</span> <span class=pl-s1>__name__</span> <span class=pl-c1>==</span> <span class=pl-s>&quot;__main__&quot;</span>:</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L99" class="blob-num js-line-number js-blob-rnum" data-line-number="99"></td>
          <td id="file-pymysql_bulk_incert-py-LC99" class="blob-code blob-code-inner js-file-line">    <span class=pl-en>main</span>()</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L100" class="blob-num js-line-number js-blob-rnum" data-line-number="100"></td>
          <td id="file-pymysql_bulk_incert-py-LC100" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L101" class="blob-num js-line-number js-blob-rnum" data-line-number="101"></td>
          <td id="file-pymysql_bulk_incert-py-LC101" class="blob-code blob-code-inner js-file-line"><span class=pl-s>&quot;&quot;&quot;</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L102" class="blob-num js-line-number js-blob-rnum" data-line-number="102"></td>
          <td id="file-pymysql_bulk_incert-py-LC102" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Connect to DB</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L103" class="blob-num js-line-number js-blob-rnum" data-line-number="103"></td>
          <td id="file-pymysql_bulk_incert-py-LC103" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Generate data</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L104" class="blob-num js-line-number js-blob-rnum" data-line-number="104"></td>
          <td id="file-pymysql_bulk_incert-py-LC104" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Length of data: 2000</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L105" class="blob-num js-line-number js-blob-rnum" data-line-number="105"></td>
          <td id="file-pymysql_bulk_incert-py-LC105" class="blob-code blob-code-inner js-file-line"><span class=pl-s></span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L106" class="blob-num js-line-number js-blob-rnum" data-line-number="106"></td>
          <td id="file-pymysql_bulk_incert-py-LC106" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Insert data</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L107" class="blob-num js-line-number js-blob-rnum" data-line-number="107"></td>
          <td id="file-pymysql_bulk_incert-py-LC107" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Start:14293.814702689[sec]</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L108" class="blob-num js-line-number js-blob-rnum" data-line-number="108"></td>
          <td id="file-pymysql_bulk_incert-py-LC108" class="blob-code blob-code-inner js-file-line"><span class=pl-s>Insert bulk data</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L109" class="blob-num js-line-number js-blob-rnum" data-line-number="109"></td>
          <td id="file-pymysql_bulk_incert-py-LC109" class="blob-code blob-code-inner js-file-line"><span class=pl-s>End:14294.212498889[sec]</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L110" class="blob-num js-line-number js-blob-rnum" data-line-number="110"></td>
          <td id="file-pymysql_bulk_incert-py-LC110" class="blob-code blob-code-inner js-file-line"><span class=pl-s>elapsed_time: 0.39779619999899296[sec]</span></td>
        </tr>
        <tr>
          <td id="file-pymysql_bulk_incert-py-L111" class="blob-num js-line-number js-blob-rnum" data-line-number="111"></td>
          <td id="file-pymysql_bulk_incert-py-LC111" class="blob-code blob-code-inner js-file-line"><span class=pl-s>&quot;&quot;&quot;</span></td>
        </tr>
  </table>
</div>


    </div>

  </div>
</div>


        <a name="comments"></a>
        <div class="js-quote-selection-container" data-quote-markdown=".js-comment-body">
          <div class="js-discussion "
          >
            <div class="ml-md-6 pl-md-3 ml-0 pl-0">




<!-- Rendered timeline since 2025-01-18 06:58:02 -->
<div id="partial-timeline-marker"
      class="js-timeline-marker js-updatable-content"
      data-last-modified="Sat, 18 Jan 2025 14:58:02 GMT"
      >
</div>

            </div>

            <div class="discussion-timeline-actions">
              <div data-view-component="true" class="flash flash-warn mt-3">

    <a rel="nofollow" class="btn btn-primary" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;signed out comment&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="b45306b8cfffb4a699e916ff93532c281687017f22fc6aaa4d95777e7a88d4cb" href="/join?source=comment-gist">Sign up for free</a>
    <strong>to join this conversation on GitHub</strong>.
    Already have an account?
    <a rel="nofollow" class="Link--inTextBlock" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;signed out comment&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://gist.github.com/7rikazhexde/ed55e9b55ac69742b8ed61d5ae06502c&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="7aed8098cb49b88cf71a48e9caee943bfdbf35ff6b60f3daf396dfd81ed3ab0e" data-test-selector="comments-sign-in-link" href="/login?return_to=https%3A%2F%2Fgist.github.com%2F7rikazhexde%2Fed55e9b55ac69742b8ed61d5ae06502c">Sign in to comment</a>



</div>
            </div>
          </div>
        </div>
</div>
  </div>
</div><!-- /.container -->

    </main>
  </div>

  </div>

          <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" >
  <h2 class='sr-only'>Footer</h2>




  <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap">
    <div class="d-flex flex-items-center flex-shrink-0 mx-2">
      <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com">
        <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github">
    <path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path>
</svg>
</a>
      <span>
        &copy; 2025 GitHub,&nbsp;Inc.
      </span>
    </div>

    <nav aria-label="Footer">
      <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3>

      <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading">

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a>
          </li>

          <li class="mx-2">
            <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a>
          </li>

          <li class="mx-2" >
  <cookie-consent-link>
    <button
      type="button"
      class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent"
      data-action="click:cookie-consent-link#showConsentManagement"
      data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}"
    >
      Manage cookies
    </button>
  </cookie-consent-link>
</li>

<li class="mx-2">
  <cookie-consent-link>
    <button
      type="button"
      class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent"
      data-action="click:cookie-consent-link#showConsentManagement"
      data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}"
    >
      Do not share my personal information
    </button>
  </cookie-consent-link>
</li>

      </ul>
    </nav>
  </div>
</footer>



    <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent>



  <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden>
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
    </button>
    You can’t perform that action at this time.
  </div>

    <template id="site-details-dialog">
  <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open>
    <summary role="button" aria-label="Close dialog"></summary>
    <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal">
      <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog>
        <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x">
    <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
</svg>
      </button>
      <div class="octocat-spinner my-6 js-details-dialog-spinner"></div>
    </details-dialog>
  </details>
</template>

    <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;">
  <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;">
  </div>
</div>

    <template id="snippet-clipboard-copy-button">
  <div class="zeroclipboard-container position-absolute right-0 top-0">
    <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
    </clipboard-copy>
  </div>
</template>
<template id="snippet-clipboard-copy-button-unpositioned">
  <div class="zeroclipboard-container">
    <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w">
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon">
    <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
      <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none">
    <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
</svg>
    </clipboard-copy>
  </div>
</template>




    </div>

    <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div>
    <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div>
  </body>
</html>