瀏覽代碼

Uppercase Index label

master
The Dod 3 天之前
父節點
當前提交
50e0444814
共有 3 個檔案被更改,包括 5 行新增5 行删除
  1. 1
    1
      journalists.csv
  2. 2
    2
      journalists2csv.py
  3. 2
    2
      makecsv.sh

+ 1
- 1
journalists.csv 查看文件

1
-index,Date,Name,Agency/Position,Location,Description/Cause,Ref.
1
+Index,Date,Name,Agency/Position,Location,Description/Cause,Ref.
2
 1,"October 7, 2023",Mohammad Al-Salhi,Fourth Authority news agency (photojounalist),"Gaza–Israel border, east of Al-Bureij",Shot by Israeli forces.,[1][2][3]
2
 1,"October 7, 2023",Mohammad Al-Salhi,Fourth Authority news agency (photojounalist),"Gaza–Israel border, east of Al-Bureij",Shot by Israeli forces.,[1][2][3]
3
 2,"October 7, 2023",Mohammad Jarghoun [Wikidata],Smart Media,"Gaza–Israel border, east of Rafah",Shot by Israeli forces.,[1][2]
3
 2,"October 7, 2023",Mohammad Jarghoun [Wikidata],Smart Media,"Gaza–Israel border, east of Rafah",Shot by Israeli forces.,[1][2]
4
 3,"October 7, 2023",Ibrahim Mohammad Lafi [Wikidata],Ain Media [Wikidata] (Photographer),Erez Crossing,Shot by Israeli forces.,[1]
4
 3,"October 7, 2023",Ibrahim Mohammad Lafi [Wikidata],Ain Media [Wikidata] (Photographer),Erez Crossing,Shot by Israeli forces.,[1]

+ 2
- 2
journalists2csv.py 查看文件

18
 
18
 
19
 dups = [{"value": "", "count": 0} for not_used in labels]
19
 dups = [{"value": "", "count": 0} for not_used in labels]
20
 
20
 
21
-sheet.writerow(["index"] + labels)
21
+sheet.writerow(["Index"] + labels)
22
 
22
 
23
 index = 0
23
 index = 0
24
 
24
 
42
                 d["count"] = cell["rowspan"] - 1
42
                 d["count"] = cell["rowspan"] - 1
43
                 d["value"] = cell["value"]
43
                 d["value"] = cell["value"]
44
     index += 1
44
     index += 1
45
-    sheet.writerow([index] + res)
45
+    sheet.writerow([index] + res)

+ 2
- 2
makecsv.sh 查看文件

1
 #!/bin/sh
1
 #!/bin/sh
2
 cd "$(dirname "$0")"
2
 cd "$(dirname "$0")"
3
 curl https://en.wikipedia.org/wiki/List_of_journalists_killed_in_the_Gaza_war > journalists.html
3
 curl https://en.wikipedia.org/wiki/List_of_journalists_killed_in_the_Gaza_war > journalists.html
4
-source venv/bin/activate
5
-python journalists2csv.py < journalists.html > journalists.csv
4
+. venv/bin/activate
5
+python journalists2csv.py < journalists.html > journalists.csv

Loading…
取消
儲存