countries-dictionary 9.0.0.dev1__tar.gz → 9.0.0.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/PKG-INFO +2 -2
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/README.md +1 -1
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/pyproject.toml +1 -1
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/__init__.py +1 -0
- countries_dictionary-9.0.0.dev3/src/countries_dictionary/themed/__init__.py +2 -0
- countries_dictionary-9.0.0.dev3/src/countries_dictionary/themed/european_union.py +110 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/tools/quick_functions.py +9 -5
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary.egg-info/PKG-INFO +2 -2
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary.egg-info/SOURCES.txt +2 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/LICENCE +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/setup.cfg +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/countries.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/russia.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/themed/communist_states.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/tools/iso_finder.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/united_states.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/unrecognised_states/__init__.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/unrecognised_states/transnistria.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/unrecognised_states/unrecognised.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary/vietnam.py +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary.egg-info/dependency_links.txt +0 -0
- {countries_dictionary-9.0.0.dev1 → countries_dictionary-9.0.0.dev3}/src/countries_dictionary.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: countries_dictionary
|
|
3
|
-
Version: 9.0.0.
|
|
3
|
+
Version: 9.0.0.dev3
|
|
4
4
|
Summary: Provides dictionaries contains countries and unrecognised states and information about them
|
|
5
5
|
Author-email: Ngô Trần Quang Thiện <quangthienngotran@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -685,7 +685,7 @@ Description-Content-Type: text/markdown
|
|
|
685
685
|
License-File: LICENCE
|
|
686
686
|
Dynamic: license-file
|
|
687
687
|
|
|
688
|
-
<div align="center"><img src="
|
|
688
|
+
<div align="center"><img src="https://raw.githubusercontent.com/ThienFakeVN/thienfakevn.github.io/refs/heads/main/assets/countries_dictionary_logo_web.png"></div>
|
|
689
689
|
|
|
690
690
|
Countries Dictionary is a data-oriented module which provides dictionaries of countries and states, from members of UN to unrecognised ones.
|
|
691
691
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div align="center"><img src="
|
|
1
|
+
<div align="center"><img src="https://raw.githubusercontent.com/ThienFakeVN/thienfakevn.github.io/refs/heads/main/assets/countries_dictionary_logo_web.png"></div>
|
|
2
2
|
|
|
3
3
|
Countries Dictionary is a data-oriented module which provides dictionaries of countries and states, from members of UN to unrecognised ones.
|
|
4
4
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "countries_dictionary"
|
|
7
|
-
version = "9.0.0.
|
|
7
|
+
version = "9.0.0.dev3"
|
|
8
8
|
description = "Provides dictionaries contains countries and unrecognised states and information about them"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.7"
|
|
@@ -9,6 +9,7 @@ from .unrecognised_states import UNRECOGNISED_STATES
|
|
|
9
9
|
from .unrecognised_states.transnistria import TRANSNISTRIA
|
|
10
10
|
|
|
11
11
|
from .themed.communist_states import COMMUNIST_STATES
|
|
12
|
+
from .themed.european_union import EUROPEAN_UNION
|
|
12
13
|
|
|
13
14
|
from .tools.quick_functions import quick_function, json_dictionary, sort_dictionary
|
|
14
15
|
from .tools.iso_finder import iso_finder, iso_ru_finder, iso_us_finder, iso_vn_finder
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
EUROPEAN_UNION = {
|
|
2
|
+
"Austria": {
|
|
3
|
+
"date of accession": "1995.01.01",
|
|
4
|
+
"eurozone": True
|
|
5
|
+
},
|
|
6
|
+
"Belgium": {
|
|
7
|
+
"date of accession": "1958.01.01",
|
|
8
|
+
"eurozone": True
|
|
9
|
+
},
|
|
10
|
+
"Bulgaria": {
|
|
11
|
+
"date of accession": "2007.01.01",
|
|
12
|
+
"eurozone": True
|
|
13
|
+
},
|
|
14
|
+
"Croatia": {
|
|
15
|
+
"date of accession": "2013.07.01",
|
|
16
|
+
"eurozone": True
|
|
17
|
+
},
|
|
18
|
+
"Cyprus": {
|
|
19
|
+
"date of accession": "2004.05.01",
|
|
20
|
+
"eurozone": True
|
|
21
|
+
},
|
|
22
|
+
"Czechia": {
|
|
23
|
+
"date of accession": "2004.05.01",
|
|
24
|
+
"eurozone": False
|
|
25
|
+
},
|
|
26
|
+
"Denmark": {
|
|
27
|
+
"date of accession": "1973.01.01",
|
|
28
|
+
"eurozone": False
|
|
29
|
+
},
|
|
30
|
+
"Estonia": {
|
|
31
|
+
"date of accession": "2004.05.01",
|
|
32
|
+
"eurozone": True
|
|
33
|
+
},
|
|
34
|
+
"Finland": {
|
|
35
|
+
"date of accession": "1995.01.01",
|
|
36
|
+
"eurozone": True
|
|
37
|
+
},
|
|
38
|
+
"France": {
|
|
39
|
+
"date of accession": "1958.01.01",
|
|
40
|
+
"eurozone": True
|
|
41
|
+
},
|
|
42
|
+
"Germany": {
|
|
43
|
+
"date of accession": "1958.01.01",
|
|
44
|
+
"eurozone": True
|
|
45
|
+
},
|
|
46
|
+
"Greece": {
|
|
47
|
+
"date of accession": "1981.01.01",
|
|
48
|
+
"eurozone": True
|
|
49
|
+
},
|
|
50
|
+
"Hungary": {
|
|
51
|
+
"date of accession": "2004.05.01",
|
|
52
|
+
"eurozone": False
|
|
53
|
+
},
|
|
54
|
+
"Ireland": {
|
|
55
|
+
"date of accession": "1973.01.01",
|
|
56
|
+
"eurozone": True
|
|
57
|
+
},
|
|
58
|
+
"Italy": {
|
|
59
|
+
"date of accession": "1958.01.01",
|
|
60
|
+
"eurozone": True
|
|
61
|
+
},
|
|
62
|
+
"Latvia": {
|
|
63
|
+
"date of accession": "2004.05.01",
|
|
64
|
+
"eurozone": True
|
|
65
|
+
},
|
|
66
|
+
"Lithuania": {
|
|
67
|
+
"date of accession": "2004.05.01",
|
|
68
|
+
"eurozone": True
|
|
69
|
+
},
|
|
70
|
+
"Luxembourg": {
|
|
71
|
+
"date of accession": "1958.01.01",
|
|
72
|
+
"eurozone": True
|
|
73
|
+
},
|
|
74
|
+
"Malta": {
|
|
75
|
+
"date of accession": "2004.05.01",
|
|
76
|
+
"eurozone": True
|
|
77
|
+
},
|
|
78
|
+
"Netherlands": {
|
|
79
|
+
"date of accession": "1958.01.01",
|
|
80
|
+
"eurozone": True
|
|
81
|
+
},
|
|
82
|
+
"Poland": {
|
|
83
|
+
"date of accession": "2004.05.01",
|
|
84
|
+
"eurozone": False
|
|
85
|
+
},
|
|
86
|
+
"Portugal": {
|
|
87
|
+
"date of accession": "1986.01.01",
|
|
88
|
+
"eurozone": True
|
|
89
|
+
},
|
|
90
|
+
"Romania": {
|
|
91
|
+
"date of accession": "2007.01.01",
|
|
92
|
+
"eurozone": False
|
|
93
|
+
},
|
|
94
|
+
"Slovakia": {
|
|
95
|
+
"date of accession": "2004.05.01",
|
|
96
|
+
"eurozone": True
|
|
97
|
+
},
|
|
98
|
+
"Slovenia": {
|
|
99
|
+
"date of accession": "2004.05.01",
|
|
100
|
+
"eurozone": True
|
|
101
|
+
},
|
|
102
|
+
"Spain": {
|
|
103
|
+
"date of accession": "1986.01.01",
|
|
104
|
+
"eurozone": True
|
|
105
|
+
},
|
|
106
|
+
"Sweden": {
|
|
107
|
+
"date of accession": "1995.01.01",
|
|
108
|
+
"eurozone": False
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
from countries_dictionary import COUNTRIES, RUSSIA, UNITED_STATES, VIETNAM, UNRECOGNISED_STATES, TRANSNISTRIA
|
|
1
|
+
from countries_dictionary import COUNTRIES, RUSSIA, UNITED_STATES, VIETNAM, UNRECOGNISED_STATES, TRANSNISTRIA, COMMUNIST_STATES, EUROPEAN_UNION
|
|
2
2
|
|
|
3
3
|
from json import dumps
|
|
4
4
|
from copy import deepcopy
|
|
5
5
|
|
|
6
6
|
def quick_function(dictionary: str = "countries", addition: str = ""):
|
|
7
7
|
"""Returns one of the dictionaries depends on the `dictionary` parameter and modify it depends on the `addition` parameter."""
|
|
8
|
+
themed = ("communist_states", "communist_state", "communist states", "communist state", "communist", "eu", "europe", "european_union", "european union")
|
|
8
9
|
match dictionary.casefold():
|
|
9
10
|
case "countries": thanhbinh = deepcopy(COUNTRIES)
|
|
10
11
|
case "russia": thanhbinh = deepcopy(RUSSIA)
|
|
11
12
|
case "united states" | "america": thanhbinh = deepcopy(UNITED_STATES)
|
|
12
13
|
case "vietnam": thanhbinh = deepcopy(VIETNAM)
|
|
13
|
-
case "unrecognised_states" | "unrecognized_states" | "unrecognised" | "unrecognized": thanhbinh = deepcopy(UNRECOGNISED_STATES)
|
|
14
|
+
case "unrecognised_states" | "unrecognized_states" | "unrecognised states" | "unrecognized states" | "unrecognised" | "unrecognized": thanhbinh = deepcopy(UNRECOGNISED_STATES)
|
|
14
15
|
case "transnistria" | "pridnestrovie": thanhbinh = deepcopy(TRANSNISTRIA)
|
|
16
|
+
case "communist_states" | "communist_state" | "communist states" | "communist state" | "communist": thanhbinh = deepcopy(COMMUNIST_STATES)
|
|
17
|
+
case "eu" | "europe" | "european_union" | "european union": thanhbinh = deepcopy(EUROPEAN_UNION)
|
|
15
18
|
case _: raise Exception("This dictionary does not exist (yet)")
|
|
16
19
|
match addition.casefold():
|
|
17
|
-
case "population density":
|
|
20
|
+
case "population density" if dictionary.casefold() not in themed:
|
|
18
21
|
if dictionary.casefold() in ("countries", "unrecognised_states", "unrecognized_states", "unrecognised", "unrecognized"):
|
|
19
22
|
for x in thanhbinh: thanhbinh[x]["population density"] = thanhbinh[x]["population"] / thanhbinh[x]["land area"]
|
|
20
23
|
else:
|
|
21
24
|
for x in thanhbinh: thanhbinh[x]["population density"] = thanhbinh[x]["population"] / thanhbinh[x]["area"]
|
|
22
|
-
case "gdp per capita":
|
|
25
|
+
case "gdp per capita" if dictionary.casefold() not in themed:
|
|
23
26
|
if dictionary.casefold() in ("countries", "unrecognised_states", "unrecognized_states", "unrecognised", "unrecognized"):
|
|
24
27
|
for x in thanhbinh: thanhbinh[x]["GDP per capita"] = thanhbinh[x]["nominal GDP"] / thanhbinh[x]["population"]
|
|
25
28
|
else: raise Exception("Only works with the Countries and Unrecognised states dictionary")
|
|
26
|
-
case "iso 3166-2":
|
|
29
|
+
case "iso 3166-2" if dictionary.casefold() not in themed:
|
|
27
30
|
if dictionary.casefold() == "countries":
|
|
28
31
|
for x in thanhbinh: thanhbinh[x]["ISO 3166-2"] = "ISO 3166-2:" + thanhbinh[x]["ISO 3166-1"]["alpha-2"]
|
|
29
32
|
else: raise Exception("Only works with the Countries dictionary")
|
|
33
|
+
case _ if dictionary.casefold() in themed: raise Exception("You can not modify a themed dictionary.")
|
|
30
34
|
return thanhbinh
|
|
31
35
|
|
|
32
36
|
def json_dictionary(dictionary: str = "countries", addition: str = "", indent: int | str | None = None):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: countries_dictionary
|
|
3
|
-
Version: 9.0.0.
|
|
3
|
+
Version: 9.0.0.dev3
|
|
4
4
|
Summary: Provides dictionaries contains countries and unrecognised states and information about them
|
|
5
5
|
Author-email: Ngô Trần Quang Thiện <quangthienngotran@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -685,7 +685,7 @@ Description-Content-Type: text/markdown
|
|
|
685
685
|
License-File: LICENCE
|
|
686
686
|
Dynamic: license-file
|
|
687
687
|
|
|
688
|
-
<div align="center"><img src="
|
|
688
|
+
<div align="center"><img src="https://raw.githubusercontent.com/ThienFakeVN/thienfakevn.github.io/refs/heads/main/assets/countries_dictionary_logo_web.png"></div>
|
|
689
689
|
|
|
690
690
|
Countries Dictionary is a data-oriented module which provides dictionaries of countries and states, from members of UN to unrecognised ones.
|
|
691
691
|
|
|
@@ -10,7 +10,9 @@ src/countries_dictionary.egg-info/PKG-INFO
|
|
|
10
10
|
src/countries_dictionary.egg-info/SOURCES.txt
|
|
11
11
|
src/countries_dictionary.egg-info/dependency_links.txt
|
|
12
12
|
src/countries_dictionary.egg-info/top_level.txt
|
|
13
|
+
src/countries_dictionary/themed/__init__.py
|
|
13
14
|
src/countries_dictionary/themed/communist_states.py
|
|
15
|
+
src/countries_dictionary/themed/european_union.py
|
|
14
16
|
src/countries_dictionary/tools/iso_finder.py
|
|
15
17
|
src/countries_dictionary/tools/quick_functions.py
|
|
16
18
|
src/countries_dictionary/unrecognised_states/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|