From 4208a82067f3dd4a216bad164d164625df09fb8c Mon Sep 17 00:00:00 2001 From: Friedrich Lindenberg Date: Sat, 5 Oct 2024 13:45:56 +0200 Subject: [PATCH] Clean up Sark country code, add UN, remove some non-countries --- followthemoney/types/country.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/followthemoney/types/country.py b/followthemoney/types/country.py index 18f3f92be..c04c1643c 100644 --- a/followthemoney/types/country.py +++ b/followthemoney/types/country.py @@ -28,6 +28,7 @@ def _locale_names(self, locale: Locale) -> EnumValues: names = { "zz": gettext("Global"), "eu": gettext("European Union"), + "un": gettext("United Nations"), "zr": gettext("Zaire"), # Overwrite "Czechia" label: "cz": gettext("Czech Republic"), @@ -46,7 +47,7 @@ def _locale_names(self, locale: Locale) -> EnumValues: "cy-trnc": gettext("Northern Cyprus"), "az-nk": gettext("Nagorno-Karabakh"), "cn-xz": gettext("Tibet"), - "gg-srk": gettext("Sark"), + "cq": gettext("Sark"), "gb-wls": gettext("Wales"), "gb-sct": gettext("Scotland"), "gb-nir": gettext("Northern Ireland"), @@ -61,6 +62,12 @@ def _locale_names(self, locale: Locale) -> EnumValues: int(code) except ValueError: names[code] = label + # Remove some ISO-3611 codes that are not countries: + names.pop("xa", None) + names.pop("xb", None) + names.pop("qo", None) + names.pop("ea", None) + names.pop("ez", None) return names def clean_text(