cyyeh commited on
Commit
643dcb7
·
1 Parent(s): ed41156

refactor and update

Browse files
Pipfile CHANGED
@@ -7,7 +7,6 @@ name = "pypi"
7
  streamlit = "*"
8
  requests = "*"
9
  networkx = "*"
10
- orjson = "*"
11
  pyvis = {editable = true, path = "./pyvis"}
12
 
13
  [dev-packages]
 
7
  streamlit = "*"
8
  requests = "*"
9
  networkx = "*"
 
10
  pyvis = {editable = true, path = "./pyvis"}
11
 
12
  [dev-packages]
Pipfile.lock CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "_meta": {
3
  "hash": {
4
- "sha256": "b3ad133b7dbeaf9a10743bb8a6ee428061387fbe5770d1779ad72fe9acf3b79b"
5
  },
6
  "pipfile-spec": 6,
7
  "requires": {
@@ -21,7 +21,7 @@
21
  "sha256:0c724848ae53410c13fa28be2b3b9a9dcb7b5caa1a70f7f217bd663bb419935a",
22
  "sha256:d87d9372e63b48cd96b2a6415f0cf9457f50162ab79dc7a31cd7e024dd840026"
23
  ],
24
- "markers": "python_full_version >= '3.7.0'",
25
  "version": "==4.2.0"
26
  },
27
  "appnope": {
@@ -124,7 +124,7 @@
124
  "sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1",
125
  "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565"
126
  ],
127
- "markers": "python_full_version >= '3.7.0'",
128
  "version": "==5.0.0"
129
  },
130
  "blinker": {
@@ -133,6 +133,14 @@
133
  ],
134
  "version": "==1.4"
135
  },
 
 
 
 
 
 
 
 
136
  "cachetools": {
137
  "hashes": [
138
  "sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757",
@@ -217,7 +225,7 @@
217
  "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
218
  "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
219
  ],
220
- "markers": "python_full_version >= '3.7.0'",
221
  "version": "==8.1.3"
222
  },
223
  "commonmark": {
@@ -248,7 +256,7 @@
248
  "sha256:e3513399177dd37af4c1332df52da5da1d0c387e5927dc4c0709e26ee7302e8f",
249
  "sha256:eb1946efac0c0c3d411cea0b5ac772fbde744109fd9520fb0c5a51979faf05ad"
250
  ],
251
- "markers": "python_full_version >= '3.7.0'",
252
  "version": "==1.6.0"
253
  },
254
  "decorator": {
@@ -289,6 +297,14 @@
289
  ],
290
  "version": "==2.15.3"
291
  },
 
 
 
 
 
 
 
 
292
  "gitdb": {
293
  "hashes": [
294
  "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd",
@@ -302,7 +318,7 @@
302
  "sha256:1c885ce809e8ba2d88a29befeb385fcea06338d3640712b59ca623c220bb5704",
303
  "sha256:5b68b000463593e05ff2b261acff0ff0972df8ab1b70d3cdbd41b546c8b8fc3d"
304
  ],
305
- "markers": "python_full_version >= '3.7.0'",
306
  "version": "==3.1.27"
307
  },
308
  "idna": {
@@ -318,7 +334,7 @@
318
  "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700",
319
  "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec"
320
  ],
321
- "markers": "python_full_version >= '3.7.0'",
322
  "version": "==4.11.4"
323
  },
324
  "importlib-resources": {
@@ -372,7 +388,7 @@
372
  "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852",
373
  "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"
374
  ],
375
- "markers": "python_full_version >= '3.7.0'",
376
  "version": "==3.1.2"
377
  },
378
  "jsonpickle": {
@@ -388,7 +404,7 @@
388
  "sha256:1c92d2db1900b668201f1797887d66453ab1fbfea51df8e4b46236689c427baf",
389
  "sha256:9d6397ba4a6c0bf0300736057f649e3e12ecbc07d3e81a0dacb72de4e9801957"
390
  ],
391
- "markers": "python_full_version >= '3.7.0'",
392
  "version": "==4.6.0"
393
  },
394
  "jupyter-client": {
@@ -396,7 +412,7 @@
396
  "sha256:05d4ff6a0ade25138c6bb0fbeac7ddc26b5fe835e7dd816b64b4a45b931bdc0b",
397
  "sha256:404abe552540aff3527e66e16beb114b6b4ff58479d51a301f4eb9701e4f52ef"
398
  ],
399
- "markers": "python_full_version >= '3.7.0'",
400
  "version": "==7.3.1"
401
  },
402
  "jupyter-core": {
@@ -404,7 +420,7 @@
404
  "sha256:a6de44b16b7b31d7271130c71a6792c4040f077011961138afed5e5e73181aec",
405
  "sha256:e7f5212177af7ab34179690140f188aa9bf3d322d8155ed972cbded19f55b6f3"
406
  ],
407
- "markers": "python_full_version >= '3.7.0'",
408
  "version": "==4.10.0"
409
  },
410
  "jupyterlab-pygments": {
@@ -412,7 +428,7 @@
412
  "sha256:2405800db07c9f770863bcf8049a529c3dd4d3e28536638bd7c1c01d2748309f",
413
  "sha256:7405d7fde60819d905a9fa8ce89e4cd830e318cdad22a0030f7a901da705585d"
414
  ],
415
- "markers": "python_full_version >= '3.7.0'",
416
  "version": "==0.2.2"
417
  },
418
  "jupyterlab-widgets": {
@@ -466,7 +482,7 @@
466
  "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a",
467
  "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"
468
  ],
469
- "markers": "python_full_version >= '3.7.0'",
470
  "version": "==2.1.1"
471
  },
472
  "matplotlib-inline": {
@@ -489,7 +505,7 @@
489
  "sha256:cdef7757cead1735d2c70cc66095b072dced8a1e6d1c7639ef90cd3e04a11f2e",
490
  "sha256:f251bba200a2b401a061dfd700a7a70b5772f664fb49d4a2d3e5536ec0e98c76"
491
  ],
492
- "markers": "python_full_version >= '3.7.0'",
493
  "version": "==0.6.4"
494
  },
495
  "nbconvert": {
@@ -497,7 +513,7 @@
497
  "sha256:223e46e27abe8596b8aed54301fadbba433b7ffea8196a68fd7b1ff509eee99d",
498
  "sha256:c56dd0b8978a1811a5654f74c727ff16ca87dd5a43abd435a1c49b840fcd8360"
499
  ],
500
- "markers": "python_full_version >= '3.7.0'",
501
  "version": "==6.5.0"
502
  },
503
  "nbformat": {
@@ -505,7 +521,7 @@
505
  "sha256:0d6072aaec95dddc39735c144ee8bbc6589c383fb462e4058abc855348152dad",
506
  "sha256:44ba5ca6acb80c5d5a500f1e5b83ede8cbe364d5a495c4c8cf60aaf1ba656501"
507
  ],
508
- "markers": "python_full_version >= '3.7.0'",
509
  "version": "==5.4.0"
510
  },
511
  "nest-asyncio": {
@@ -529,7 +545,7 @@
529
  "sha256:709b1856a564fe53054796c80e17a67262071c86bfbdfa6b96aaa346113c555a",
530
  "sha256:b4a6baf2eba21ce67a0ca11a793d1781b06b8078f34d06c710742e55f3eee505"
531
  ],
532
- "markers": "python_full_version >= '3.7.0'",
533
  "version": "==6.4.11"
534
  },
535
  "numpy": {
@@ -705,7 +721,7 @@
705
  "sha256:f3f6a6034140e9e17e9abc175fc7a266a6e63652028e157750bd98e804a8ed9a",
706
  "sha256:ffde4c6fabb52891d81606411cbfaf77756e3b561b566efd270b3ed3791fde4e"
707
  ],
708
- "markers": "python_full_version >= '3.7.0'",
709
  "version": "==9.1.1"
710
  },
711
  "prometheus-client": {
@@ -751,7 +767,7 @@
751
  "sha256:e250a42f15bf9d5b09fe1b293bdba2801cd520a9f5ea2d7fb7536d4441811d20",
752
  "sha256:ff8d8fa42675249bb456f5db06c00de6c2f4c27a065955917b28c4f15978b9c3"
753
  ],
754
- "markers": "python_full_version >= '3.7.0'",
755
  "version": "==3.20.1"
756
  },
757
  "psutil": {
@@ -840,7 +856,7 @@
840
  "sha256:ece333706a94c1221ced8b299042f85fd88b5db802d71be70024433ddf3aecab",
841
  "sha256:edad25522ad509e534400d6ab98cf1872d30c31bc5e947712bfd57def7af15bb"
842
  ],
843
- "markers": "python_full_version >= '3.7.0'",
844
  "version": "==8.0.0"
845
  },
846
  "pycparser": {
@@ -855,7 +871,7 @@
855
  "sha256:7fc49b00840608068b930f9269169c7c9f3198b8b4635c934ba6d887c4e54503",
856
  "sha256:907601c99f7510e16d27d7cb62bfa145216d166a2b5c9c50cfe2b65b032ebd2e"
857
  ],
858
- "markers": "python_full_version >= '3.7.0'",
859
  "version": "==0.7.1"
860
  },
861
  "pygments": {
@@ -906,7 +922,7 @@
906
  "sha256:f87cc2863ef33c709e237d4b5f4502a62a00fab450c9e020892e8e2ede5847f5",
907
  "sha256:fd8da6d0124efa2f67d86fa70c851022f87c98e205f0594e1fae044e7119a5a6"
908
  ],
909
- "markers": "python_full_version >= '3.7.0'",
910
  "version": "==0.18.1"
911
  },
912
  "python-dateutil": {
@@ -1012,7 +1028,7 @@
1012
  "sha256:4c586de507202505346f3e32d1363eb9ed6932f0c2f63184dea88983ff4971e2",
1013
  "sha256:d2bbd99c320a2532ac71ff6a3164867884357da3e3301f0240090c5d2fdac7ec"
1014
  ],
1015
- "markers": "python_full_version >= '3.6.3' and python_full_version < '4.0.0'",
1016
  "version": "==12.4.4"
1017
  },
1018
  "semver": {
@@ -1074,7 +1090,7 @@
1074
  "sha256:0d5f126fbfdb5887b25ae7d9d07b0d716b1cc0ccaacc71c1f3c14d228e065197",
1075
  "sha256:ab4eeedccfcc1e6134bfee86106af90852c69d602884ea3a1e8ca6d4486e9bfe"
1076
  ],
1077
- "markers": "python_full_version >= '3.7.0'",
1078
  "version": "==0.15.0"
1079
  },
1080
  "tinycss2": {
@@ -1153,7 +1169,7 @@
1153
  "sha256:1530d04badddc6a73d50b7ee34667d4b96914da352109117b4280cb56523a51b",
1154
  "sha256:74803a1baa59af70f023671d86d5c7a834c931186df26d50d362ee6a1ff021fd"
1155
  ],
1156
- "markers": "python_full_version >= '3.7.0'",
1157
  "version": "==5.2.2.post1"
1158
  },
1159
  "typing-extensions": {
@@ -1185,7 +1201,7 @@
1185
  "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14",
1186
  "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"
1187
  ],
1188
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_full_version < '4.0.0'",
1189
  "version": "==1.26.9"
1190
  },
1191
  "validators": {
@@ -1268,7 +1284,7 @@
1268
  "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
1269
  "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
1270
  ],
1271
- "markers": "python_full_version >= '3.7.0'",
1272
  "version": "==8.1.3"
1273
  },
1274
  "coverage": {
 
1
  {
2
  "_meta": {
3
  "hash": {
4
+ "sha256": "dd62beb31967a9cc4e0ebbf1f5ac1078db8868bb4cad3527adc3f9480d298529"
5
  },
6
  "pipfile-spec": 6,
7
  "requires": {
 
21
  "sha256:0c724848ae53410c13fa28be2b3b9a9dcb7b5caa1a70f7f217bd663bb419935a",
22
  "sha256:d87d9372e63b48cd96b2a6415f0cf9457f50162ab79dc7a31cd7e024dd840026"
23
  ],
24
+ "markers": "python_version >= '3.7'",
25
  "version": "==4.2.0"
26
  },
27
  "appnope": {
 
124
  "sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1",
125
  "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565"
126
  ],
127
+ "markers": "python_version >= '3.7'",
128
  "version": "==5.0.0"
129
  },
130
  "blinker": {
 
133
  ],
134
  "version": "==1.4"
135
  },
136
+ "branca": {
137
+ "hashes": [
138
+ "sha256:781ff32bf82979584b0004bd84c254cfccda26bc31b2f7333346d03fb7b97741",
139
+ "sha256:e6f2f7eba7dd368ceef8f63822b867f5e11d4d3abdd099a787db9ed2b7065ae1"
140
+ ],
141
+ "markers": "python_version >= '3.5'",
142
+ "version": "==0.5.0"
143
+ },
144
  "cachetools": {
145
  "hashes": [
146
  "sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757",
 
225
  "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
226
  "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
227
  ],
228
+ "markers": "python_version >= '3.7'",
229
  "version": "==8.1.3"
230
  },
231
  "commonmark": {
 
256
  "sha256:e3513399177dd37af4c1332df52da5da1d0c387e5927dc4c0709e26ee7302e8f",
257
  "sha256:eb1946efac0c0c3d411cea0b5ac772fbde744109fd9520fb0c5a51979faf05ad"
258
  ],
259
+ "markers": "python_version >= '3.7'",
260
  "version": "==1.6.0"
261
  },
262
  "decorator": {
 
297
  ],
298
  "version": "==2.15.3"
299
  },
300
+ "folium": {
301
+ "hashes": [
302
+ "sha256:e856ae1de0b322a719b01ceed64ea16f6f011bd28ed22e954a7f7884313da672",
303
+ "sha256:e91e57d8298f3ccf4cce3c5e065bea6eb17033e3c5432b8a22214009c266b2ab"
304
+ ],
305
+ "index": "pypi",
306
+ "version": "==0.12.1.post1"
307
+ },
308
  "gitdb": {
309
  "hashes": [
310
  "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd",
 
318
  "sha256:1c885ce809e8ba2d88a29befeb385fcea06338d3640712b59ca623c220bb5704",
319
  "sha256:5b68b000463593e05ff2b261acff0ff0972df8ab1b70d3cdbd41b546c8b8fc3d"
320
  ],
321
+ "markers": "python_version >= '3.7'",
322
  "version": "==3.1.27"
323
  },
324
  "idna": {
 
334
  "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700",
335
  "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec"
336
  ],
337
+ "markers": "python_version >= '3.7'",
338
  "version": "==4.11.4"
339
  },
340
  "importlib-resources": {
 
388
  "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852",
389
  "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"
390
  ],
391
+ "markers": "python_version >= '3.7'",
392
  "version": "==3.1.2"
393
  },
394
  "jsonpickle": {
 
404
  "sha256:1c92d2db1900b668201f1797887d66453ab1fbfea51df8e4b46236689c427baf",
405
  "sha256:9d6397ba4a6c0bf0300736057f649e3e12ecbc07d3e81a0dacb72de4e9801957"
406
  ],
407
+ "markers": "python_version >= '3.7'",
408
  "version": "==4.6.0"
409
  },
410
  "jupyter-client": {
 
412
  "sha256:05d4ff6a0ade25138c6bb0fbeac7ddc26b5fe835e7dd816b64b4a45b931bdc0b",
413
  "sha256:404abe552540aff3527e66e16beb114b6b4ff58479d51a301f4eb9701e4f52ef"
414
  ],
415
+ "markers": "python_version >= '3.7'",
416
  "version": "==7.3.1"
417
  },
418
  "jupyter-core": {
 
420
  "sha256:a6de44b16b7b31d7271130c71a6792c4040f077011961138afed5e5e73181aec",
421
  "sha256:e7f5212177af7ab34179690140f188aa9bf3d322d8155ed972cbded19f55b6f3"
422
  ],
423
+ "markers": "python_version >= '3.7'",
424
  "version": "==4.10.0"
425
  },
426
  "jupyterlab-pygments": {
 
428
  "sha256:2405800db07c9f770863bcf8049a529c3dd4d3e28536638bd7c1c01d2748309f",
429
  "sha256:7405d7fde60819d905a9fa8ce89e4cd830e318cdad22a0030f7a901da705585d"
430
  ],
431
+ "markers": "python_version >= '3.7'",
432
  "version": "==0.2.2"
433
  },
434
  "jupyterlab-widgets": {
 
482
  "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a",
483
  "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"
484
  ],
485
+ "markers": "python_version >= '3.7'",
486
  "version": "==2.1.1"
487
  },
488
  "matplotlib-inline": {
 
505
  "sha256:cdef7757cead1735d2c70cc66095b072dced8a1e6d1c7639ef90cd3e04a11f2e",
506
  "sha256:f251bba200a2b401a061dfd700a7a70b5772f664fb49d4a2d3e5536ec0e98c76"
507
  ],
508
+ "markers": "python_version >= '3.7'",
509
  "version": "==0.6.4"
510
  },
511
  "nbconvert": {
 
513
  "sha256:223e46e27abe8596b8aed54301fadbba433b7ffea8196a68fd7b1ff509eee99d",
514
  "sha256:c56dd0b8978a1811a5654f74c727ff16ca87dd5a43abd435a1c49b840fcd8360"
515
  ],
516
+ "markers": "python_version >= '3.7'",
517
  "version": "==6.5.0"
518
  },
519
  "nbformat": {
 
521
  "sha256:0d6072aaec95dddc39735c144ee8bbc6589c383fb462e4058abc855348152dad",
522
  "sha256:44ba5ca6acb80c5d5a500f1e5b83ede8cbe364d5a495c4c8cf60aaf1ba656501"
523
  ],
524
+ "markers": "python_version >= '3.7'",
525
  "version": "==5.4.0"
526
  },
527
  "nest-asyncio": {
 
545
  "sha256:709b1856a564fe53054796c80e17a67262071c86bfbdfa6b96aaa346113c555a",
546
  "sha256:b4a6baf2eba21ce67a0ca11a793d1781b06b8078f34d06c710742e55f3eee505"
547
  ],
548
+ "markers": "python_version >= '3.7'",
549
  "version": "==6.4.11"
550
  },
551
  "numpy": {
 
721
  "sha256:f3f6a6034140e9e17e9abc175fc7a266a6e63652028e157750bd98e804a8ed9a",
722
  "sha256:ffde4c6fabb52891d81606411cbfaf77756e3b561b566efd270b3ed3791fde4e"
723
  ],
724
+ "markers": "python_version >= '3.7'",
725
  "version": "==9.1.1"
726
  },
727
  "prometheus-client": {
 
767
  "sha256:e250a42f15bf9d5b09fe1b293bdba2801cd520a9f5ea2d7fb7536d4441811d20",
768
  "sha256:ff8d8fa42675249bb456f5db06c00de6c2f4c27a065955917b28c4f15978b9c3"
769
  ],
770
+ "markers": "python_version >= '3.7'",
771
  "version": "==3.20.1"
772
  },
773
  "psutil": {
 
856
  "sha256:ece333706a94c1221ced8b299042f85fd88b5db802d71be70024433ddf3aecab",
857
  "sha256:edad25522ad509e534400d6ab98cf1872d30c31bc5e947712bfd57def7af15bb"
858
  ],
859
+ "markers": "python_version >= '3.7'",
860
  "version": "==8.0.0"
861
  },
862
  "pycparser": {
 
871
  "sha256:7fc49b00840608068b930f9269169c7c9f3198b8b4635c934ba6d887c4e54503",
872
  "sha256:907601c99f7510e16d27d7cb62bfa145216d166a2b5c9c50cfe2b65b032ebd2e"
873
  ],
874
+ "markers": "python_version >= '3.7'",
875
  "version": "==0.7.1"
876
  },
877
  "pygments": {
 
922
  "sha256:f87cc2863ef33c709e237d4b5f4502a62a00fab450c9e020892e8e2ede5847f5",
923
  "sha256:fd8da6d0124efa2f67d86fa70c851022f87c98e205f0594e1fae044e7119a5a6"
924
  ],
925
+ "markers": "python_version >= '3.7'",
926
  "version": "==0.18.1"
927
  },
928
  "python-dateutil": {
 
1028
  "sha256:4c586de507202505346f3e32d1363eb9ed6932f0c2f63184dea88983ff4971e2",
1029
  "sha256:d2bbd99c320a2532ac71ff6a3164867884357da3e3301f0240090c5d2fdac7ec"
1030
  ],
1031
+ "markers": "python_version < '4' and python_full_version >= '3.6.3'",
1032
  "version": "==12.4.4"
1033
  },
1034
  "semver": {
 
1090
  "sha256:0d5f126fbfdb5887b25ae7d9d07b0d716b1cc0ccaacc71c1f3c14d228e065197",
1091
  "sha256:ab4eeedccfcc1e6134bfee86106af90852c69d602884ea3a1e8ca6d4486e9bfe"
1092
  ],
1093
+ "markers": "python_version >= '3.7'",
1094
  "version": "==0.15.0"
1095
  },
1096
  "tinycss2": {
 
1169
  "sha256:1530d04badddc6a73d50b7ee34667d4b96914da352109117b4280cb56523a51b",
1170
  "sha256:74803a1baa59af70f023671d86d5c7a834c931186df26d50d362ee6a1ff021fd"
1171
  ],
1172
+ "markers": "python_version >= '3.7'",
1173
  "version": "==5.2.2.post1"
1174
  },
1175
  "typing-extensions": {
 
1201
  "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14",
1202
  "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"
1203
  ],
1204
+ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
1205
  "version": "==1.26.9"
1206
  },
1207
  "validators": {
 
1284
  "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e",
1285
  "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"
1286
  ],
1287
+ "markers": "python_version >= '3.7'",
1288
  "version": "==8.1.3"
1289
  },
1290
  "coverage": {
app.py CHANGED
@@ -17,42 +17,48 @@ st.markdown(
17
  owner = st.text_input("Enter GitHub username", value="cyyeh")
18
  repo = st.text_input("Enter GitHib repo name", value="py-code-analyzer")
19
  path = st.text_input(
20
- "Enter target directory path, if the value is empty, then the target directory will be the root directory",
21
  value="py_code_analyzer",
22
  )
 
 
 
 
 
23
 
24
 
25
- @st.cache
26
- def get_python_files(owner, repo, path):
27
- return CodeFetcher().get_python_files(owner, repo, path)
28
 
29
 
30
- @st.cache(allow_output_mutation=True)
31
  def generate_imports_graph(python_files):
32
  return CodeImportsAnalyzer(python_files).analyze().generate_imports_graph()
33
 
34
 
35
- @st.cache
36
  def generate_graph_visualization_file(imports_graph):
37
  ImportsGraphVisualizer().visualize(imports_graph)
38
 
39
 
40
- @st.cache
41
  def read_graph_visualization_file():
42
  return open("nx.html", "r", encoding="utf-8").read()
43
 
44
 
45
- if owner and repo:
46
- with st.spinner("Please wait..."):
47
- generate_graph_visualization_file(
48
- generate_imports_graph(get_python_files(owner, repo, path))
49
- )
50
- graph_visualization_file = read_graph_visualization_file()
51
 
52
- st.download_button(
53
- "Download the result file",
54
- graph_visualization_file,
55
- file_name="result.html",
56
- mime="text/html",
57
- )
58
- components.html(graph_visualization_file, height=800, scrolling=True)
 
 
 
 
 
 
17
  owner = st.text_input("Enter GitHub username", value="cyyeh")
18
  repo = st.text_input("Enter GitHib repo name", value="py-code-analyzer")
19
  path = st.text_input(
20
+ "Enter target directory path. Default: the target directory will be the root directory",
21
  value="py_code_analyzer",
22
  )
23
+ ref = st.text_input(
24
+ "Enter the name of the commit/branch/tag. Default: the repository's default branch",
25
+ )
26
+ clicked_ok_button = st.button("OK")
27
+ st.markdown("---")
28
 
29
 
30
+ def get_python_files(owner, repo, path, ref=""):
31
+ return CodeFetcher().get_python_files(owner, repo, path, ref=ref)
 
32
 
33
 
 
34
  def generate_imports_graph(python_files):
35
  return CodeImportsAnalyzer(python_files).analyze().generate_imports_graph()
36
 
37
 
 
38
  def generate_graph_visualization_file(imports_graph):
39
  ImportsGraphVisualizer().visualize(imports_graph)
40
 
41
 
 
42
  def read_graph_visualization_file():
43
  return open("nx.html", "r", encoding="utf-8").read()
44
 
45
 
46
+ if clicked_ok_button and owner and repo:
47
+ with st.spinner("Getting python files..."):
48
+ python_files = get_python_files(owner, repo, path, ref=ref)
49
+
50
+ with st.spinner("Generating imports graph..."):
51
+ imports_graph = generate_imports_graph(python_files)
52
 
53
+ with st.spinner("Generating graph visualization file..."):
54
+ generate_graph_visualization_file(imports_graph)
55
+
56
+ with st.spinner("Showing the graph..."):
57
+ graph_visualization_file = read_graph_visualization_file()
58
+ st.download_button(
59
+ "Download the result file",
60
+ graph_visualization_file,
61
+ file_name="result.html",
62
+ mime="text/html",
63
+ )
64
+ components.html(graph_visualization_file, height=600, scrolling=True)
py_code_analyzer/code_fetcher.py CHANGED
@@ -7,7 +7,7 @@ import requests
7
 
8
  # to increase api rate limiting
9
  # https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
10
- USER = os.environ.get("PERSONAL_ACCESS_TOKEN", "")
11
  PERSONAL_ACCESS_TOKEN = os.environ.get("PERSONAL_ACCESS_TOKEN", "")
12
 
13
 
@@ -32,18 +32,21 @@ class CodeFetcher:
32
  api_url += f"?ref={ref}"
33
 
34
  python_files = []
35
- api_results = requests.get(api_url).json()
 
 
36
 
37
  for result in api_results:
38
- if result["type"] == "file" and result["name"].endswith(".py"):
39
- python_files.append(result)
40
- elif (
41
- recursive
42
- and result["type"] == "dir"
43
- and not result["name"].startswith(".")
44
- ):
45
- python_files += cls.get_python_files(
46
- owner, repo, path=result["path"], recursive=recursive
47
- )
 
48
 
49
  return python_files
 
7
 
8
  # to increase api rate limiting
9
  # https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
10
+ USER = os.environ.get("USER", "")
11
  PERSONAL_ACCESS_TOKEN = os.environ.get("PERSONAL_ACCESS_TOKEN", "")
12
 
13
 
 
32
  api_url += f"?ref={ref}"
33
 
34
  python_files = []
35
+ api_results = requests.get(
36
+ api_url, headers={"Accept": "application/vnd.github.v3+json"}
37
+ ).json()
38
 
39
  for result in api_results:
40
+ if type(result) is dict:
41
+ if result["type"] == "file" and result["name"].endswith(".py"):
42
+ python_files.append(result)
43
+ elif (
44
+ recursive
45
+ and result["type"] == "dir"
46
+ and not result["name"].startswith(".")
47
+ ):
48
+ python_files += cls.get_python_files(
49
+ owner, repo, path=result["path"], recursive=recursive
50
+ )
51
 
52
  return python_files
py_code_analyzer/imports_graph_visualizer.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import networkx as nx
2
 
3
  from pyvis import Network
 
1
+ """This file generates a pyvis graph locally given a networkx graph
2
+ """
3
  import networkx as nx
4
 
5
  from pyvis import Network
pyvis/pyvis/templates/template.html CHANGED
@@ -346,6 +346,7 @@
346
  nodeColors = {};
347
  allNodes = nodes.get({ returnType: "Object" });
348
  for (var nodeId in allNodes) {
 
349
  nodeColors[nodeId] = allNodes[nodeId].color;
350
  }
351
 
 
346
  nodeColors = {};
347
  allNodes = nodes.get({ returnType: "Object" });
348
  for (var nodeId in allNodes) {
349
+ console.log(allNodes[nodeId].color);
350
  nodeColors[nodeId] = allNodes[nodeId].color;
351
  }
352