ソースを参照

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,4 +1,4 @@
1
-index,Date,Name,Agency/Position,Location,Description/Cause,Ref.
1
+Index,Date,Name,Agency/Position,Location,Description/Cause,Ref.
2 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 3
 2,"October 7, 2023",Mohammad Jarghoun [Wikidata],Smart Media,"Gaza–Israel border, east of Rafah",Shot by Israeli forces.,[1][2]
4 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,7 +18,7 @@ labels = [th.get_text().strip() for th in rows[0].find_all("th")]
18 18
 
19 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 23
 index = 0
24 24
 
@@ -42,4 +42,4 @@ for row in rows[1:]:
42 42
                 d["count"] = cell["rowspan"] - 1
43 43
                 d["value"] = cell["value"]
44 44
     index += 1
45
-    sheet.writerow([index] + res)
45
+    sheet.writerow([index] + res)

+ 2
- 2
makecsv.sh ファイルの表示

@@ -1,5 +1,5 @@
1 1
 #!/bin/sh
2 2
 cd "$(dirname "$0")"
3 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

読み込み中…
キャンセル
保存