Просмотр исходного кода

update annexI downloader to new URL for 2023 submissions

Johannes Gütschow 1 год назад
Родитель
Сommit
98052a3160
1 измененных файлов с 15 добавлено и 9 удалено
  1. 15 9
      code/UNFCCC_downloader/fetch_submissions_annexI.py

+ 15 - 9
code/UNFCCC_downloader/fetch_submissions_annexI.py

@@ -28,13 +28,6 @@ year = args.year
 
 print("Fetching submissions for {}".format(year))
 
-url = (
-    "https://unfccc.int/process/transparency-and-reporting/"
-    "reporting-and-review-under-the-convention/"
-    "greenhouse-gas-inventories-annex-i-parties/"
-    "submissions/national-inventory-submissions-{}".format(year)
-)
-
 if int(year) == 2019:
     url = (
         "https://unfccc.int/process-and-meetings/transparency-and-reporting/"
@@ -42,11 +35,24 @@ if int(year) == 2019:
         "greenhouse-gas-inventories-annex-i-parties/"
         "national-inventory-submissions-{}".format(year)
     )
-
-if int(year) >= 2020:
+elif int(year) in range(2020,2023):
     url = (
         "https://unfccc.int/ghg-inventories-annex-i-parties/{}".format(year)
     )
+elif int(year) >= 2023:
+    url = (
+        "https://unfccc.int/process/transparency-and-reporting/"
+        "reporting-and-review-under-the-convention/"
+        "greenhouse-gas-inventories-annex-i-parties/"
+        "national-inventory-submissions-{}".format(year)
+    )
+else:
+    url = (
+        "https://unfccc.int/process/transparency-and-reporting/"
+        "reporting-and-review-under-the-convention/"
+        "greenhouse-gas-inventories-annex-i-parties/"
+        "submissions/national-inventory-submissions-{}".format(year)
+    )
 
 print(f"Using {url} to get submissions list")