countries-dictionary 3.0.3__py3-none-any.whl → 3.1.0__py3-none-any.whl

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.

Potentially problematic release.


This version of countries-dictionary might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: countries_dictionary
3
- Version: 3.0.3
3
+ Version: 3.1.0
4
4
  Summary: Provides a dictionary contains all members and observer states of the United Nations and information about them
5
5
  Author-email: Ngô Trần Quang Thiện <quangthienngotran@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -716,8 +716,163 @@ Countries Dictionary provides:
716
716
  - Postal code
717
717
  - Some functions which you might find helpful
718
718
 
719
- Before using, it is recommended to see the code on [GitHub](https://github.com/ThienFakeVN/countries_dictionary/) to understand how it works
720
-
721
719
  I created this module as an offline source of countries' information which is easy to access and use by coders.
722
720
 
723
721
  See [CHANGELOG.md](https://github.com/ThienFakeVN/countries_dictionary/blob/main/CHANGELOG.md) for changes of releases.
722
+
723
+ Before using, it is recommended to see the code on [GitHub](https://github.com/ThienFakeVN/countries_dictionary/) or the below section to understand how the module works and how you can use it
724
+
725
+ ## Codes
726
+ ### Main Countries Dictionary
727
+ #### Structure
728
+ The Countries Dictionary has a structure like this:
729
+ ```python
730
+ COUNTRIES = {
731
+ "Afghanistan": {
732
+ "formal name": "Islamic Emirate of Afghanistan",
733
+ "continents": ["Asia"],
734
+ "area": 652864.0,
735
+ "land area": 652230.0,
736
+ "population": 42045000,
737
+ "official languages": ["Dari", "Pashto"],
738
+ "nominal GDP": 16417000000,
739
+ "HDI": 0.496,
740
+ "ISO 3166-1": {"alpha-2": "AF", "alpha-3": "AFG", "numeric": "004"},
741
+ },
742
+ # ...
743
+ }
744
+ ```
745
+
746
+ #### Usage example
747
+ ```python
748
+ from countries_dictionary import COUNTRIES # Remember to import the module!
749
+
750
+ # Prints the formal name of the country
751
+ print(COUNTRIES["Vietnam"]["formal name"])
752
+
753
+ # Compares the population of two countries
754
+ print(COUNTRIES["North Korea"]["population"] > COUNTRIES["South Korea"]["population"])
755
+ print(COUNTRIES["North Korea"]["population"] == COUNTRIES["South Korea"]["population"])
756
+ print(COUNTRIES["North Korea"]["population"] < COUNTRIES["South Korea"]["population"])
757
+
758
+ # Creates the list of all countries
759
+ list_of_countries = list(COUNTRIES.keys())
760
+ print(list_of_countries)
761
+ ```
762
+
763
+ ### Russia dictionary
764
+ #### Structure
765
+ The Russia dictionary has a structure like this:
766
+ ```python
767
+ RUSSIA = {
768
+ "Adygea": {
769
+ "federal district": "Southern",
770
+ "economic region": "North Caucasus",
771
+ "capital/administrative centre": "Maykop",
772
+ "area": 7792.0,
773
+ "population": 501038},
774
+ # ...
775
+ }
776
+ ```
777
+
778
+ #### Usage example
779
+ ```python
780
+ from countries_dictionary.russia import RUSSIA # Remember to import the module
781
+
782
+ # Prints the administrative centre of a krai
783
+ print(RUSSIA["Primorsky Krai"]["capital/administrative centre"])
784
+
785
+ # Sees if the two federal subjects are in the same federal district
786
+ print(RUSSIA["Tuva"]["federal district"] == RUSSIA["Altai Republic"]["federal district"])
787
+
788
+ # Creates the list of all federal subjects
789
+ list_of_federal_subjects = list(RUSSIA.keys())
790
+ print(list_of_federal_subjects)
791
+ ```
792
+
793
+ ### United States dictionary
794
+ #### Structure
795
+ The United States dictionary has a structure like this:
796
+ ```python
797
+ UNITED_STATES = {
798
+ "Alabama": {
799
+ "capital": "Montgomery",
800
+ "date of ratification/establishment/acquiring": "1819.12.14",
801
+ "area": 135767.0,
802
+ "population": 5024279,
803
+ "House Representatives": 7,
804
+ "postal code": "AL",
805
+ }
806
+ # ...
807
+ }
808
+ ```
809
+
810
+ #### Usage example
811
+ ```python
812
+ from countries_dictionary.united_states import UNITED_STATES # Remember to import the module...
813
+
814
+ # Prints the postal code of a state
815
+ print(UNITED_STATES["Ohio"]["postal code"])
816
+
817
+ # Compares the numbers of House Representatives of two states
818
+ print(UNITED_STATES["Oklahoma"]["House Representatives"] > UNITED_STATES["Connecticut"]["House Representatives"])
819
+ print(UNITED_STATES["Oklahoma"]["House Representatives"] == UNITED_STATES["Connecticut"]["House Representatives"])
820
+ print(UNITED_STATES["Oklahoma"]["House Representatives"] < UNITED_STATES["Connecticut"]["House Representatives"])
821
+
822
+ # Creates the list of all states
823
+ list_of_states = list(UNITED_STATES.keys())
824
+ print(list_of_states)
825
+ ```
826
+
827
+ ### Vietnam dictionary
828
+ #### Structure
829
+ The Vietnam dictionary has a structure like this:
830
+ ```python
831
+ VIETNAM = {
832
+ "Hanoi": {
833
+ "region": "Red River Delta",
834
+ "administrative centre": "Hoàn Kiếm ward",
835
+ "area": 3359.84,
836
+ "population": 8807523},
837
+ # ...
838
+ }
839
+ ```
840
+
841
+ #### Usage example
842
+ ```python
843
+ from countries_dictionary.vietnam import VIETNAM # Of course...
844
+
845
+ # Prints the population of a province
846
+ print(VIETNAM["Ho Chi Minh City"]["population"])
847
+
848
+ # Sees if the two provinces are in the same region
849
+ print(VIETNAM["Nghệ An province"]["region"] == VIETNAM["Hà Tĩnh province"]["region"])
850
+
851
+ # Creates the list of all provinces
852
+ list_of_provinces = list(VIETNAM.keys())
853
+ print(list_of_provinces)
854
+ ```
855
+
856
+ ### Quick functions
857
+ There are many functions in this submodule.
858
+ ```python
859
+ import countries_dictionary.quick_functions as qf # What have you expected?
860
+
861
+ # Converts the dictionary into JSON and creates/overwrites a JSON file which contains the converted dictionary
862
+ with open("countries_dictionary.json", "w") as f:
863
+ f.write(qf.json_dictionary(indent=4))
864
+
865
+ # Prints a ISO 3166-2 code of a country
866
+ iso = qf.countries_iso_3166_2()
867
+ print(iso["Russia"]["ISO 3166-2"])
868
+ ```
869
+
870
+ ### ISO finder
871
+ *ISO finder* is a module which provides a function which has the same name. *ISO finder* can find a country based on the provided ISO code. Note that it does not include US states' postal codes.
872
+ ```python
873
+ from countries_dictionary.iso_finder import iso_finder
874
+
875
+ print(iso_finder("VN"))
876
+ print(iso_finder("RUS"))
877
+ print(iso_finder("840"))
878
+ ```
@@ -4,8 +4,8 @@ countries_dictionary/quick_functions.py,sha256=Ok62u2R88NubIrMtNSiHHzZ29orx_GYdr
4
4
  countries_dictionary/russia.py,sha256=3tmknQM_51PHmsF6TI6arFdjwPhWBEPHPiKP7PzXBmI,20119
5
5
  countries_dictionary/united_states.py,sha256=WJs5OrMMXinLPJWzt42hHPt89OLUC4qgifDUB9OrvoQ,15035
6
6
  countries_dictionary/vietnam.py,sha256=zRdwasxzwMJNbkNInljXzEu2gA9TDEI5F8cIM4TmBtg,6446
7
- countries_dictionary-3.0.3.dist-info/licenses/LICENCE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
8
- countries_dictionary-3.0.3.dist-info/METADATA,sha256=SjxnZoCLkgMpWvRO6mPQVTlDGTDQau0nwas1RqnVzQY,43448
9
- countries_dictionary-3.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- countries_dictionary-3.0.3.dist-info/top_level.txt,sha256=7tkD6sfiOQ__y-Eb2rnPUU0Lbhr_wtFBNcRus-aU4Zw,21
11
- countries_dictionary-3.0.3.dist-info/RECORD,,
7
+ countries_dictionary-3.1.0.dist-info/licenses/LICENCE,sha256=gcuuhKKc5-dwvyvHsXjlC9oM6N5gZ6umYbC8ewW1Yvg,35821
8
+ countries_dictionary-3.1.0.dist-info/METADATA,sha256=D9tIPXzq9ssgGPHaRSW5Wzo893oQb_7Pe6i7AZJC83I,48288
9
+ countries_dictionary-3.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ countries_dictionary-3.1.0.dist-info/top_level.txt,sha256=7tkD6sfiOQ__y-Eb2rnPUU0Lbhr_wtFBNcRus-aU4Zw,21
11
+ countries_dictionary-3.1.0.dist-info/RECORD,,