├── .appveyor.yml ├── .formatter.exs ├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── data └── iso_3166-2 │ ├── AD.json │ ├── AE.json │ ├── AF.json │ ├── AG.json │ ├── AI.json │ ├── AL.json │ ├── AM.json │ ├── AN.json │ ├── AO.json │ ├── AQ.json │ ├── AR.json │ ├── AS.json │ ├── AT.json │ ├── AU.json │ ├── AW.json │ ├── AX.json │ ├── AZ.json │ ├── BA.json │ ├── BB.json │ ├── BD.json │ ├── BE.json │ ├── BF.json │ ├── BG.json │ ├── BH.json │ ├── BI.json │ ├── BJ.json │ ├── BL.json │ ├── BM.json │ ├── BN.json │ ├── BO.json │ ├── BQ.json │ ├── BR.json │ ├── BS.json │ ├── BT.json │ ├── BV.json │ ├── BW.json │ ├── BY.json │ ├── BZ.json │ ├── CA.json │ ├── CC.json │ ├── CD.json │ ├── CF.json │ ├── CG.json │ ├── CH.json │ ├── CI.json │ ├── CK.json │ ├── CL.json │ ├── CM.json │ ├── CN.json │ ├── CO.json │ ├── CR.json │ ├── CS.json │ ├── CU.json │ ├── CV.json │ ├── CW.json │ ├── CX.json │ ├── CY.json │ ├── CZ.json │ ├── DE.json │ ├── DJ.json │ ├── DK.json │ ├── DM.json │ ├── DO.json │ ├── DZ.json │ ├── EC.json │ ├── EE.json │ ├── EG.json │ ├── EH.json │ ├── ER.json │ ├── ES.json │ ├── ET.json │ ├── FI.json │ ├── FJ.json │ ├── FK.json │ ├── FM.json │ ├── FO.json │ ├── FR.json │ ├── GA.json │ ├── GB.json │ ├── GD.json │ ├── GE.json │ ├── GF.json │ ├── GG.json │ ├── GH.json │ ├── GI.json │ ├── GL.json │ ├── GM.json │ ├── GN.json │ ├── GP.json │ ├── GQ.json │ ├── GR.json │ ├── GS.json │ ├── GT.json │ ├── GU.json │ ├── GW.json │ ├── GY.json │ ├── HK.json │ ├── HM.json │ ├── HN.json │ ├── HR.json │ ├── HT.json │ ├── HU.json │ ├── ID.json │ ├── IE.json │ ├── IL.json │ ├── IM.json │ ├── IN.json │ ├── IO.json │ ├── IQ.json │ ├── IR.json │ ├── IS.json │ ├── IT.json │ ├── JE.json │ ├── JM.json │ ├── JO.json │ ├── JP.json │ ├── KE.json │ ├── KG.json │ ├── KH.json │ ├── KI.json │ ├── KM.json │ ├── KN.json │ ├── KP.json │ ├── KR.json │ ├── KW.json │ ├── KY.json │ ├── KZ.json │ ├── LA.json │ ├── LB.json │ ├── LC.json │ ├── LI.json │ ├── LK.json │ ├── LR.json │ ├── LS.json │ ├── LT.json │ ├── LU.json │ ├── LV.json │ ├── LY.json │ ├── MA.json │ ├── MC.json │ ├── MD.json │ ├── ME.json │ ├── MF.json │ ├── MG.json │ ├── MH.json │ ├── MK.json │ ├── ML.json │ ├── MM.json │ ├── MN.json │ ├── MO.json │ ├── MP.json │ ├── MQ.json │ ├── MR.json │ ├── MS.json │ ├── MT.json │ ├── MU.json │ ├── MV.json │ ├── MW.json │ ├── MX.json │ ├── MY.json │ ├── MZ.json │ ├── NA.json │ ├── NC.json │ ├── NE.json │ ├── NF.json │ ├── NG.json │ ├── NI.json │ ├── NL.json │ ├── NO.json │ ├── NP.json │ ├── NR.json │ ├── NU.json │ ├── NZ.json │ ├── OM.json │ ├── PA.json │ ├── PE.json │ ├── PF.json │ ├── PG.json │ ├── PH.json │ ├── PK.json │ ├── PL.json │ ├── PM.json │ ├── PN.json │ ├── PR.json │ ├── PS.json │ ├── PT.json │ ├── PW.json │ ├── PY.json │ ├── QA.json │ ├── RE.json │ ├── RO.json │ ├── RS.json │ ├── RU.json │ ├── RW.json │ ├── SA.json │ ├── SB.json │ ├── SC.json │ ├── SD.json │ ├── SE.json │ ├── SG.json │ ├── SH.json │ ├── SI.json │ ├── SJ.json │ ├── SK.json │ ├── SL.json │ ├── SM.json │ ├── SN.json │ ├── SO.json │ ├── SR.json │ ├── SS.json │ ├── ST.json │ ├── SV.json │ ├── SX.json │ ├── SY.json │ ├── SZ.json │ ├── TC.json │ ├── TD.json │ ├── TF.json │ ├── TG.json │ ├── TH.json │ ├── TJ.json │ ├── TK.json │ ├── TL.json │ ├── TM.json │ ├── TN.json │ ├── TO.json │ ├── TR.json │ ├── TT.json │ ├── TV.json │ ├── TW.json │ ├── TZ.json │ ├── UA.json │ ├── UG.json │ ├── UM.json │ ├── US.json │ ├── UY.json │ ├── UZ.json │ ├── VA.json │ ├── VC.json │ ├── VE.json │ ├── VG.json │ ├── VI.json │ ├── VN.json │ ├── VU.json │ ├── WF.json │ ├── WS.json │ ├── XK.json │ ├── YE.json │ ├── YT.json │ ├── ZA.json │ ├── ZM.json │ └── ZW.json ├── lib ├── validation.ex └── validation │ ├── exclude_characters.ex │ └── rules │ ├── alpha.ex │ ├── alphanumeric.ex │ ├── between.ex │ ├── cnh.ex │ ├── cnpj.ex │ ├── consonant.ex │ ├── country_code.ex │ ├── cpf.ex │ ├── credit_card.ex │ ├── credit_card │ ├── amex.ex │ ├── diners.ex │ ├── discover.ex │ ├── jcb.ex │ ├── master.ex │ └── visa.ex │ ├── currency_code.ex │ ├── digit.ex │ ├── email.ex │ ├── even.ex │ ├── language_code.ex │ ├── lowercase.ex │ ├── luhn.ex │ ├── mac_address.ex │ ├── no.ex │ ├── odd.ex │ ├── subdivision_code.ex │ ├── tld.ex │ ├── uppercase.ex │ ├── uuid.ex │ ├── vowel.ex │ └── yes.ex ├── media ├── logo-docs.png ├── logo-readme.png └── logo.png ├── mix.exs ├── mix.lock └── test ├── test_helper.exs ├── validation ├── exclude_characters_test.exs └── rules │ ├── alpha_test.exs │ ├── alphanumeric_test.exs │ ├── between_test.exs │ ├── cnh_test.exs │ ├── cnpj_test.exs │ ├── consonant_test.exs │ ├── country_code_test.exs │ ├── cpf_test.exs │ ├── credit_card │ ├── amex_test.exs │ ├── diners_test.exs │ ├── discover_test.exs │ ├── jcb_test.exs │ ├── master_test.exs │ └── visa_test.exs │ ├── credit_card_test.exs │ ├── currency_code_test.exs │ ├── digit_test.exs │ ├── email_test.exs │ ├── even_test.exs │ ├── language_code_test.exs │ ├── lowercase_test.exs │ ├── luhn_test.exs │ ├── mac_address_test.exs │ ├── no_test.exs │ ├── odd_test.exs │ ├── subdivision_code_test.exs │ ├── tld_test.exs │ ├── uppercase_test.exs │ ├── uuid_test.exs │ ├── vowel_test.exs │ └── yes_test.exs └── validation_test.exs /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build{build} 2 | 3 | install: 4 | - cinst elixir 5 | - cinst mingw 6 | - refreshenv 7 | 8 | build_script: 9 | - mix local.hex --force 10 | - mix local.rebar --force 11 | - mix deps.get 12 | - mix compile 13 | - mix test 14 | -------------------------------------------------------------------------------- /.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] 4 | ] 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # The directory Mix will write compiled artifacts to. 2 | /_build/ 3 | 4 | # If you run "mix test --cover", coverage assets end up here. 5 | /cover/ 6 | 7 | # The directory Mix downloads your dependencies sources to. 8 | /deps/ 9 | 10 | # Where third-party dependencies like ExDoc output generated docs. 11 | /doc/ 12 | 13 | # Ignore .fetch files in case you like to edit your project deps locally. 14 | /.fetch 15 | 16 | # If the VM crashes, it generates a dump, let's ignore it too. 17 | erl_crash.dump 18 | 19 | # Also ignore archive artifacts (built via "mix archive.build"). 20 | *.ez 21 | 22 | # Ignore package tarball (built via "mix hex.build"). 23 | validation-*.tar 24 | 25 | # Custom 26 | 27 | /.idea/ 28 | /validation.iml 29 | /lib/sandbox/sandbox.ex 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: elixir 2 | 3 | elixir: 4 | - 1.8.1 5 | 6 | otp_release: 7 | - 21.1 8 | 9 | matrix: 10 | include: 11 | - otp_release: 19.3 12 | elixir: 1.7.0 13 | 14 | script: 15 | - MIX_ENV=test mix do compile --warnings-as-errors, coveralls.json 16 | 17 | after_script: 18 | - MIX_ENV=docs mix deps.get 19 | - MIX_ENV=docs mix inch.report 20 | - bash <(curl -s https://codecov.io/bash) 21 | - MIX_ENV=test mix coveralls.travis 22 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Matheus Gontijo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/AD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AD/administrative-division-andorra.html", 3 | "country": "Andorra", 4 | "subdivisions": { 5 | "02": "Canillo", 6 | "03": "Encamp", 7 | "04": "La Massana", 8 | "05": "Ordino", 9 | "06": "Sant Julia de Lòria", 10 | "07": "Andorra la Vella", 11 | "08": "Escaldes-Engordany" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /data/iso_3166-2/AE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AE/administrative-division-united-arab-emirates.html", 3 | "country": "United Arab Emirates", 4 | "subdivisions": { 5 | "AJ": "'Ajman", 6 | "AZ": "Abu Zaby", 7 | "DU": "Dubayy", 8 | "FU": "Al Fujayrah", 9 | "RK": "R'as al Khaymah", 10 | "SH": "Ash Shariqah", 11 | "UQ": "Umm al Qaywayn" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /data/iso_3166-2/AF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AF/administrative-division-afghanistan.html", 3 | "country": "Afghanistan", 4 | "subdivisions": { 5 | "BAL": "Balkh province", 6 | "BAM": "Bamian province", 7 | "BDG": "Badghis province", 8 | "BDS": "Badakhshan province", 9 | "BGL": "Baghlan province", 10 | "DAY": "Dāykundī", 11 | "FRA": "Farah province", 12 | "FYB": "Faryab province", 13 | "GHA": "Ghazni province", 14 | "GHO": "Ghowr province", 15 | "HEL": "Helmand province", 16 | "HER": "Herat province", 17 | "JOW": "Jowzjan province", 18 | "KAB": "Kabul province", 19 | "KAN": "Kandahar province", 20 | "KAP": "Kapisa province", 21 | "KDZ": "Kondoz province", 22 | "KHO": "Khost province", 23 | "KNR": "Konar province", 24 | "LAG": "Laghman province", 25 | "LOG": "Lowgar province", 26 | "NAN": "Nangrahar province", 27 | "NIM": "Nimruz province", 28 | "NUR": "Nurestan province", 29 | "PAN": "Panjshir", 30 | "PAR": "Parwan province", 31 | "PIA": "Paktia province", 32 | "PKA": "Paktika province", 33 | "SAM": "Samangan province", 34 | "SAR": "Sar-e Pol province", 35 | "TAK": "Takhar province", 36 | "URU": "Uruzgān province", 37 | "WAR": "Wardak province", 38 | "ZAB": "Zabol province" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /data/iso_3166-2/AG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AG/administrative-division-antigua-and-barbuda.html", 3 | "country": "Antigua and Barbuda", 4 | "subdivisions": { 5 | "03": "Saint George", 6 | "04": "Saint John", 7 | "05": "Saint Mary", 8 | "06": "Saint Paul", 9 | "07": "Saint Peter", 10 | "08": "Saint Philip", 11 | "10": "Barbuda", 12 | "11": "Redonda" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/AI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AI/administrative-division-anguilla.html", 3 | "country": "Anguilla", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/AL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AL/administrative-division-albania.html", 3 | "country": "Albania", 4 | "subdivisions": { 5 | "01": "Berat", 6 | "02": "Durres", 7 | "03": "Elbasan", 8 | "04": "Fier", 9 | "05": "Gjirokaster", 10 | "06": "Korce", 11 | "07": "Kukes", 12 | "08": "Lezhe", 13 | "09": "Diber", 14 | "10": "Shkoder", 15 | "11": "Tirane", 16 | "12": "Vlore", 17 | "BR": "Berat", 18 | "BU": "Bulqize", 19 | "DI": "Diber", 20 | "DL": "Delvine", 21 | "DR": "Durres", 22 | "DV": "Devoll", 23 | "EL": "Elbasan", 24 | "ER": "Kolonje", 25 | "FR": "Fier", 26 | "GJ": "Gjirokaster", 27 | "GR": "Gramsh", 28 | "HA": "Has", 29 | "KA": "Kavaje", 30 | "KB": "Kurbin", 31 | "KC": "Kucove", 32 | "KO": "Korce", 33 | "KR": "Kruje", 34 | "KU": "Kukes", 35 | "LB": "Librazhd", 36 | "LE": "Lezhe", 37 | "LU": "Lushnje", 38 | "MK": "Mallakaster", 39 | "MM": "Malesi e Madhe", 40 | "MR": "Mirdite", 41 | "MT": "Mat", 42 | "PG": "Pogradec", 43 | "PQ": "Peqin", 44 | "PR": "Permet", 45 | "PU": "Puke", 46 | "SH": "Shkoder", 47 | "SK": "Skrapar", 48 | "SR": "Sarande", 49 | "TE": "Tepelene", 50 | "TP": "Tropoje", 51 | "TR": "Tirane", 52 | "VL": "Vlore" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /data/iso_3166-2/AM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AM/administrative-division-armenia.html", 3 | "country": "Armenia", 4 | "subdivisions": { 5 | "AG": "Aragatsotn", 6 | "AR": "Ararat", 7 | "AV": "Armavir", 8 | "ER": "Yerevan", 9 | "GR": "Geghark'unik'", 10 | "KT": "Kotayk'", 11 | "LO": "Lorri", 12 | "SH": "Shirak", 13 | "SU": "Syunik'", 14 | "TV": "Tavush", 15 | "VD": "Vayots' Dzor" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/AN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AN/administrative-division-netherlands-antilles.html", 3 | "country": "Netherlands Antilles", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/AO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AO/administrative-division-angola.html", 3 | "country": "Angola", 4 | "subdivisions": { 5 | "BGO": "Bengo", 6 | "BGU": "Benguela province", 7 | "BIE": "Bie", 8 | "CAB": "Cabinda", 9 | "CCU": "Cuando-Cubango", 10 | "CNN": "Cunene", 11 | "CNO": "Cuanza Norte", 12 | "CUS": "Cuanza Sul", 13 | "HUA": "Huambo province", 14 | "HUI": "Huila province", 15 | "LNO": "Lunda Norte", 16 | "LSU": "Lunda Sul", 17 | "LUA": "Luanda", 18 | "MAL": "Malange", 19 | "MOX": "Moxico", 20 | "NAM": "Namibe", 21 | "UIG": "Uige", 22 | "ZAI": "Zaire" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/AQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AQ/administrative-division-antarctica.html", 3 | "country": "Antarctica", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/AR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AR/administrative-division-argentina.html", 3 | "country": "Argentina", 4 | "subdivisions": { 5 | "A": "Salta", 6 | "B": "Buenos Aires Province", 7 | "C": "Ciudad Autónoma de Buenos Aires", 8 | "D": "San Luis", 9 | "E": "Entre Rios", 10 | "F": "La Rioja", 11 | "G": "Santiago del Estero", 12 | "H": "Chaco", 13 | "J": "San Juan", 14 | "K": "Catamarca", 15 | "L": "La Pampa", 16 | "M": "Mendoza", 17 | "N": "Misiones", 18 | "P": "Formosa", 19 | "Q": "Neuquen", 20 | "R": "Rio Negro", 21 | "S": "Santa Fe", 22 | "T": "Tucuman", 23 | "U": "Chubut", 24 | "V": "Tierra del Fuego", 25 | "W": "Corrientes", 26 | "X": "Cordoba", 27 | "Y": "Jujuy", 28 | "Z": "Santa Cruz" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /data/iso_3166-2/AS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AS/administrative-division-american-samoa.html", 3 | "country": "American Samoa", 4 | "subdivisions": { 5 | "E": "Eastern", 6 | "M": "Manu'a", 7 | "R": "Rose Island", 8 | "S": "Swains Island", 9 | "W": "Western" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/AT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AT/administrative-division-austria.html", 3 | "country": "Austria", 4 | "subdivisions": { 5 | "1": "Burgenland", 6 | "2": "Karnten", 7 | "3": "Niederosterreich", 8 | "4": "Oberosterreich", 9 | "5": "Salzburg", 10 | "6": "Steiermark", 11 | "7": "Tirol", 12 | "8": "Vorarlberg", 13 | "9": "Wien" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/AU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AU/administrative-division-australia.html", 3 | "country": "Australia", 4 | "subdivisions": { 5 | "ACT": "Australian Capital Territory", 6 | "NSW": "New South Wales", 7 | "NT": "Northern Territory", 8 | "QLD": "Queensland", 9 | "SA": "South Australia", 10 | "TAS": "Tasmania", 11 | "VIC": "Victoria", 12 | "WA": "Western Australia" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/AW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AW/administrative-division-aruba.html", 3 | "country": "Aruba", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/AX.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/AX/administrative-division-aland.html", 3 | "country": "Åland", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/BA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BA/administrative-division-bosnia-and-herzegovina.html", 3 | "country": "Bosnia and Herzegovina", 4 | "subdivisions": { 5 | "01": "Unsko-sanski kanton", 6 | "02": "Posavski kanton", 7 | "03": "Tuzlanski kanton", 8 | "04": "Zeničko-dobojski kanton", 9 | "05": "Bosansko-podrinjski kanton", 10 | "06": "Srednjobosanski kantonn", 11 | "07": "Hercegovačko-neretvanski kanton", 12 | "08": "Zapadnohercegovački kanton", 13 | "09": "Kanton Sarajevo", 14 | "10": "Kanton br. 10 (Livanjski kanton)", 15 | "BIH": "Federacija Bosna i Hercegovina", 16 | "BRC": "Brcko District", 17 | "SRP": "Republika Srpska" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/BB.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BB/administrative-division-barbados.html", 3 | "country": "Barbados", 4 | "subdivisions": { 5 | "01": "Christ Church", 6 | "02": "Saint Andrew", 7 | "03": "Saint George", 8 | "04": "Saint James", 9 | "05": "Saint John", 10 | "06": "Saint Joseph", 11 | "07": "Saint Lucy", 12 | "08": "Saint Michael", 13 | "09": "Saint Peter", 14 | "10": "Saint Philip", 15 | "11": "Saint Thomas" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/BE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BE/administrative-division-belgium.html", 3 | "country": "Belgium", 4 | "subdivisions": { 5 | "BRU": "Brussels", 6 | "VAN": "Antwerpen", 7 | "VBR": "Vlaams Brabant", 8 | "VLG": "Flemish Region", 9 | "VLI": "Limburg", 10 | "VOV": "Oost-Vlaanderen", 11 | "VWV": "West-Vlaanderen", 12 | "WAL": "Wallonia", 13 | "WBR": "Brabant Wallon", 14 | "WHT": "Hainaut", 15 | "WLG": "Liege", 16 | "WLX": "Luxembourg", 17 | "WNA": "Namur" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/BF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BF/administrative-division-burkina-faso.html", 3 | "country": "Burkina Faso", 4 | "subdivisions": { 5 | "01": "Boucle du Mouhoun", 6 | "02": "Cascades", 7 | "03": "Centre", 8 | "04": "Centre-Est", 9 | "05": "Centre-Nord", 10 | "06": "Centre-Ouest", 11 | "07": "Centre-Sud", 12 | "08": "Est", 13 | "09": "Hauts-Bassins", 14 | "10": "Nord", 15 | "11": "Plateau-Central", 16 | "12": "Sahel", 17 | "13": "Sud-Ouest", 18 | "BAL": "Bale", 19 | "BAM": "Bam", 20 | "BAN": "Banwa", 21 | "BAZ": "Bazega", 22 | "BGR": "Bougouriba", 23 | "BLG": "Boulgou", 24 | "BLK": "Boulkiemde", 25 | "COM": "Comoe", 26 | "GAN": "Ganzourgou", 27 | "GNA": "Gnagna", 28 | "GOU": "Gourma", 29 | "HOU": "Houet", 30 | "IOB": "Ioba", 31 | "KAD": "Kadiogo", 32 | "KEN": "Kenedougou", 33 | "KMD": "Komondjari", 34 | "KMP": "Kompienga", 35 | "KOP": "Koulpelogo", 36 | "KOS": "Kossi", 37 | "KOT": "Kouritenga", 38 | "KOW": "Kourweogo", 39 | "LER": "Leraba", 40 | "LOR": "Loroum", 41 | "MOU": "Mouhoun", 42 | "NAM": "Namentenga", 43 | "NAO": "Nahouri", 44 | "NAY": "Nayala", 45 | "NOU": "Noumbiel", 46 | "OUB": "Oubritenga", 47 | "OUD": "Oudalan", 48 | "PAS": "Passore", 49 | "PON": "Poni", 50 | "SEN": "Seno", 51 | "SIS": "Sissili", 52 | "SMT": "Sanmatenga", 53 | "SNG": "Sanguie", 54 | "SOM": "Soum", 55 | "SOR": "Sourou", 56 | "TAP": "Tapoa", 57 | "TUI": "Tuy", 58 | "YAG": "Yagha", 59 | "YAT": "Yatenga", 60 | "ZIR": "Ziro", 61 | "ZON": "Zondoma", 62 | "ZOU": "Zoundweogo" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /data/iso_3166-2/BG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BG/administrative-division-bulgaria.html", 3 | "country": "Bulgaria", 4 | "subdivisions": { 5 | "01": "Blagoevgrad", 6 | "02": "Burgas", 7 | "03": "Varna", 8 | "04": "Veliko Turnovo", 9 | "05": "Vidin", 10 | "06": "Vratsa", 11 | "07": "Gabrovo", 12 | "08": "Dobrich", 13 | "09": "Kurdzhali", 14 | "10": "Kyustendil", 15 | "11": "Lovech", 16 | "12": "Montana", 17 | "13": "Pazardzhik", 18 | "14": "Pernik", 19 | "15": "Pleven", 20 | "16": "Plovdiv", 21 | "17": "Razgrad", 22 | "18": "Ruse", 23 | "19": "Silistra", 24 | "20": "Sliven", 25 | "21": "Smolyan", 26 | "22": "Sofia Region", 27 | "23": "Sofia", 28 | "24": "Stara Zagora", 29 | "25": "Turgovishte", 30 | "26": "Khaskovo", 31 | "27": "Shumen", 32 | "28": "Yambol" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /data/iso_3166-2/BH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BH/administrative-division-bahrain.html", 3 | "country": "Bahrain", 4 | "subdivisions": { 5 | "13": "Capital", 6 | "14": "Southern", 7 | "15": "Muharraq", 8 | "17": "Northern" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/BI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BI/administrative-division-burundi.html", 3 | "country": "Burundi", 4 | "subdivisions": { 5 | "BB": "Bubanza", 6 | "BL": "Bujumbura Rural", 7 | "BM": "Bujumbura Mairie", 8 | "BR": "Bururi", 9 | "CA": "Cankuzo", 10 | "CI": "Cibitoke", 11 | "GI": "Gitega", 12 | "KI": "Kirundo", 13 | "KR": "Karuzi", 14 | "KY": "Kayanza", 15 | "MA": "Makamba", 16 | "MU": "Muramvya", 17 | "MW": "Mwaro", 18 | "MY": "Muyinga", 19 | "NG": "Ngozi", 20 | "RM": "Rumonge", 21 | "RT": "Rutana", 22 | "RY": "Ruyigi" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/BJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BJ/administrative-division-benin.html", 3 | "country": "Benin", 4 | "subdivisions": { 5 | "AK": "Atakora", 6 | "AL": "Alibori", 7 | "AQ": "Atlantique", 8 | "BO": "Borgou", 9 | "CO": "Collines", 10 | "DO": "Donga", 11 | "KO": "Kouffo", 12 | "LI": "Littoral", 13 | "MO": "Mono", 14 | "OU": "Oueme", 15 | "PL": "Plateau", 16 | "ZO": "Zou" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/BL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BL/administrative-division-saint-barthelemy.html", 3 | "country": "Saint Barthélemy", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/BM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BM/administrative-division-bermuda.html", 3 | "country": "Bermuda", 4 | "subdivisions": { 5 | "DS": "Devonshire", 6 | "GC": "Saint George", 7 | "HA": "Hamilton", 8 | "HC": "Hamilton City", 9 | "PB": "Pembroke", 10 | "PG": "Paget", 11 | "SA": "Sandys", 12 | "SG": "Saint George's", 13 | "SH": "Southampton", 14 | "SM": "Smith's", 15 | "WA": "Warwick" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/BN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BN/administrative-division-brunei.html", 3 | "country": "Brunei", 4 | "subdivisions": { 5 | "BE": "Belait", 6 | "BM": "Brunei and Muara", 7 | "TE": "Temburong", 8 | "TU": "Tutong" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/BO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BO/administrative-division-bolivia.html", 3 | "country": "Bolivia", 4 | "subdivisions": { 5 | "B": "Departmento Beni", 6 | "C": "Departmento Cochabamba", 7 | "H": "Departmento Chuquisaca", 8 | "L": "Departmento La Paz", 9 | "N": "Departmento Pando", 10 | "O": "Departmento Oruro", 11 | "P": "Departmento Potosi", 12 | "S": "Departmento Santa Cruz", 13 | "T": "Departmento Tarija" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/BQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BQ/administrative-division-bonaire.html", 3 | "country": "Bonaire", 4 | "subdivisions": { 5 | "BO": "Bonaire", 6 | "SA": "Saba", 7 | "SE": "Sint Eustatius" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BR/administrative-division-brazil.html", 3 | "country": "Brazil", 4 | "subdivisions": { 5 | "AC": "Acre", 6 | "AL": "Alagoas", 7 | "AM": "Amazonas", 8 | "AP": "Amapa", 9 | "BA": "Bahia", 10 | "CE": "Ceara", 11 | "DF": "Distrito Federal", 12 | "ES": "Espirito Santo", 13 | "GO": "Goias", 14 | "MA": "Maranhao", 15 | "MG": "Minas Gerais", 16 | "MS": "Mato Grosso do Sul", 17 | "MT": "Mato Grosso", 18 | "PA": "Para", 19 | "PB": "Paraiba", 20 | "PE": "Pernambuco", 21 | "PI": "Piaui", 22 | "PR": "Parana", 23 | "RJ": "Rio de Janeiro", 24 | "RN": "Rio Grande do Norte", 25 | "RO": "Rondonia", 26 | "RR": "Roraima", 27 | "RS": "Rio Grande do Sul", 28 | "SC": "Santa Catarina", 29 | "SE": "Sergipe", 30 | "SP": "Sao Paulo", 31 | "TO": "Tocantins" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /data/iso_3166-2/BS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BS/administrative-division-bahamas.html", 3 | "country": "Bahamas", 4 | "subdivisions": { 5 | "AK": "Acklins Islands", 6 | "BI": "Bimini and Cat Cay", 7 | "BP": "Black Point", 8 | "BY": "Berry Islands", 9 | "CE": "Central Eleuthera", 10 | "CI": "Cat Island", 11 | "CK": "Crooked Island and Long Cay", 12 | "CO": "Central Abaco", 13 | "CS": "Central Andros", 14 | "EG": "East Grand Bahama", 15 | "EX": "Exuma", 16 | "FP": "City of Freeport", 17 | "GC": "Grand Cay", 18 | "HI": "Harbour Island", 19 | "HT": "Hope Town", 20 | "IN": "Inagua", 21 | "LI": "Long Island", 22 | "MC": "Mangrove Cay", 23 | "MG": "Mayaguana", 24 | "MI": "Moore's Island", 25 | "NE": "North Eleuthera", 26 | "NO": "North Abaco", 27 | "NP": "New Providence", 28 | "NS": "North Andros", 29 | "RC": "Rum Cay", 30 | "RI": "Ragged Island", 31 | "SA": "South Andros", 32 | "SE": "South Eleuthera", 33 | "SO": "South Abaco", 34 | "SS": "San Salvador", 35 | "SW": "Spanish Wells", 36 | "WG": "West Grand Bahama" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /data/iso_3166-2/BT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BT/administrative-division-bhutan.html", 3 | "country": "Bhutan", 4 | "subdivisions": { 5 | "11": "Paro", 6 | "12": "Chukha", 7 | "13": "Haa", 8 | "14": "Samtse", 9 | "15": "Thimphu", 10 | "21": "Tsirang", 11 | "22": "Dagana", 12 | "23": "Punakha", 13 | "24": "Wangdue Phodrang", 14 | "31": "Sarpang", 15 | "32": "Trongsa", 16 | "33": "Bumthang", 17 | "34": "Zhemgang", 18 | "41": "Trashigang", 19 | "42": "Mongar", 20 | "43": "Pemagatshel", 21 | "44": "Lhuntse", 22 | "45": "Samdrup Jongkhar", 23 | "GA": "Gasa", 24 | "TY": "Trashi Yangste" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /data/iso_3166-2/BV.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BV/administrative-division-bouvet-island.html", 3 | "country": "Bouvet Island", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/BW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BW/administrative-division-botswana.html", 3 | "country": "Botswana", 4 | "subdivisions": { 5 | "CE": "Central", 6 | "CH": "Chobe", 7 | "FR": "Francistown", 8 | "GA": "Gaborone", 9 | "GH": "Ghanzi", 10 | "JW": "Jwaneng", 11 | "KG": "Kgalagadi", 12 | "KL": "Kgatleng", 13 | "KW": "Kweneng", 14 | "LO": "Lobatse", 15 | "NE": "North East", 16 | "NW": "North West", 17 | "SE": "South East", 18 | "SO": "Southern", 19 | "SP": "Selibe Phikwe", 20 | "ST": "Sowa Town" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/BY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BY/administrative-division-belarus.html", 3 | "country": "Belarus", 4 | "subdivisions": { 5 | "BR": "Brest voblast", 6 | "HM": "Horad Minsk", 7 | "HO": "Homyel voblast", 8 | "HR": "Hrodna voblast", 9 | "MA": "Mahilyow voblast", 10 | "MI": "Minsk voblast", 11 | "VI": "Vitsebsk voblast" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /data/iso_3166-2/BZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/BZ/administrative-division-belize.html", 3 | "country": "Belize", 4 | "subdivisions": { 5 | "BZ": "Belize District", 6 | "CY": "Cayo District", 7 | "CZL": "Corozal District", 8 | "OW": "Orange Walk District", 9 | "SC": "Stann Creek District", 10 | "TOL": "Toledo District" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/CA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CA/administrative-division-canada.html", 3 | "country": "Canada", 4 | "subdivisions": { 5 | "AB": "Alberta", 6 | "BC": "British Columbia", 7 | "MB": "Manitoba", 8 | "NB": "New Brunswick", 9 | "NL": "Newfoundland and Labrador", 10 | "NS": "Nova Scotia", 11 | "NT": "Northwest Territories", 12 | "NU": "Nunavut", 13 | "ON": "Ontario", 14 | "PE": "Prince Edward Island", 15 | "QC": "Quebec", 16 | "SK": "Saskatchewan", 17 | "YT": "Yukon Territory" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/CC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CC/administrative-division-cocos-islands.html", 3 | "country": "Cocos [Keeling] Islands", 4 | "subdivisions": { 5 | "D": "Direction Island", 6 | "H": "Home Island", 7 | "O": "Horsburgh Island", 8 | "S": "South Island", 9 | "W": "West Island" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/CD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CD/administrative-division-democratic-republic-of-the-congo.html", 3 | "country": "Democratic Republic of the Congo", 4 | "subdivisions": { 5 | "BC": "Kongo Central", 6 | "BU": "Bas-Uélé", 7 | "EQ": "Équateur ", 8 | "HK": "Haut-Katanga", 9 | "HL": "Haut-Lomami", 10 | "HU": "Haut-Uélé", 11 | "IT": "Ituri", 12 | "KC": "Kasaï Central", 13 | "KE": "Kasai-Oriental", 14 | "KG": "Kwango", 15 | "KL": "Kwilu", 16 | "KN": "Kinshasa", 17 | "KS": "Kasaï", 18 | "LO": "Lomami", 19 | "LU": "Lualaba", 20 | "MA": "Maniema", 21 | "MN": "Mai-Ndombe", 22 | "MO": "Mongala", 23 | "NK": "Nord-Kivu", 24 | "NU": "Nord-Ubangi", 25 | "SA": "Sankuru", 26 | "SK": "Sud-Kivu", 27 | "SU": "Sud-Ubangi", 28 | "TA": "Tanganyika", 29 | "TO": "Tshopo", 30 | "TU": "Tshuapa" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /data/iso_3166-2/CF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CF/administrative-division-central-african-republic.html", 3 | "country": "Central African Republic", 4 | "subdivisions": { 5 | "AC": "Ouham", 6 | "BB": "Bamingui-Bangoran", 7 | "BGF": "Bangui", 8 | "BK": "Basse-Kotto", 9 | "HK": "Haute-Kotto", 10 | "HM": "Haut-Mbomou", 11 | "HS": "Mambere-Kadeï", 12 | "KB": "Nana-Grebizi", 13 | "KG": "Kemo", 14 | "LB": "Lobaye", 15 | "MB": "Mbomou", 16 | "MP": "Ombella-M'Poko", 17 | "NM": "Nana-Mambere", 18 | "OP": "Ouham-Pende", 19 | "SE": "Sangha-Mbaere", 20 | "UK": "Ouaka", 21 | "VK": "Vakaga" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/CG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CG/administrative-division-republic-of-the-congo.html", 3 | "country": "Republic of the Congo", 4 | "subdivisions": { 5 | "11": "Bouenza", 6 | "12": "Pool", 7 | "13": "Sangha", 8 | "14": "Plateaux", 9 | "15": "Cuvette-Ouest", 10 | "16": "Pointe-Noire", 11 | "2": "Lekoumou", 12 | "5": "Kouilou", 13 | "7": "Likouala", 14 | "8": "Cuvette", 15 | "9": "Niari", 16 | "BZV": "Brazzaville" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/CH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CH/administrative-division-switzerland.html", 3 | "country": "Switzerland", 4 | "subdivisions": { 5 | "AG": "Aargau", 6 | "AI": "Appenzell Innerhoden", 7 | "AR": "Appenzell Ausserrhoden", 8 | "BE": "Bern", 9 | "BL": "Basel-Landschaft", 10 | "BS": "Basel-Stadt", 11 | "FR": "Fribourg", 12 | "GE": "Geneva", 13 | "GL": "Glarus", 14 | "GR": "Graubunden", 15 | "JU": "Jura", 16 | "LU": "Lucerne", 17 | "NE": "Neuchâtel", 18 | "NW": "Nidwalden", 19 | "OW": "Obwalden", 20 | "SG": "St. Gallen", 21 | "SH": "Schaffhausen", 22 | "SO": "Solothurn", 23 | "SZ": "Schwyz", 24 | "TG": "Thurgau", 25 | "TI": "Ticino", 26 | "UR": "Uri", 27 | "VD": "Vaud", 28 | "VS": "Valais", 29 | "ZG": "Zug", 30 | "ZH": "Zurich" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /data/iso_3166-2/CI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CI/administrative-division-ivory-coast.html", 3 | "country": "Ivory Coast", 4 | "subdivisions": { 5 | "AB": "Abidjan", 6 | "BS": "Bas-Sassandra", 7 | "CM": "Comoé", 8 | "DN": "Denguélé", 9 | "GD": "Gôh-Djiboua", 10 | "LC": "Lacs", 11 | "LG": "Lagunes", 12 | "MG": "Montagnes", 13 | "SM": "Sassandra-Marahoué", 14 | "SV": "Savanes", 15 | "VB": "Vallée du Bandama", 16 | "WR": "Woroba", 17 | "YM": "Yamoussoukro Autonomous District", 18 | "ZZ": "Zanzan" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/CK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CK/administrative-division-cook-islands.html", 3 | "country": "Cook Islands", 4 | "subdivisions": { 5 | "AI": "Aitutaki", 6 | "AT": "Atiu", 7 | "MA": "Manuae", 8 | "MG": "Mangaia", 9 | "MK": "Manihiki", 10 | "MT": "Mitiaro", 11 | "MU": "Mauke", 12 | "NI": "Nassau Island", 13 | "PA": "Palmerston", 14 | "PE": "Penrhyn", 15 | "PU": "Pukapuka", 16 | "RK": "Rakahanga", 17 | "RR": "Rarotonga", 18 | "SU": "Surwarrow", 19 | "TA": "Takutea" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/CL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CL/administrative-division-chile.html", 3 | "country": "Chile", 4 | "subdivisions": { 5 | "AI": "Aisen del General Carlos Ibanez del Campo (XI)", 6 | "AN": "Antofagasta (II)", 7 | "AP": "Arica y Parinacota", 8 | "AR": "Araucania (IX)", 9 | "AT": "Atacama (III)", 10 | "BI": "Bio-Bio (VIII)", 11 | "CO": "Coquimbo (IV)", 12 | "LI": "Libertador General Bernardo O'Higgins (VI)", 13 | "LL": "Los Lagos (X)", 14 | "LR": "Los Ríos", 15 | "MA": "Magallanes (XII)", 16 | "ML": "Maule (VII)", 17 | "NB": "Ñuble", 18 | "RM": "Region Metropolitana (RM)", 19 | "TA": "Tarapaca (I)", 20 | "VS": "Valparaiso (V)" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/CM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CM/administrative-division-cameroon.html", 3 | "country": "Cameroon", 4 | "subdivisions": { 5 | "AD": "Adamawa Province (Adamaoua)", 6 | "CE": "Centre Province", 7 | "EN": "Extreme North Province (Extrême-Nord)", 8 | "ES": "East Province (Est)", 9 | "LT": "Littoral Province", 10 | "NO": "North Province (Nord)", 11 | "NW": "Northwest Province (Nord-Ouest)", 12 | "OU": "West Province (Ouest)", 13 | "SU": "South Province (Sud)", 14 | "SW": "Southwest Province (Sud-Ouest)." 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CN/administrative-division-china.html", 3 | "country": "China", 4 | "subdivisions": { 5 | "AH": "Anhui", 6 | "BJ": "Beijing", 7 | "CQ": "Chongqìng", 8 | "FJ": "Fujian", 9 | "GD": "Guangdong", 10 | "GS": "Gansu", 11 | "GX": "Guangxi", 12 | "GZ": "Guizhou", 13 | "HA": "Henan", 14 | "HB": "Hubei", 15 | "HE": "Hebei", 16 | "HI": "Hainan", 17 | "HK": "Xianggang", 18 | "HL": "Heilongjiang", 19 | "HN": "Hunan", 20 | "JL": "Jilin", 21 | "JS": "Jiangsu", 22 | "JX": "Jiangxi", 23 | "LN": "Liaoning", 24 | "MO": "Aomen", 25 | "NM": "Nei Mongol", 26 | "NX": "Ningxia", 27 | "QH": "Qinghai", 28 | "SC": "Sichuan", 29 | "SD": "Shandong", 30 | "SH": "Shanghai", 31 | "SN": "Shaanxi", 32 | "SX": "Shanxi", 33 | "TJ": "Tianjin", 34 | "TW": "Taiwan", 35 | "XJ": "Xinjiang", 36 | "XZ": "Xizang Zìzhìqu (Tibet)", 37 | "YN": "Yunnan", 38 | "ZJ": "Zhejiang" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /data/iso_3166-2/CO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CO/administrative-division-colombia.html", 3 | "country": "Colombia", 4 | "subdivisions": { 5 | "AMA": "Amazonas", 6 | "ANT": "Antioquia", 7 | "ARA": "Arauca", 8 | "ATL": "Atlantico", 9 | "BOL": "Bolivar", 10 | "BOY": "Boyaca", 11 | "CAL": "Caldas", 12 | "CAQ": "Caqueta", 13 | "CAS": "Casanare", 14 | "CAU": "Cauca", 15 | "CES": "Cesar", 16 | "CHO": "Choco", 17 | "COR": "Cordoba", 18 | "CUN": "Cundinamarca", 19 | "DC": "Bogota D.C.", 20 | "GUA": "Guainia", 21 | "GUV": "Guaviare", 22 | "HUI": "Huila", 23 | "LAG": "La Guajira", 24 | "MAG": "Magdalena", 25 | "MET": "Meta", 26 | "NAR": "Narino", 27 | "NSA": "Norte de Santander", 28 | "PUT": "Putumayo", 29 | "QUI": "Quindio", 30 | "RIS": "Risaralda", 31 | "SAN": "Santander", 32 | "SAP": "San Andres y Providencia", 33 | "SUC": "Sucre", 34 | "TOL": "Tolima", 35 | "VAC": "Valle del Cauca", 36 | "VAU": "Vaupes", 37 | "VID": "Vichada" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /data/iso_3166-2/CR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CR/administrative-division-costa-rica.html", 3 | "country": "Costa Rica", 4 | "subdivisions": { 5 | "A": "Alajuela", 6 | "C": "Cartago", 7 | "G": "Guanacaste", 8 | "H": "Heredia", 9 | "L": "Limon", 10 | "P": "Puntarenas", 11 | "SJ": "San Jose" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /data/iso_3166-2/CS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CS/administrative-division-serbia-and-montenegro.html", 3 | "country": "Serbia And Montenegro", 4 | "subdivisions": { 5 | "KOS": "Kosovo", 6 | "MON": "Montenegro", 7 | "SER": "Serbia", 8 | "VOJ": "Vojvodina" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/CU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CU/administrative-division-cuba.html", 3 | "country": "Cuba", 4 | "subdivisions": { 5 | "01": "Pinar del Rio", 6 | "03": "La Habana", 7 | "04": "Matanzas", 8 | "05": "Villa Clara", 9 | "06": "Cienfuegos", 10 | "07": "Sancti Spiritus", 11 | "08": "Ciego de Avila", 12 | "09": "Camaguey", 13 | "10": "Las Tunas", 14 | "11": "Holguin", 15 | "12": "Granma", 16 | "13": "Santiago de Cuba", 17 | "14": "Guantanamo", 18 | "15": "Artemisa", 19 | "16": "Mayabeque", 20 | "99": "Isla de la Juventud" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/CV.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CV/administrative-division-cape-verde.html", 3 | "country": "Cape Verde", 4 | "subdivisions": { 5 | "B": "Ilhas de Barlavento", 6 | "BR": "Brava", 7 | "BV": "Boa Vista", 8 | "CA": "Santa Catarina", 9 | "CF": "Santa Catarina do Fogo", 10 | "CR": "Santa Cruz", 11 | "MA": "Maio", 12 | "MO": "Mosteiros", 13 | "PA": "Paul", 14 | "PN": "Porto Novo", 15 | "PR": "Praia", 16 | "RB": "Ribeira Brava", 17 | "RG": "Ribeira Grande", 18 | "RS": "Ribeira Grande de Santiago", 19 | "S": "Ilhas de Sotavento", 20 | "SD": "Sao Domingos", 21 | "SF": "Sao Filipe", 22 | "SL": "Sal", 23 | "SM": "São Miguel", 24 | "SO": "São Lourenço dos Orgãos", 25 | "SS": "São Salvador do Mundo", 26 | "SV": "Sao Vicente", 27 | "TA": "Tarrafal", 28 | "TS": "Tarrafal de São Nicolau" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /data/iso_3166-2/CW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CW/administrative-division-curacao.html", 3 | "country": "Curacao", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/CX.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CX/administrative-division-christmas-island.html", 3 | "country": "Christmas Island", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/CY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/CY/administrative-division-cyprus.html", 3 | "country": "Cyprus", 4 | "subdivisions": { 5 | "01": "Lefkosía", 6 | "02": "Lemesós", 7 | "03": "Lárnaka", 8 | "04": "Ammóchostos", 9 | "05": "Páfos", 10 | "06": "Kerýneia" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/DE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DE/administrative-division-germany.html", 3 | "country": "Germany", 4 | "subdivisions": { 5 | "BB": "Brandenburg", 6 | "BE": "Berlin", 7 | "BW": "Baden-Württemberg", 8 | "BY": "Bayern", 9 | "HB": "Bremen", 10 | "HE": "Hessen", 11 | "HH": "Hamburg", 12 | "MV": "Mecklenburg-Vorpommern", 13 | "NI": "Niedersachsen", 14 | "NW": "Nordrhein-Westfalen", 15 | "RP": "Rheinland-Pfalz", 16 | "SH": "Schleswig-Holstein", 17 | "SL": "Saarland", 18 | "SN": "Sachsen", 19 | "ST": "Sachsen-Anhalt", 20 | "TH": "Thüringen" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/DJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DJ/administrative-division-djibouti.html", 3 | "country": "Djibouti", 4 | "subdivisions": { 5 | "AR": "Arta", 6 | "AS": "'Ali Sabih", 7 | "DI": "Dikhil", 8 | "DJ": "Djibouti", 9 | "OB": "Obock", 10 | "TA": "Tadjoura" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/DK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DK/administrative-division-denmark.html", 3 | "country": "Denmark", 4 | "subdivisions": { 5 | "81": "Region Nordjylland", 6 | "82": "Region Midtjylland", 7 | "83": "Region Syddanmark", 8 | "84": "Region Hovedstaden", 9 | "85": "Region Sjæland" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/DM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DM/administrative-division-dominica.html", 3 | "country": "Dominica", 4 | "subdivisions": { 5 | "02": "Saint Andrew Parish", 6 | "03": "Saint David Parish", 7 | "04": "Saint George Parish", 8 | "05": "Saint John Parish", 9 | "06": "Saint Joseph Parish", 10 | "07": "Saint Luke Parish", 11 | "08": "Saint Mark Parish", 12 | "09": "Saint Patrick Parish", 13 | "10": "Saint Paul Parish", 14 | "11": "Saint Peter Parish" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/DO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DO/administrative-division-dominican-republic.html", 3 | "country": "Dominican Republic", 4 | "subdivisions": { 5 | "01": "Distrito Nacional", 6 | "02": "Azua", 7 | "03": "Baoruco", 8 | "04": "Barahona", 9 | "05": "Dajabon", 10 | "06": "Duarte", 11 | "07": "Elias Pina", 12 | "08": "El Seybo", 13 | "09": "Espaillat", 14 | "10": "Independencia", 15 | "11": "La Altagracia", 16 | "12": "La Romana", 17 | "13": "La Vega", 18 | "14": "Maria Trinidad Sanchez", 19 | "15": "Monte Cristi", 20 | "16": "Pedernales", 21 | "17": "Peravia (Bani)", 22 | "18": "Puerto Plata", 23 | "19": "Salcedo", 24 | "20": "Samana", 25 | "21": "San Cristobal", 26 | "22": "San Juan", 27 | "23": "San Pedro de Macoris", 28 | "24": "Sanchez Ramirez", 29 | "25": "Santiago", 30 | "26": "Santiago Rodriguez", 31 | "27": "Valverde", 32 | "28": "Monsenor Nouel", 33 | "29": "Monte Plata", 34 | "30": "Hato Mayor", 35 | "31": "San Jose de Ocoa", 36 | "32": "Santo Domingo" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /data/iso_3166-2/DZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/DZ/administrative-division-algeria.html", 3 | "country": "Algeria", 4 | "subdivisions": { 5 | "01": "Adrar", 6 | "02": "Chlef", 7 | "03": "Laghouat", 8 | "04": "Oum el-Bouaghi", 9 | "05": "Batna", 10 | "06": "Bejaia", 11 | "07": "Biskra", 12 | "08": "Bechar", 13 | "09": "Blida", 14 | "10": "Bouira", 15 | "11": "Tamanghasset", 16 | "12": "Tebessa", 17 | "13": "Tlemcen", 18 | "14": "Tiaret", 19 | "15": "Tizi Ouzou", 20 | "16": "Alger", 21 | "17": "Djelfa", 22 | "18": "Jijel", 23 | "19": "Setif", 24 | "20": "Saida", 25 | "21": "Skikda", 26 | "22": "Sidi Bel Abbes", 27 | "23": "Annaba", 28 | "24": "Guelma", 29 | "25": "Constantine", 30 | "26": "Medea", 31 | "27": "Mostaganem", 32 | "28": "M'Sila", 33 | "29": "Muaskar", 34 | "30": "Ouargla", 35 | "31": "Oran", 36 | "32": "El Bayadh", 37 | "33": "Illizi", 38 | "34": "Bordj Bou Arreridj", 39 | "35": "Boumerdes", 40 | "36": "El Tarf", 41 | "37": "Tindouf", 42 | "38": "Tissemsilt", 43 | "39": "El Oued", 44 | "40": "Khenchela", 45 | "41": "Souk Ahras", 46 | "42": "Tipaza", 47 | "43": "Mila", 48 | "44": "Ain Defla", 49 | "45": "Naama", 50 | "46": "Ain Temouchent", 51 | "47": "Ghardaia", 52 | "48": "Relizane" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /data/iso_3166-2/EC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/EC/administrative-division-ecuador.html", 3 | "country": "Ecuador", 4 | "subdivisions": { 5 | "A": "Azuay", 6 | "B": "Bolivar", 7 | "C": "Carchi", 8 | "D": "Orellana", 9 | "E": "Esmeraldas", 10 | "F": "Canar", 11 | "G": "Guayas", 12 | "H": "Chimborazo", 13 | "I": "Imbabura", 14 | "L": "Loja", 15 | "M": "Manabi", 16 | "N": "Napo", 17 | "O": "El Oro", 18 | "P": "Pichincha", 19 | "R": "Los Rios", 20 | "S": "Morona-Santiago", 21 | "SD": "Santo Domingo de los Tsáchilas", 22 | "SE": "Santa Elena", 23 | "T": "Tungurahua", 24 | "U": "Sucumbios", 25 | "W": "Galapagos", 26 | "X": "Cotopaxi", 27 | "Y": "Pastaza", 28 | "Z": "Zamora-Chinchipe" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /data/iso_3166-2/EE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/EE/administrative-division-estonia.html", 3 | "country": "Estonia", 4 | "subdivisions": { 5 | "37": "Harju County", 6 | "39": "Hiiu County", 7 | "44": "Ida-Viru County", 8 | "49": "Jõgeva County", 9 | "51": "Järva County", 10 | "57": "Lääne County", 11 | "59": "Lääne-Viru County", 12 | "65": "Põlva County", 13 | "67": "Pärnu County", 14 | "70": "Rapla County", 15 | "74": "Saare County", 16 | "78": "Tartu County", 17 | "82": "Valga County", 18 | "84": "Viljandi County", 19 | "86": "Võru County" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/EG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/EG/administrative-division-egypt.html", 3 | "country": "Egypt", 4 | "subdivisions": { 5 | "ALX": "Al Iskandariyah", 6 | "ASN": "Aswan", 7 | "AST": "Asyut", 8 | "BA": "Al Bahr al Ahmar", 9 | "BH": "Al Buhayrah", 10 | "BNS": "Bani Suwayf", 11 | "C": "Al Qahirah", 12 | "DK": "Ad Daqahliyah", 13 | "DT": "Dumyat", 14 | "FYM": "Al Fayyum", 15 | "GH": "Al Gharbiyah", 16 | "GZ": "Al Jizah", 17 | "IS": "Al Isma'iliyah", 18 | "JS": "Janub Sina'", 19 | "KB": "Al Qalyubiyah", 20 | "KFS": "Kafr ash Shaykh", 21 | "KN": "Qina", 22 | "LX": "Al Uqşur", 23 | "MN": "Al Minya", 24 | "MNF": "Al Minufiyah", 25 | "MT": "Matruh", 26 | "PTS": "Bur Sa'id", 27 | "SHG": "Suhaj", 28 | "SHR": "Ash Sharqiyah", 29 | "SIN": "Shamal Sina'", 30 | "SUZ": "As Suways", 31 | "WAD": "Al Wadi al Jadid" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /data/iso_3166-2/EH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/EH/administrative-division-western-sahara.html", 3 | "country": "Western Sahara", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/ER.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ER/administrative-division-eritrea.html", 3 | "country": "Eritrea", 4 | "subdivisions": { 5 | "AN": "Anseba (Keren)", 6 | "DK": "Southern Red Sea (Debub-Keih-Bahri)", 7 | "DU": "Southern (Debub)", 8 | "GB": "Gash-Barka (Barentu)", 9 | "MA": "Central (Maekel)", 10 | "SK": "Northern Red Sea (Semien-Keih-Bahri)" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/ET.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ET/administrative-division-ethiopia.html", 3 | "country": "Ethiopia", 4 | "subdivisions": { 5 | "AA": "Addis Ababa", 6 | "AF": "Afar", 7 | "AM": "Amhara", 8 | "BE": "Benishangul-Gumaz", 9 | "DD": "Dire Dawa", 10 | "GA": "Gambela", 11 | "HA": "Hariai", 12 | "OR": "Oromia", 13 | "SN": "Southern Nations - Nationalities and Peoples Region", 14 | "SO": "Somali", 15 | "TI": "Tigray" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/FI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/FI/administrative-division-finland.html", 3 | "country": "Finland", 4 | "subdivisions": { 5 | "01": "Ahvenanmaa [Finnish] / Åland [Swedish]", 6 | "02": "Etelä-Karjala [Finnish] / Södra Karelen [Swedish]", 7 | "03": "Etelä-Pohjanmaa [Finnish] / Södra Österbotten [Swedish]", 8 | "04": "Etelä-Savo [Finnish] / Södra Savolax [Swedish]", 9 | "05": "Kainuu [Finnish] / Kajanaland [Swedish]", 10 | "06": "Kanta-Häme [Finnish] / Egentliga Tavastland [Swedish]", 11 | "07": "Keski-Pohjanmaa [Finnish] / Mellersta Österbotten [Swedish]", 12 | "08": "Keski-Suomi [Finnish] / Mellersta Finland [Swedish]", 13 | "09": "Kymenlaakso [Finnish] / Kymmenedalen [Swedish]", 14 | "10": "Lappi [Finnish] / Lappland [Swedish]", 15 | "11": "Pirkanmaa [Finnish] / Birkaland [Swedish]", 16 | "12": "Pohjanmaa [Finnish] / Österbotten [Swedish]", 17 | "13": "Pohjois-Karjala [Finnish] / Norra Karelen [Swedish]", 18 | "14": "Pohjois-Pohjanmaa [Finnish] / Norra Österbotten [Swedish]", 19 | "15": "Pohjois-Savo [Finnish] / Norra Savolax [Swedish]", 20 | "16": "Päijät-Häme [Finnish] / Päijänne-Tavastland [Swedish]", 21 | "17": "Satakunta [Finnish and Swedish]", 22 | "18": "Uusimaa [Finnish] / Nyland [Swedish]", 23 | "19": "Varsinais-Suomi [Finnish] / Egentliga Finland [Swedish]" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /data/iso_3166-2/FJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/FJ/administrative-division-fiji.html", 3 | "country": "Fiji", 4 | "subdivisions": { 5 | "01": "Ba Province", 6 | "02": "Bua Province", 7 | "03": "Cakaudrove Province", 8 | "04": "Kadavu Province", 9 | "05": "Lau Province", 10 | "06": "Lomaiviti Province", 11 | "07": "Mathuata Province", 12 | "08": "Nandronga and Navosa Province", 13 | "09": "Naitasiri Province", 14 | "10": "Namosi Province", 15 | "11": "Ra Province", 16 | "12": "Rewa Province", 17 | "13": "Serua Province", 18 | "14": "Tailevu Province", 19 | "C": "Central Division", 20 | "E": "Eastern Division", 21 | "N": "Northern Division", 22 | "R": "Rotuma", 23 | "W": "Western Division" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /data/iso_3166-2/FK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/FK/administrative-division-falkland-islands.html", 3 | "country": "Falkland Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/FM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/FM/administrative-division-micronesia.html", 3 | "country": "Micronesia", 4 | "subdivisions": { 5 | "KSA": "Kosrae", 6 | "PNI": "Pohnpei", 7 | "TRK": "Chuuk", 8 | "YAP": "Yap" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/FO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/FO/administrative-division-faroe-islands.html", 3 | "country": "Faroe Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GA/administrative-division-gabon.html", 3 | "country": "Gabon", 4 | "subdivisions": { 5 | "1": "Estuaire", 6 | "2": "Haut-Ogooue", 7 | "3": "Moyen-Ogooue", 8 | "4": "Ngounie", 9 | "5": "Nyanga", 10 | "6": "Ogooue-Ivindo", 11 | "7": "Ogooue-Lolo", 12 | "8": "Ogooue-Maritime", 13 | "9": "Woleu-Ntem" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/GD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GD/administrative-division-grenada.html", 3 | "country": "Grenada", 4 | "subdivisions": { 5 | "01": "Saint Andrew", 6 | "02": "Saint David", 7 | "03": "Saint George", 8 | "04": "Saint John", 9 | "05": "Saint Mark", 10 | "06": "Saint Patrick", 11 | "10": "Southern Grenadine Islands" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /data/iso_3166-2/GE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GE/administrative-division-georgia.html", 3 | "country": "Georgia", 4 | "subdivisions": { 5 | "AB": "Abkhazia", 6 | "AJ": "Ajaria", 7 | "GU": "Guria", 8 | "IM": "Imereti", 9 | "KA": "Kakheti", 10 | "KK": "Kvemo Kartli", 11 | "MM": "Mtskheta-Mtianeti", 12 | "RL": "Racha Lechkhumi and Kvemo Svaneti", 13 | "SJ": "Samtskhe-Javakheti", 14 | "SK": "Shida Kartli", 15 | "SZ": "Samegrelo-Zemo Svaneti", 16 | "TB": "Tbilisi" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/GF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GF/administrative-division-french-guiana.html", 3 | "country": "French Guiana", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GG/administrative-division-guernsey.html", 3 | "country": "Guernsey", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GH/administrative-division-ghana.html", 3 | "country": "Ghana", 4 | "subdivisions": { 5 | "AA": "Greater Accra Region", 6 | "AH": "Ashanti Region", 7 | "BA": "Brong-Ahafo Region", 8 | "CP": "Central Region", 9 | "EP": "Eastern Region", 10 | "NP": "Northern Region", 11 | "TV": "Volta Region", 12 | "UE": "Upper East Region", 13 | "UW": "Upper West Region", 14 | "WP": "Western Region" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/GI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GI/administrative-division-gibraltar.html", 3 | "country": "Gibraltar", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GL/administrative-division-greenland.html", 3 | "country": "Greenland", 4 | "subdivisions": { 5 | "AV": "Avannaata", 6 | "KU": "Kujalleq", 7 | "QE": "Qeqqata", 8 | "QT": "Qeqertalik", 9 | "SM": "Sermersooq" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/GM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GM/administrative-division-gambia.html", 3 | "country": "Gambia", 4 | "subdivisions": { 5 | "B": "Banjul", 6 | "L": "Lower River", 7 | "M": "Central River", 8 | "N": "North Bank", 9 | "U": "Upper River", 10 | "W": "Western" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/GN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GN/administrative-division-guinea.html", 3 | "country": "Guinea", 4 | "subdivisions": { 5 | "B": "Boké", 6 | "BE": "Beyla", 7 | "BF": "Boffa", 8 | "BK": "Boke", 9 | "C": "Conakry", 10 | "CO": "Coyah", 11 | "D": "Kindia", 12 | "DB": "Dabola", 13 | "DI": "Dinguiraye", 14 | "DL": "Dalaba", 15 | "DU": "Dubreka", 16 | "F": "Faranah", 17 | "FA": "Faranah", 18 | "FO": "Forecariah", 19 | "FR": "Fria", 20 | "GA": "Gaoual", 21 | "GU": "Gueckedou", 22 | "K": "Kankan", 23 | "KA": "Kankan", 24 | "KB": "Koubia", 25 | "KD": "Kindia", 26 | "KE": "Kerouane", 27 | "KN": "Koundara", 28 | "KO": "Kouroussa", 29 | "KS": "Kissidougou", 30 | "L": "Labé", 31 | "LA": "Labe", 32 | "LE": "Lelouma", 33 | "LO": "Lola", 34 | "M": "Mamou", 35 | "MC": "Macenta", 36 | "MD": "Mandiana", 37 | "ML": "Mali", 38 | "MM": "Mamou", 39 | "N": "Nzérékoré", 40 | "NZ": "Nzerekore", 41 | "PI": "Pita", 42 | "SI": "Siguiri", 43 | "TE": "Telimele", 44 | "TO": "Tougue", 45 | "YO": "Yomou" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /data/iso_3166-2/GP.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GP/administrative-division-guadeloupe.html", 3 | "country": "Guadeloupe", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GQ/administrative-division-equatorial-guinea.html", 3 | "country": "Equatorial Guinea", 4 | "subdivisions": { 5 | "AN": "Provincia Annobon", 6 | "BN": "Provincia Bioko Norte", 7 | "BS": "Provincia Bioko Sur", 8 | "C": "Región Continental", 9 | "CS": "Provincia Centro Sur", 10 | "I": "Región Insular", 11 | "KN": "Provincia Kie-Ntem", 12 | "LI": "Provincia Litoral", 13 | "WN": "Provincia Wele-Nzas" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/GS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GS/administrative-division-south-georgia-and-the-south-sandwich-islands.html", 3 | "country": "South Georgia and the South Sandwich Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GT/administrative-division-guatemala.html", 3 | "country": "Guatemala", 4 | "subdivisions": { 5 | "AV": "Alta Verapaz", 6 | "BV": "Baja Verapaz", 7 | "CM": "Chimaltenango", 8 | "CQ": "Chiquimula", 9 | "ES": "Escuintla", 10 | "GU": "Guatemala", 11 | "HU": "Huehuetenango", 12 | "IZ": "Izabal", 13 | "JA": "Jalapa", 14 | "JU": "Jutiapa", 15 | "PE": "El Peten", 16 | "PR": "El Progreso", 17 | "QC": "El Quiche", 18 | "QZ": "Quetzaltenango", 19 | "RE": "Retalhuleu", 20 | "SA": "Sacatepequez", 21 | "SM": "San Marcos", 22 | "SO": "Solola", 23 | "SR": "Santa Rosa", 24 | "SU": "Suchitepequez", 25 | "TO": "Totonicapan", 26 | "ZA": "Zacapa" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/GU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GU/administrative-division-guam.html", 3 | "country": "Guam", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/GW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GW/administrative-division-guinea-bissau.html", 3 | "country": "Guinea-Bissau", 4 | "subdivisions": { 5 | "BA": "Bafata Region", 6 | "BL": "Bolama Region", 7 | "BM": "Biombo Region", 8 | "BS": "Bissau Region", 9 | "CA": "Cacheu Region", 10 | "GA": "Gabu Region", 11 | "L": "Leste", 12 | "N": "Norte", 13 | "OI": "Oio Region", 14 | "QU": "Quinara Region", 15 | "S": "Sul", 16 | "TO": "Tombali Region" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/GY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/GY/administrative-division-guyana.html", 3 | "country": "Guyana", 4 | "subdivisions": { 5 | "BA": "Barima-Waini", 6 | "CU": "Cuyuni-Mazaruni", 7 | "DE": "Demerara-Mahaica", 8 | "EB": "East Berbice-Corentyne", 9 | "ES": "Essequibo Islands-West Demerara", 10 | "MA": "Mahaica-Berbice", 11 | "PM": "Pomeroon-Supenaam", 12 | "PT": "Potaro-Siparuni", 13 | "UD": "Upper Demerara-Berbice", 14 | "UT": "Upper Takutu-Upper Essequibo" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/HK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HK/administrative-division-hong-kong.html", 3 | "country": "Hong Kong", 4 | "subdivisions": { 5 | "HCW": "Central and Western Hong Kong Island", 6 | "HEA": "Eastern Hong Kong Island", 7 | "HSO": "Southern Hong Kong Island", 8 | "HWC": "Wan Chai Hong Kong Island", 9 | "KKC": "Kowloon City Kowloon", 10 | "KKT": "Kwun Tong Kowloon", 11 | "KSS": "Sham Shui Po Kowloon", 12 | "KWT": "Wong Tai Sin Kowloon", 13 | "KYT": "Yau Tsim Mong Kowloon", 14 | "NIS": "Islands New Territories", 15 | "NKT": "Kwai Tsing New Territories", 16 | "NNO": "North New Territories", 17 | "NSK": "Sai Kung New Territories", 18 | "NST": "Sha Tin New Territories", 19 | "NTM": "Tuen Mun New Territories", 20 | "NTP": "Tai Po New Territories", 21 | "NTW": "Tsuen Wan New Territories", 22 | "NYL": "Yuen Long New Territories" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/HM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HM/administrative-division-heard-island-and-mcdonald-islands.html", 3 | "country": "Heard Island and McDonald Islands", 4 | "subdivisions": { 5 | "F": "Flat Island", 6 | "H": "Heard Island", 7 | "M": "McDonald Island", 8 | "S": "Shag Island" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/HN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HN/administrative-division-honduras.html", 3 | "country": "Honduras", 4 | "subdivisions": { 5 | "AT": "Atlantida", 6 | "CH": "Choluteca", 7 | "CL": "Colon", 8 | "CM": "Comayagua", 9 | "CP": "Copan", 10 | "CR": "Cortes", 11 | "EP": "El Paraiso", 12 | "FM": "Francisco Morazan", 13 | "GD": "Gracias a Dios", 14 | "IB": "Islas de la Bahia (Bay Islands)", 15 | "IN": "Intibuca", 16 | "LE": "Lempira", 17 | "LP": "La Paz", 18 | "OC": "Ocotepeque", 19 | "OL": "Olancho", 20 | "SB": "Santa Barbara", 21 | "VA": "Valle", 22 | "YO": "Yoro" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/HR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HR/administrative-division-croatia.html", 3 | "country": "Croatia", 4 | "subdivisions": { 5 | "01": "Zagreb county", 6 | "02": "Krapina-Zagorje county", 7 | "03": "Sisak-Moslavina county", 8 | "04": "Karlovac county", 9 | "05": "Varazdin county", 10 | "06": "Koprivnica-Krizevci county", 11 | "07": "Bjelovar-Bilogora county", 12 | "08": "Primorje-Gorski Kotar county", 13 | "09": "Lika-Senj county", 14 | "10": "Virovitica-Podravina county", 15 | "11": "Pozega-Slavonia county", 16 | "12": "Brod-Posavina county", 17 | "13": "Zadar county", 18 | "14": "Osijek-Baranja county", 19 | "15": "Sibenik-Knin county", 20 | "16": "Vukovar-Srijem county", 21 | "17": "Split-Dalmatia county", 22 | "18": "Istria county", 23 | "19": "Dubrovnik-Neretva county", 24 | "20": "Medjimurje county", 25 | "21": "Zagreb (city)" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /data/iso_3166-2/HT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HT/administrative-division-haiti.html", 3 | "country": "Haiti", 4 | "subdivisions": { 5 | "AR": "Artibonite", 6 | "CE": "Centre", 7 | "GA": "Grand'Anse", 8 | "ND": "Nord", 9 | "NE": "Nord-Est", 10 | "NI": "Nippes", 11 | "NO": "Nord-Ouest", 12 | "OU": "Ouest", 13 | "SD": "Sud", 14 | "SE": "Sud-Est" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/HU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/HU/administrative-division-hungary.html", 3 | "country": "Hungary", 4 | "subdivisions": { 5 | "BA": "Baranya megye", 6 | "BC": "Békéscsaba", 7 | "BE": "Békés megye", 8 | "BK": "Bács-Kiskun megye", 9 | "BU": "Budapest főváros", 10 | "BZ": "Borsod-Abaúj-Zemplén megye", 11 | "CS": "Csongrád megye", 12 | "DE": "Debrecen", 13 | "DU": "Dunaújváros", 14 | "EG": "Eger", 15 | "ER": "Erd", 16 | "FE": "Fejér megye", 17 | "GS": "Győr-Moson-Sopron megye", 18 | "GY": "Győr", 19 | "HB": "Hajdú-Bihar megye", 20 | "HE": "Heves megye", 21 | "HV": "Hódmezővásárhely", 22 | "JN": "Jász-Nagykun-Szolnok megye", 23 | "KE": "Komárom-Esztergom megye", 24 | "KM": "Kecskemét", 25 | "KV": "Kaposvár", 26 | "MI": "Miskolc", 27 | "NK": "Nagykanizsa", 28 | "NO": "Nógrád megye", 29 | "NY": "Nyíregyháza", 30 | "PE": "Pest megye", 31 | "PS": "Pécs", 32 | "SD": "Szeged", 33 | "SF": "Székesfehérvár", 34 | "SH": "Szombathely", 35 | "SK": "Szolnok", 36 | "SN": "Sopron", 37 | "SO": "Somogy megye", 38 | "SS": "Szekszárd", 39 | "ST": "Salgótarján", 40 | "SZ": "Szabolcs-Szatmár-Bereg megye", 41 | "TB": "Tatabánya", 42 | "TO": "Tolna megye", 43 | "VA": "Vas megye", 44 | "VE": "Veszprém megye", 45 | "VM": "Veszprém", 46 | "ZA": "Zala megye", 47 | "ZE": "Zalaegerszeg" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /data/iso_3166-2/ID.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ID/administrative-division-indonesia.html", 3 | "country": "Indonesia", 4 | "subdivisions": { 5 | "AC": "Aceh", 6 | "BA": "Bali", 7 | "BB": "Bangka-Belitung", 8 | "BE": "Bengkulu", 9 | "BT": "Banten", 10 | "GO": "Gorontalo", 11 | "JA": "Jambi", 12 | "JB": "Jawa Barat", 13 | "JI": "Jawa Timur", 14 | "JK": "Jakarta Raya", 15 | "JT": "Jawa Tengah", 16 | "JW": "Java", 17 | "KA": "Kalimantan", 18 | "KB": "Kalimantan Barat", 19 | "KI": "Kalimantan Timur", 20 | "KR": "Kepulauan Riau", 21 | "KS": "Kalimantan Selatan", 22 | "KT": "Kalimantan Tengah", 23 | "KU": "Kalimantan Utara", 24 | "LA": "Lampung", 25 | "MA": "Maluku", 26 | "ML": "Maluku", 27 | "MU": "Maluku Utara", 28 | "NB": "Nusa Tenggara Barat", 29 | "NT": "Nusa Tenggara Timur", 30 | "NU": "Nusa Tenggara", 31 | "PA": "Papua", 32 | "PB": "Papua Barat", 33 | "PP": "Papua", 34 | "RI": "Riau", 35 | "SA": "Sulawesi Utara", 36 | "SB": "Sumatera Barat", 37 | "SG": "Sulawesi Tenggara", 38 | "SL": "Sulawesi", 39 | "SM": "Sumatera", 40 | "SN": "Sulawesi Selatan", 41 | "SR": "Sulawesi Barat", 42 | "SS": "Sumatera Selatan", 43 | "ST": "Sulawesi Tengah", 44 | "SU": "Sumatera Utara", 45 | "YO": "Yogyakarta" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /data/iso_3166-2/IE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IE/administrative-division-ireland.html", 3 | "country": "Ireland", 4 | "subdivisions": { 5 | "C": "Connaught", 6 | "CE": "Clare", 7 | "CN": "Cavan", 8 | "CO": "Cork", 9 | "CW": "Carlow", 10 | "DL": "Donegal", 11 | "G": "Galway", 12 | "KE": "Kildare", 13 | "KK": "Kilkenny", 14 | "KY": "Kerry", 15 | "L": "Leinster", 16 | "LD": "Longford", 17 | "LH": "Louth", 18 | "LK": "Limerick, City and County", 19 | "LM": "Leitrim", 20 | "LS": "Laois", 21 | "M": "Munster", 22 | "MH": "Meath", 23 | "MN": "Monaghan", 24 | "MO": "Mayo", 25 | "OY": "Offaly", 26 | "RN": "Roscommon", 27 | "SO": "Sligo", 28 | "TA": "Tipperary", 29 | "U": "Ulster", 30 | "WD": "Waterford, City and County", 31 | "WH": "Westmeath", 32 | "WW": "Wicklow", 33 | "WX": "Wexford" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /data/iso_3166-2/IL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IL/administrative-division-israel.html", 3 | "country": "Israel", 4 | "subdivisions": { 5 | "D": "Southern", 6 | "HA": "Haifa", 7 | "JM": "Jerusalem", 8 | "M": "Central", 9 | "TA": "Tel Aviv", 10 | "Z": "Northern" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/IM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IM/administrative-division-isle-of-man.html", 3 | "country": "Isle of Man", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/IN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IN/administrative-division-india.html", 3 | "country": "India", 4 | "subdivisions": { 5 | "AN": "Andaman and Nicobar Islands", 6 | "AP": "Andhra Pradesh", 7 | "AR": "Arunachal Pradesh", 8 | "AS": "Assam", 9 | "BR": "Bihar", 10 | "CH": "Chandigarh", 11 | "CT": "Chhattisgarh", 12 | "DD": "Daman and Diu", 13 | "DL": "Delhi", 14 | "DN": "Dadra and Nagar Haveli", 15 | "GA": "Goa", 16 | "GJ": "Gujarat", 17 | "HP": "Himachal Pradesh", 18 | "HR": "Haryana", 19 | "JH": "Jharkhand", 20 | "JK": "Jammu and Kashmir", 21 | "KA": "Karnataka", 22 | "KL": "Kerala", 23 | "LD": "Lakshadweep", 24 | "MH": "Maharashtra", 25 | "ML": "Meghalaya", 26 | "MN": "Manipur", 27 | "MP": "Madhya Pradesh", 28 | "MZ": "Mizoram", 29 | "NL": "Nagaland", 30 | "OR": "Orissa", 31 | "PB": "Punjab", 32 | "PY": "Pondicherry", 33 | "RJ": "Rajasthan", 34 | "SK": "Sikkim", 35 | "TG": "Telangana", 36 | "TN": "Tamil Nadu", 37 | "TR": "Tripura", 38 | "UP": "Uttar Pradesh", 39 | "UT": "Uttarakhand", 40 | "WB": "West Bengal" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /data/iso_3166-2/IO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IO/administrative-division-british-indian-ocean-territory.html", 3 | "country": "British Indian Ocean Territory", 4 | "subdivisions": { 5 | "DG": "Diego Garcia", 6 | "DI": "Danger Island", 7 | "EA": "Eagle Islands", 8 | "EG": "Egmont Islands", 9 | "NI": "Nelsons Island", 10 | "PB": "Peros Banhos", 11 | "SI": "Salomon Islands", 12 | "TB": "Three Brothers" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/IQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IQ/administrative-division-iraq.html", 3 | "country": "Iraq", 4 | "subdivisions": { 5 | "AN": "Al Anbar", 6 | "AR": "Arbīl", 7 | "BA": "Al Basrah", 8 | "BB": "Babil", 9 | "BG": "Baghdad", 10 | "DA": "Dahūk", 11 | "DI": "Diyala", 12 | "DQ": "Dhi Qar", 13 | "KA": "Al Karbala", 14 | "KI": "Kirkūk", 15 | "MA": "Maysan", 16 | "MU": "Al Muthanna", 17 | "NA": "An Najaf", 18 | "NI": "Ninawa", 19 | "QA": "Al Qadisyah", 20 | "SD": "Salah ad Din", 21 | "SU": "As Sulaymānīyah", 22 | "WA": "Wasit" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/IR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IR/administrative-division-iran.html", 3 | "country": "Iran", 4 | "subdivisions": { 5 | "01": "East Azarbaijan", 6 | "02": "West Azarbaijan", 7 | "03": "Ardabil", 8 | "04": "Esfahan", 9 | "05": "Ilam", 10 | "06": "Bushehr", 11 | "07": "Tehran", 12 | "08": "Chahar Mahaal and Bakhtiari", 13 | "10": "Khuzestan", 14 | "11": "Zanjan", 15 | "12": "Semnan", 16 | "13": "Sistan and Baluchistan", 17 | "14": "Fars", 18 | "15": "Kerman", 19 | "16": "Kurdistan", 20 | "17": "Kermanshah", 21 | "18": "Kohkiluyeh and Buyer Ahmad", 22 | "19": "Gilan", 23 | "20": "Lorestan", 24 | "21": "Mazandaran", 25 | "22": "Markazi", 26 | "23": "Hormozgan", 27 | "24": "Hamadan", 28 | "25": "Yazd", 29 | "26": "Qom", 30 | "27": "Golestan", 31 | "28": "Qazvin", 32 | "29": "South Khorasan", 33 | "30": "Razavi Khorasan", 34 | "31": "North Khorasan", 35 | "32": "Alborz" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /data/iso_3166-2/IS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/IS/administrative-division-iceland.html", 3 | "country": "Iceland", 4 | "subdivisions": { 5 | "1": "Höfuðborgarsvæði", 6 | "2": "Suðurnes", 7 | "3": "Vesturland", 8 | "4": "Vestfirðir", 9 | "5": "Norðurland Vestra", 10 | "6": "Norðurland Eystra", 11 | "7": "Austurland", 12 | "8": "Suðurland" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/JE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/JE/administrative-division-jersey.html", 3 | "country": "Jersey", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/JM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/JM/administrative-division-jamaica.html", 3 | "country": "Jamaica", 4 | "subdivisions": { 5 | "01": "Kingston Parish", 6 | "02": "Saint Andrew Parish", 7 | "03": "Saint Thomas Parish", 8 | "04": "Portland Parish", 9 | "05": "Saint Mary Parish", 10 | "06": "Saint Ann Parish", 11 | "07": "Trelawny Parish", 12 | "08": "Saint James Parish", 13 | "09": "Hanover Parish", 14 | "10": "Westmoreland Parish", 15 | "11": "Saint Elizabeth Parish", 16 | "12": "Manchester Parish", 17 | "13": "Clarendon Parish", 18 | "14": "Saint Catherine Parish" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/JO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/JO/administrative-division-jordan.html", 3 | "country": "Jordan", 4 | "subdivisions": { 5 | "AJ": "Ajlun", 6 | "AM": "'Amman", 7 | "AQ": "Al 'Aqabah", 8 | "AT": "At Tafilah", 9 | "AZ": "Az Zarqa'", 10 | "BA": "Al Balqa'", 11 | "IR": "Irbid", 12 | "JA": "Jarash", 13 | "KA": "Al Karak", 14 | "MA": "Al Mafraq", 15 | "MD": "Madaba", 16 | "MN": "Ma'an" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/JP.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/JP/administrative-division-japan.html", 3 | "country": "Japan", 4 | "subdivisions": { 5 | "01": "Hokkaidō", 6 | "02": "Aomori", 7 | "03": "Iwate", 8 | "04": "Miyagi", 9 | "05": "Akita", 10 | "06": "Yamagata", 11 | "07": "Hukusima (Fukushima)", 12 | "08": "Ibaraki", 13 | "09": "Totigi (Tochigi)", 14 | "10": "Gunma", 15 | "11": "Saitama", 16 | "12": "Tiba (Chiba)", 17 | "13": "Tokyo", 18 | "14": "Kanagawa", 19 | "15": "Niigata", 20 | "16": "Toyama", 21 | "17": "Isikawa (Ishikawa)", 22 | "18": "Hukui (Fukui)", 23 | "19": "Yamanasi (Yamanashi)", 24 | "20": "Nagano", 25 | "21": "Gihu (Gifu)", 26 | "22": "Sizuoka (Shizuoka)", 27 | "23": "Aiti (Aichi)", 28 | "24": "Mie", 29 | "25": "Siga (Shiga)", 30 | "26": "Kyoto", 31 | "27": "Osaka", 32 | "28": "Hyogo", 33 | "29": "Nara", 34 | "30": "Wakayama", 35 | "31": "Tottori", 36 | "32": "Simane (Shimane)", 37 | "33": "Okayama", 38 | "34": "Hirosima (Hiroshima)", 39 | "35": "Yamaguti (Yamaguchi)", 40 | "36": "Tokusima (Tokushima)", 41 | "37": "Kagawa", 42 | "38": "Ehime", 43 | "39": "Koti (Kochi)", 44 | "40": "Hukuoka (Fukuoka)", 45 | "41": "Saga", 46 | "42": "Nagasaki", 47 | "43": "Kumamoto", 48 | "44": "Oita", 49 | "45": "Miyazaki", 50 | "46": "Kagosima (Kagoshima)", 51 | "47": "Okinawa" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /data/iso_3166-2/KE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KE/administrative-division-kenya.html", 3 | "country": "Kenya", 4 | "subdivisions": { 5 | "01": "Baringo", 6 | "02": "Bomet", 7 | "03": "Bungoma", 8 | "04": "Busia", 9 | "05": "Elgeyo/Marakwet", 10 | "06": "Embu", 11 | "07": "Garissa", 12 | "08": "Homa Bay", 13 | "09": "Isiolo", 14 | "10": "Kajiado", 15 | "11": "Kakamega", 16 | "12": "Kericho", 17 | "13": "Kiambu", 18 | "14": "Kilifi", 19 | "15": "Kirinyaga", 20 | "16": "Kisii", 21 | "17": "Kisumu", 22 | "18": "Kitui", 23 | "19": "Kwale", 24 | "20": "Laikipia", 25 | "21": "Lamu", 26 | "22": "Machakos", 27 | "23": "Makueni", 28 | "24": "Mandera", 29 | "25": "Marsabit", 30 | "26": "Meru", 31 | "27": "Migori", 32 | "28": "Mombasa", 33 | "29": "Murang’a", 34 | "30": "Nairobi", 35 | "31": "Nakuru", 36 | "32": "Nandi", 37 | "33": "Narok", 38 | "34": "Nyamira", 39 | "35": "Nyandarua", 40 | "36": "Nyeri", 41 | "37": "Samburu", 42 | "38": "Siaya", 43 | "39": "Taita/Taveta", 44 | "40": "Tana River", 45 | "41": "Tharak-Nithi", 46 | "42": "Trans Nzoia", 47 | "43": "Turkana", 48 | "44": "Uasin Gishu", 49 | "45": "Vihiga", 50 | "46": "Wajir", 51 | "47": "West Pokot" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /data/iso_3166-2/KG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KG/administrative-division-kyrgyzstan.html", 3 | "country": "Kyrgyzstan", 4 | "subdivisions": { 5 | "B": "Batken", 6 | "C": "Chu", 7 | "GB": "Bishkek", 8 | "GO": "Osh City", 9 | "J": "Jalal-Abad", 10 | "N": "Naryn", 11 | "O": "Osh", 12 | "T": "Talas", 13 | "Y": "Ysyk-Kol" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/KH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KH/administrative-division-cambodia.html", 3 | "country": "Cambodia", 4 | "subdivisions": { 5 | "1": "Banteay Mean Choay", 6 | "10": "Kratie", 7 | "11": "Mondul Kiri", 8 | "12": "Phnom Penh", 9 | "13": "Preah Vihear", 10 | "14": "Prey Veng", 11 | "15": "Pursat", 12 | "16": "Rôtânôkiri", 13 | "17": "Siemreap", 14 | "18": "Preah Seihanu (Kompong Som or Sihanoukville)", 15 | "19": "Stung Treng", 16 | "2": "Battambang", 17 | "20": "Svay Rieng", 18 | "21": "Takeo", 19 | "22": "Otdar Mean Choay", 20 | "23": "Keb", 21 | "24": "Pailin", 22 | "25": "Tboung Khmum", 23 | "3": "Kampong Cham", 24 | "4": "Kampong Chhnang", 25 | "5": "Kampong Speu", 26 | "6": "Kampong Thom", 27 | "7": "Kampot", 28 | "8": "Kandal", 29 | "9": "Kaoh Kong" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /data/iso_3166-2/KI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KI/administrative-division-kiribati.html", 3 | "country": "Kiribati", 4 | "subdivisions": { 5 | "G": "Gilbert Islands", 6 | "L": "Line Islands", 7 | "P": "Phoenix Islands" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/KM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KM/administrative-division-comoros.html", 3 | "country": "Comoros", 4 | "subdivisions": { 5 | "A": "Anjouan", 6 | "G": "Grande Comore", 7 | "M": "Moheli" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/KN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KN/administrative-division-saint-kitts-and-nevis.html", 3 | "country": "Saint Kitts and Nevis", 4 | "subdivisions": { 5 | "01": "Christ Church Nichola Town", 6 | "02": "Saint Anne Sandy Point", 7 | "03": "Saint George Basseterre", 8 | "04": "Saint George Gingerland", 9 | "05": "Saint James Windward", 10 | "06": "Saint John Capesterre", 11 | "07": "Saint John Figtree", 12 | "08": "Saint Mary Cayon", 13 | "09": "Saint Paul Capesterre", 14 | "10": "Saint Paul Charlestown", 15 | "11": "Saint Peter Basseterre", 16 | "12": "Saint Thomas Lowland", 17 | "13": "Saint Thomas Middle Island", 18 | "15": "Trinity Palmetto Point", 19 | "K": "Saint Kitts", 20 | "N": "Nevis" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/KP.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KP/administrative-division-north-korea.html", 3 | "country": "North Korea", 4 | "subdivisions": { 5 | "01": "P'yongyang Special City", 6 | "02": "P'yongan-namdo", 7 | "03": "P'yongan-bukto", 8 | "04": "Chagang-do", 9 | "05": "Hwanghae-namdo", 10 | "06": "Hwanghae-bukto", 11 | "07": "Kangwon-do", 12 | "08": "Hamgyong-namdo", 13 | "09": "Hamgyong-bukto", 14 | "10": "Ryanggang-do (Yanggang-do)", 15 | "13": "Nasŏn (Najin-Sŏnbong)" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/KR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KR/administrative-division-south-korea.html", 3 | "country": "South Korea", 4 | "subdivisions": { 5 | "11": "Seoul Special City", 6 | "26": "Busan Metropolitan City", 7 | "27": "Daegu Metropolitan City", 8 | "28": "Incheon Metropolitan City", 9 | "29": "Gwangju Metropolitan City", 10 | "30": "Daejeon Metropolitan City", 11 | "31": "Ulsan Metropolitan City", 12 | "41": "Gyeonggi-do", 13 | "42": "Gangwon-do", 14 | "43": "Chungcheongbuk-do", 15 | "44": "Chungcheongnam-do", 16 | "45": "Jeollabuk-do", 17 | "46": "Jeollanam-do", 18 | "47": "Gyeongsangbuk-do", 19 | "48": "Gyeongsangnam-do", 20 | "49": "Jeju-do", 21 | "50": "Sejong" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/KW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KW/administrative-division-kuwait.html", 3 | "country": "Kuwait", 4 | "subdivisions": { 5 | "AH": "Al Ahmadi", 6 | "FA": "Al Farwaniyah", 7 | "HA": "Hawalli", 8 | "JA": "Al Jahra", 9 | "KU": "Al Asimah", 10 | "MU": "Mubārak al Kabīr" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/KY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KY/administrative-division-cayman-islands.html", 3 | "country": "Cayman Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/KZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/KZ/administrative-division-kazakhstan.html", 3 | "country": "Kazakhstan", 4 | "subdivisions": { 5 | "AKM": "Aqmola", 6 | "AKT": "Aqtobe", 7 | "ALA": "Almaty", 8 | "ALM": "Almaty", 9 | "AST": "Astana", 10 | "ATY": "Atyrau", 11 | "BAY": "Baykonyr", 12 | "KAR": "Qaraghandy", 13 | "KUS": "Qustanay", 14 | "KZY": "Qyzylorda", 15 | "MAN": "Mangghystau", 16 | "PAV": "Paylodar", 17 | "SEV": "Soltustik Qazaqstan", 18 | "SHY": "Shymkent", 19 | "VOS": "Shyghys Qazaqstan", 20 | "YUZ": "Ongtustik Qazaqstan", 21 | "ZAP": "Baty Qazaqstan", 22 | "ZHA": "Zhambyl" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/LA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LA/administrative-division-laos.html", 3 | "country": "Laos", 4 | "subdivisions": { 5 | "AT": "Attapu", 6 | "BK": "Bokeo", 7 | "BL": "Bolikhamxai", 8 | "CH": "Champasak", 9 | "HO": "Houaphan", 10 | "KH": "Khammouan", 11 | "LM": "Louang Namtha", 12 | "LP": "Louangphabang", 13 | "OU": "Oudomxai", 14 | "PH": "Phongsali", 15 | "SL": "Salavan", 16 | "SV": "Savannakhet", 17 | "VI": "Vientiane", 18 | "VT": "Vientiane", 19 | "XA": "Xaignabouli", 20 | "XE": "Xekong", 21 | "XI": "Xiangkhoang", 22 | "XS": "Xaisômboun" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/LB.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LB/administrative-division-lebanon.html", 3 | "country": "Lebanon", 4 | "subdivisions": { 5 | "AK": "Aakkâr", 6 | "AS": "Liban-Nord", 7 | "BA": "Beyrouth", 8 | "BH": "Baalbek-Hermel", 9 | "BI": "Béqaa", 10 | "JA": "Liban-Sud", 11 | "JL": "Mont-Liban", 12 | "NA": "Nabatîyé" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/LC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LC/administrative-division-saint-lucia.html", 3 | "country": "Saint Lucia", 4 | "subdivisions": { 5 | "01": "Anse-la-Raye", 6 | "02": "Castries", 7 | "03": "Choiseul", 8 | "05": "Dennery", 9 | "06": "Gros-Islet", 10 | "07": "Laborie", 11 | "08": "Micoud", 12 | "10": "Soufriere", 13 | "11": "Vieux-Fort", 14 | "12": "Canaries" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/LI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LI/administrative-division-liechtenstein.html", 3 | "country": "Liechtenstein", 4 | "subdivisions": { 5 | "01": "Balzers", 6 | "02": "Eschen", 7 | "03": "Gamprin", 8 | "04": "Mauren", 9 | "05": "Planken", 10 | "06": "Ruggell", 11 | "07": "Schaan", 12 | "08": "Schellenberg", 13 | "09": "Triesen", 14 | "10": "Triesenberg", 15 | "11": "Vaduz" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/LK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LK/administrative-division-sri-lanka.html", 3 | "country": "Sri Lanka", 4 | "subdivisions": { 5 | "1": "Western", 6 | "11": "Kŏḷamba", 7 | "12": "Gampaha", 8 | "13": "Kaḷutara", 9 | "2": "Central", 10 | "21": "Mahanuvara", 11 | "22": "Mātale", 12 | "23": "Nuvara Ĕliya", 13 | "3": "Southern", 14 | "31": "Gālla", 15 | "32": "Mātara", 16 | "33": "Hambantŏṭa", 17 | "4": "Northern", 18 | "41": "Yāpanaya", 19 | "42": "Kilinŏchchi", 20 | "43": "Mannārama", 21 | "44": "Vavuniyāva", 22 | "45": "Mulativ", 23 | "5": "Eastern", 24 | "51": "Maḍakalapuva", 25 | "52": "Ampāra", 26 | "53": "Trikuṇāmalaya", 27 | "6": "North Western", 28 | "61": "Kuruṇægala", 29 | "62": "Puttalama", 30 | "7": "North Central", 31 | "71": "Anurādhapura", 32 | "72": "Pŏḷŏnnaruva", 33 | "8": "Uva", 34 | "81": "Badulla", 35 | "82": "Mŏṇarāgala", 36 | "9": "Sabaragamuwa", 37 | "91": "Ratnapura", 38 | "92": "Kægalla" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /data/iso_3166-2/LR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LR/administrative-division-liberia.html", 3 | "country": "Liberia", 4 | "subdivisions": { 5 | "BG": "Bong", 6 | "BM": "Bomi", 7 | "CM": "Grand Cape Mount", 8 | "GB": "Grand Bassa", 9 | "GG": "Grand Gedeh", 10 | "GK": "Grand Kru", 11 | "GP": "Gbarpolu", 12 | "LO": "Lofa", 13 | "MG": "Margibi", 14 | "MO": "Montserrado", 15 | "MY": "Maryland", 16 | "NI": "Nimba", 17 | "RG": "River Gee", 18 | "RI": "River Cess", 19 | "SI": "Sinoe" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/LS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LS/administrative-division-lesotho.html", 3 | "country": "Lesotho", 4 | "subdivisions": { 5 | "A": "Maseru", 6 | "B": "Butha-Buthe", 7 | "C": "Leribe", 8 | "D": "Berea", 9 | "E": "Mafeteng", 10 | "F": "Mohale's Hoek", 11 | "G": "Quthing", 12 | "H": "Qacha's Nek", 13 | "J": "Mokhotlong", 14 | "K": "Thaba-Tseka" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/LU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LU/administrative-division-luxembourg.html", 3 | "country": "Luxembourg", 4 | "subdivisions": { 5 | "CA": "Canton de Capellen", 6 | "CL": "Canton de Clervaux", 7 | "DI": "Canton de Diekirch", 8 | "EC": "Canton d'Echternach", 9 | "ES": "Canton d'Esch-sur-Alzette", 10 | "GR": "Canton de Grevenmacher", 11 | "LU": "Canton de Luxembourg", 12 | "ME": "Canton de Mersch", 13 | "RD": "Canton de Redange", 14 | "RM": "Canton de Remich", 15 | "VD": "Canton de Vianden", 16 | "WI": "Canton de Wiltz" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/LY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/LY/administrative-division-libya.html", 3 | "country": "Libya", 4 | "subdivisions": { 5 | "BA": "Banghazi", 6 | "BU": "Al Buţnān", 7 | "DR": "Darnah", 8 | "GT": "Ghāt", 9 | "JA": "Al Jabal al Akhdar", 10 | "JG": "Al Jabal al Gharbī", 11 | "JI": "Al Jifārah", 12 | "JU": "Al Jufrah", 13 | "KF": "Al Kufrah", 14 | "MB": "Al Marqab", 15 | "MI": "Misratah", 16 | "MJ": "Al Maraj", 17 | "MQ": "Murzuq", 18 | "NL": "Nālūt", 19 | "NQ": "An Nuqat al Khams", 20 | "SB": "Sabha", 21 | "SR": "Surt", 22 | "TB": "Ţarābulus", 23 | "WA": "Al Wāḩāt", 24 | "WD": "Wādī al Ḩayāt", 25 | "WS": "Wādī ash Shāţi´", 26 | "ZA": "Az Zawiyah" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/MC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MC/administrative-division-monaco.html", 3 | "country": "Monaco", 4 | "subdivisions": { 5 | "CL": "La Colle", 6 | "CO": "La Condamine", 7 | "FO": "Fontvieille", 8 | "GA": "La Gare", 9 | "JE": "Jardin Exotique", 10 | "LA": "Larvotto", 11 | "MA": "Malbousquet", 12 | "MC": "Monte-Carlo", 13 | "MG": "Moneghetti", 14 | "MO": "Monaco-Ville", 15 | "MU": "Moulins", 16 | "PH": "Port-Hercule", 17 | "SD": "Sainte-Dévote", 18 | "SO": "La Source", 19 | "SP": "Spélugues", 20 | "SR": "Saint-Roman", 21 | "VR": "Vallon de la Rousse" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/MD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MD/administrative-division-moldova.html", 3 | "country": "Moldova", 4 | "subdivisions": { 5 | "AN": "Raionul Anenii Noi", 6 | "BA": "Municipiul Bălţi", 7 | "BD": "Tighina", 8 | "BR": "Raionul Briceni", 9 | "BS": "Raionul Basarabeasca", 10 | "CA": "Cahul", 11 | "CL": "Raionul Călăraşi", 12 | "CM": "Raionul Cimişlia", 13 | "CR": "Raionul Criuleni", 14 | "CS": "Raionul Căuşeni", 15 | "CT": "Raionul Cantemir", 16 | "CU": "Municipiul Chişinău", 17 | "DO": "Donduşeni", 18 | "DR": "Raionul Drochia", 19 | "DU": "Dubăsari", 20 | "ED": "Raionul Edineţ", 21 | "FA": "Făleşti", 22 | "FL": "Floreşti", 23 | "GA": "U.T.A. Găgăuzia", 24 | "GL": "Raionul Glodeni", 25 | "HI": "Hînceşti", 26 | "IA": "Ialoveni", 27 | "LE": "Leova", 28 | "NI": "Nisporeni", 29 | "OC": "Raionul Ocniţa", 30 | "OR": "Raionul Orhei", 31 | "RE": "Rezina", 32 | "RI": "Rîşcani", 33 | "SD": "Raionul Şoldăneşti", 34 | "SI": "Sîngerei", 35 | "SN": "Stînga Nistrului", 36 | "SO": "Soroca", 37 | "ST": "Raionul Străşeni", 38 | "SV": "Raionul Ştefan Vodă", 39 | "TA": "Raionul Taraclia", 40 | "TE": "Teleneşti", 41 | "UN": "Raionul Ungheni" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /data/iso_3166-2/ME.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ME/administrative-division-montenegro.html", 3 | "country": "Montenegro", 4 | "subdivisions": { 5 | "01": "Opština Andrijevica", 6 | "02": "Opština Bar", 7 | "03": "Opština Berane", 8 | "04": "Opština Bijelo Polje", 9 | "05": "Opština Budva", 10 | "06": "Opština Cetinje", 11 | "07": "Opština Danilovgrad", 12 | "08": "Opština Herceg-Novi", 13 | "09": "Opština Kolašin", 14 | "10": "Opština Kotor", 15 | "11": "Opština Mojkovac", 16 | "12": "Opština Nikšić", 17 | "13": "Opština Plav", 18 | "14": "Opština Pljevlja", 19 | "15": "Opština Plužine", 20 | "16": "Opština Podgorica", 21 | "17": "Opština Rožaje", 22 | "18": "Opština Šavnik", 23 | "19": "Opština Tivat", 24 | "20": "Opština Ulcinj", 25 | "21": "Opština Žabljak", 26 | "22": "Gusinje", 27 | "23": "Petnjica" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /data/iso_3166-2/MF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MF/administrative-division-saint-martin.html", 3 | "country": "Saint Martin", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/MG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MG/administrative-division-madagascar.html", 3 | "country": "Madagascar", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/MH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MH/administrative-division-marshall-islands.html", 3 | "country": "Marshall Islands", 4 | "subdivisions": { 5 | "ALK": "Ailuk", 6 | "ALL": "Ailinglaplap", 7 | "ARN": "Arno", 8 | "AUR": "Aur", 9 | "EBO": "Ebon", 10 | "ENI": "Enewetak", 11 | "JAB": "Jabat", 12 | "JAL": "Jaluit", 13 | "KIL": "Kili", 14 | "KWA": "Kwajalein", 15 | "L": "Ralik chain", 16 | "LAE": "Lae", 17 | "LIB": "Lib", 18 | "LIK": "Likiep", 19 | "MAJ": "Majuro", 20 | "MAL": "Maloelap", 21 | "MEJ": "Mejit", 22 | "MIL": "Mili", 23 | "NMK": "Namorik", 24 | "NMU": "Namu", 25 | "RON": "Rongelap", 26 | "T": "Ratak chain", 27 | "UJA": "Ujae", 28 | "UTI": "Utirik", 29 | "WTH": "Wotho", 30 | "WTJ": "Wotje" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /data/iso_3166-2/ML.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ML/administrative-division-mali.html", 3 | "country": "Mali", 4 | "subdivisions": { 5 | "1": "Kayes", 6 | "2": "Koulikoro", 7 | "3": "Sikasso", 8 | "4": "Segou", 9 | "5": "Mopti", 10 | "6": "Tombouctou", 11 | "7": "Gao", 12 | "8": "Kidal", 13 | "BKO": "Bamako Capital District" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/MM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MM/administrative-division-myanmar.html", 3 | "country": "Myanmar [Burma]", 4 | "subdivisions": { 5 | "01": "Sagaing", 6 | "02": "Bago", 7 | "03": "Magway", 8 | "04": "Mandalay", 9 | "05": "Tanintharyi", 10 | "06": "Yangon", 11 | "07": "Ayeyarwady", 12 | "11": "Kachin State", 13 | "12": "Kayah State", 14 | "13": "Kayin State", 15 | "14": "Chin State", 16 | "15": "Mon State", 17 | "16": "Rakhine State", 18 | "17": "Shan State", 19 | "18": "Nay Pyi Taw" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/MN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MN/administrative-division-mongolia.html", 3 | "country": "Mongolia", 4 | "subdivisions": { 5 | "035": "Orhon", 6 | "037": "Darhan uul", 7 | "039": "Hentiy", 8 | "041": "Hovsgol", 9 | "043": "Hovd", 10 | "046": "Uvs", 11 | "047": "Tov", 12 | "049": "Selenge", 13 | "051": "Suhbaatar", 14 | "053": "Omnogovi", 15 | "055": "Ovorhangay", 16 | "057": "Dzavhan", 17 | "059": "DundgovL", 18 | "061": "Dornod", 19 | "063": "Dornogov", 20 | "064": "Govi-Sumber", 21 | "065": "Govi-Altay", 22 | "067": "Bulgan", 23 | "069": "Bayanhongor", 24 | "071": "Bayan-Olgiy", 25 | "073": "Arhangay", 26 | "1": "Ulanbaatar" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/MO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MO/administrative-division-macao.html", 3 | "country": "Macao", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/MP.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MP/administrative-division-northern-mariana-islands.html", 3 | "country": "Northern Mariana Islands", 4 | "subdivisions": { 5 | "N": "Northern Islands", 6 | "R": "Rota", 7 | "S": "Saipan", 8 | "T": "Tinian" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/MQ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MQ/administrative-division-martinique.html", 3 | "country": "Martinique", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/MR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MR/administrative-division-mauritania.html", 3 | "country": "Mauritania", 4 | "subdivisions": { 5 | "01": "Hodh Ech Chargui", 6 | "02": "Hodh El Gharbi", 7 | "03": "Assaba", 8 | "04": "Gorgol", 9 | "05": "Brakna", 10 | "06": "Trarza", 11 | "07": "Adrar", 12 | "08": "Dakhlet Nouadhibou", 13 | "09": "Tagant", 14 | "10": "Guidimaka", 15 | "11": "Tiris Zemmour", 16 | "12": "Inchiri", 17 | "13": "Nouakchott-Ouest", 18 | "14": "Nouakchott-Nord", 19 | "15": "Nouakchott-Sud" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/MS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MS/administrative-division-montserrat.html", 3 | "country": "Montserrat", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/MT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MT/administrative-division-malta.html", 3 | "country": "Malta", 4 | "subdivisions": { 5 | "01": "Attard", 6 | "02": "Balzan", 7 | "03": "Birgu", 8 | "04": "Birkirkara", 9 | "05": "Birzebbuga", 10 | "06": "Bormla", 11 | "07": "Dingli", 12 | "08": "Fgura", 13 | "09": "Floriana", 14 | "10": "Fontana", 15 | "11": "Gudja", 16 | "12": "Gzira", 17 | "13": "Ghajnsielem", 18 | "14": "Gharb", 19 | "15": "Gargur", 20 | "16": "Ghasri", 21 | "17": "Gaxaq", 22 | "18": "Hamrun", 23 | "19": "Iklin", 24 | "20": "Isla", 25 | "21": "Kalkara", 26 | "22": "Kercem", 27 | "23": "Kirkop", 28 | "24": "Lija", 29 | "25": "Luqa", 30 | "26": "Marsa", 31 | "27": "Marsaskala", 32 | "28": "Marsaxlokk", 33 | "29": "Mdina", 34 | "30": "Melliea", 35 | "31": "Mgarr", 36 | "32": "Mosta", 37 | "33": "Mqabba", 38 | "34": "Msida", 39 | "35": "Mtarfa", 40 | "36": "Munxar", 41 | "37": "Nadur", 42 | "38": "Naxxar", 43 | "39": "Paola", 44 | "40": "Pembroke", 45 | "41": "Pieta", 46 | "42": "Qala", 47 | "43": "Qormi", 48 | "44": "Qrendi", 49 | "45": "Rabat Għawdex", 50 | "46": "Rabat Malta", 51 | "47": "Safi", 52 | "48": "San Giljan", 53 | "49": "San Gwann", 54 | "50": "San Lawrenz", 55 | "51": "San Pawl il-Bahar", 56 | "52": "Sannat", 57 | "53": "Santa Lucija", 58 | "54": "Santa Venera", 59 | "55": "Siggiewi", 60 | "56": "Sliema", 61 | "57": "Swieqi", 62 | "58": "Tarxien", 63 | "59": "Ta Xbiex", 64 | "60": "Valletta", 65 | "61": "Xagra", 66 | "62": "Xewkija", 67 | "63": "Xgajra", 68 | "64": "Zabbar", 69 | "65": "Żebbuġ Għawdex", 70 | "66": "Żebbuġ Malta", 71 | "67": "Zejtun", 72 | "68": "Zurrieq" 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /data/iso_3166-2/MU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MU/administrative-division-mauritius.html", 3 | "country": "Mauritius", 4 | "subdivisions": { 5 | "AG": "Agalega Islands", 6 | "BL": "Black River", 7 | "BR": "Beau Bassin-Rose Hill", 8 | "CC": "Cargados Carajos Shoals (Saint Brandon Islands)", 9 | "CU": "Curepipe", 10 | "FL": "Flacq", 11 | "GP": "Grand Port", 12 | "MO": "Moka", 13 | "PA": "Pamplemousses", 14 | "PL": "Port Louis", 15 | "PU": "Port Louis", 16 | "PW": "Plaines Wilhems", 17 | "QB": "Quatre Bornes", 18 | "RO": "Rodrigues", 19 | "RR": "Riviere du Rempart", 20 | "SA": "Savanne", 21 | "VP": "Vacoas-Phoenix" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/MV.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MV/administrative-division-maldives.html", 3 | "country": "Maldives", 4 | "subdivisions": { 5 | "00": "Alifu Dhaalu / Ari Atholhu Dhekunuburi", 6 | "01": "Seenu / Addu Atholhu", 7 | "02": "Alifu Alifu / Ari Atholhu Uthuruburi", 8 | "03": "Lhaviyani / Faadhippolhu", 9 | "04": "Vaavu / Felidhu Atholhu", 10 | "05": "Laamu / Haddhdhunmathi", 11 | "07": "Haa Alifu / Thiladhunmathee Uthuruburi", 12 | "08": "Thaa / Kolhumadulu", 13 | "12": "Meemu / Mulakatholhu", 14 | "13": "Raa / Maalhosmadulu Uthuruburi", 15 | "14": "Faafu / Nilandhe Atholhu Uthuruburi", 16 | "17": "Dhaalu / Nilandhe Atholhu Dhekunuburi", 17 | "20": "Baa / Maalhosmadulu Dhekunuburi", 18 | "23": "Haa Dhaalu / Thiladhunmathee Dhekunuburi", 19 | "24": "Shaviyani / Miladhunmadulu Uthuruburi", 20 | "25": "Noonu / Miladhunmadulu Dhekunuburi", 21 | "26": "Kaafu / Maale Atholhu", 22 | "27": "Gaafu Alifu / Huvadhu Atholhu Uthuruburi", 23 | "28": "Gaafu Dhaalu / Huvadhu Atholhu Dhekunuburi", 24 | "29": "Gnaviyani / Fuvammulah" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /data/iso_3166-2/MW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MW/administrative-division-malawi.html", 3 | "country": "Malawi", 4 | "subdivisions": { 5 | "BA": "Balaka", 6 | "BL": "Blantyre", 7 | "C": "Central", 8 | "CK": "Chikwawa", 9 | "CR": "Chiradzulu", 10 | "CT": "Chitipa", 11 | "DE": "Dedza", 12 | "DO": "Dowa", 13 | "KR": "Karonga", 14 | "KS": "Kasungu", 15 | "LI": "Lilongwe", 16 | "LK": "Likoma", 17 | "MC": "Mchinji", 18 | "MG": "Mangochi", 19 | "MH": "Machinga", 20 | "MU": "Mulanje", 21 | "MW": "Mwanza", 22 | "MZ": "Mzimba", 23 | "N": "Northern", 24 | "NB": "Nkhata Bay", 25 | "NE": "Neno", 26 | "NI": "Ntchisi", 27 | "NK": "Nkhotakota", 28 | "NS": "Nsanje", 29 | "NU": "Ntcheu", 30 | "PH": "Phalombe", 31 | "RU": "Rumphi", 32 | "S": "Southern", 33 | "SA": "Salima", 34 | "TH": "Thyolo", 35 | "ZO": "Zomba" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /data/iso_3166-2/MX.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MX/administrative-division-mexico.html", 3 | "country": "Mexico", 4 | "subdivisions": { 5 | "AGU": "Aguascalientes", 6 | "BCN": "Baja California", 7 | "BCS": "Baja California Sur", 8 | "CAM": "Campeche", 9 | "CHH": "Chihuahua", 10 | "CHP": "Chiapas", 11 | "CMX": "Ciudad de Mexico", 12 | "COA": "Coahuila", 13 | "COL": "Colima", 14 | "DUR": "Durango", 15 | "GRO": "Guerrero", 16 | "GUA": "Guanajuato", 17 | "HID": "Hidalgo", 18 | "JAL": "Jalisco", 19 | "MEX": "Mexico", 20 | "MIC": "Michoacan", 21 | "MOR": "Morelos", 22 | "NAY": "Nayarit", 23 | "NLE": "Nuevo Leon", 24 | "OAX": "Oaxaca", 25 | "PUE": "Puebla", 26 | "QUE": "Queretaro", 27 | "ROO": "Quintana Roo", 28 | "SIN": "Sinaloa", 29 | "SLP": "San Luis Potosi", 30 | "SON": "Sonora", 31 | "TAB": "Tabasco", 32 | "TAM": "Tamaulipas", 33 | "TLA": "Tlaxcala", 34 | "VER": "Veracruz", 35 | "YUC": "Yucatan", 36 | "ZAC": "Zacatecas" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /data/iso_3166-2/MY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MY/administrative-division-malaysia.html", 3 | "country": "Malaysia", 4 | "subdivisions": { 5 | "01": "Johor", 6 | "02": "Kedah", 7 | "03": "Kelantan", 8 | "04": "Melaka", 9 | "05": "Negeri Sembilan", 10 | "06": "Pahang", 11 | "07": "Pinang", 12 | "08": "Perak", 13 | "09": "Perlis", 14 | "10": "Selangor", 15 | "11": "Terengganu", 16 | "12": "Sabah", 17 | "13": "Sarawak", 18 | "14": "Kuala Lumpur", 19 | "15": "Labuan", 20 | "16": "Putrajaya" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/MZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/MZ/administrative-division-mozambique.html", 3 | "country": "Mozambique", 4 | "subdivisions": { 5 | "A": "Niassa", 6 | "B": "Manica", 7 | "G": "Gaza", 8 | "I": "Inhambane", 9 | "L": "Maputo", 10 | "MPM": "Maputo (city)", 11 | "N": "Nampula", 12 | "P": "Cabo Delgado", 13 | "Q": "Zambezia", 14 | "S": "Sofala", 15 | "T": "Tete" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/NA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NA/administrative-division-namibia.html", 3 | "country": "Namibia", 4 | "subdivisions": { 5 | "CA": "Caprivi", 6 | "ER": "Erongo", 7 | "HA": "Hardap", 8 | "KA": "Karas", 9 | "KE": "Kavango East", 10 | "KH": "Khomas", 11 | "KU": "Kunene", 12 | "KW": "Kavango West", 13 | "OD": "Otjozondjupa", 14 | "OH": "Omaheke", 15 | "ON": "Oshana", 16 | "OS": "Omusati", 17 | "OT": "Oshikoto", 18 | "OW": "Ohangwena" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/NC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NC/administrative-division-new-caledonia.html", 3 | "country": "New Caledonia", 4 | "subdivisions": { 5 | "L": "Iles Loyaute", 6 | "N": "Nord", 7 | "S": "Sud" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/NE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NE/administrative-division-niger.html", 3 | "country": "Niger", 4 | "subdivisions": { 5 | "1": "Agadez", 6 | "2": "Diffa", 7 | "3": "Dosso", 8 | "4": "Maradi", 9 | "5": "Tahoua", 10 | "6": "Tillabéri", 11 | "7": "Zinder", 12 | "8": "Niamey" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/NF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NF/administrative-division-norfolk-island.html", 3 | "country": "Norfolk Island", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/NG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NG/administrative-division-nigeria.html", 3 | "country": "Nigeria", 4 | "subdivisions": { 5 | "AB": "Abia", 6 | "AD": "Adamawa", 7 | "AK": "Akwa Ibom", 8 | "AN": "Anambra", 9 | "BA": "Bauchi", 10 | "BE": "Benue", 11 | "BO": "Borno", 12 | "BY": "Bayelsa", 13 | "CR": "Cross River", 14 | "DE": "Delta", 15 | "EB": "Ebonyi", 16 | "ED": "Edo", 17 | "EK": "Ekiti", 18 | "EN": "Enugu", 19 | "FC": "Federal Capital Territory", 20 | "GO": "Gombe", 21 | "IM": "Imo", 22 | "JI": "Jigawa", 23 | "KD": "Kaduna", 24 | "KE": "Kebbi", 25 | "KN": "Kano", 26 | "KO": "Kogi", 27 | "KT": "Katsina", 28 | "KW": "Kwara", 29 | "LA": "Lagos", 30 | "NA": "Nassarawa", 31 | "NI": "Niger", 32 | "OG": "Ogun", 33 | "ON": "Ondo", 34 | "OS": "Osun", 35 | "OY": "Oyo", 36 | "PL": "Plateau", 37 | "RI": "Rivers", 38 | "SO": "Sokoto", 39 | "TA": "Taraba", 40 | "YO": "Yobe", 41 | "ZA": "Zamfara" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /data/iso_3166-2/NI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NI/administrative-division-nicaragua.html", 3 | "country": "Nicaragua", 4 | "subdivisions": { 5 | "AN": "Region Autonoma del Atlantico Norte", 6 | "AS": "Region Autonoma del Atlantico Sur", 7 | "BO": "Boaco", 8 | "CA": "Carazo", 9 | "CI": "Chinandega", 10 | "CO": "Chontales", 11 | "ES": "Esteli", 12 | "GR": "Granada", 13 | "JI": "Jinotega", 14 | "LE": "Leon", 15 | "MD": "Madriz", 16 | "MN": "Managua", 17 | "MS": "Masaya", 18 | "MT": "Matagalpa", 19 | "NS": "Nueva Segovia", 20 | "RI": "Rivas", 21 | "SJ": "Rio San Juan" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/NL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NL/administrative-division-netherlands.html", 3 | "country": "Netherlands", 4 | "subdivisions": { 5 | "DR": "Drenthe", 6 | "FL": "Flevoland", 7 | "FR": "Friesland", 8 | "GE": "Gelderland", 9 | "GR": "Groningen", 10 | "LI": "Limburg", 11 | "NB": "Noord Brabant", 12 | "NH": "Noord Holland", 13 | "OV": "Overijssel", 14 | "UT": "Utrecht", 15 | "ZE": "Zeeland", 16 | "ZH": "Zuid Holland" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/iso_3166-2/NO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NO/administrative-division-norway.html", 3 | "country": "Norway", 4 | "subdivisions": { 5 | "01": "Ostfold", 6 | "02": "Akershus", 7 | "03": "Oslo", 8 | "04": "Hedmark", 9 | "05": "Oppland", 10 | "06": "Buskerud", 11 | "07": "Vestfold", 12 | "08": "Telemark", 13 | "09": "Aust-Agder", 14 | "10": "Vest-Agder", 15 | "11": "Rogaland", 16 | "12": "Hordaland", 17 | "14": "Sogn og Fjordane", 18 | "15": "More og Romdal", 19 | "18": "Nordland", 20 | "19": "Troms", 21 | "20": "Finnmark", 22 | "21": "Svalbard", 23 | "22": "Jan Mayen", 24 | "23": "Trøndelag" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /data/iso_3166-2/NP.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NP/administrative-division-nepal.html", 3 | "country": "Nepal", 4 | "subdivisions": { 5 | "1": "Madhyamanchal", 6 | "2": "Madhya Pashchimanchal", 7 | "3": "Pashchimanchal", 8 | "4": "Purwanchal", 9 | "5": "Sudur Pashchimanchal", 10 | "BA": "Bagmati", 11 | "BH": "Bheri", 12 | "DH": "Dhawalagiri", 13 | "GA": "Gandaki", 14 | "JA": "Janakpur", 15 | "KA": "Karnali", 16 | "KO": "Kosi", 17 | "LU": "Lumbini", 18 | "MA": "Mahakali", 19 | "ME": "Mechi", 20 | "NA": "Narayani", 21 | "RA": "Rapti", 22 | "SA": "Sagarmatha", 23 | "SE": "Seti" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /data/iso_3166-2/NR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NR/administrative-division-nauru.html", 3 | "country": "Nauru", 4 | "subdivisions": { 5 | "01": "Aiwo", 6 | "02": "Anabar", 7 | "03": "Anetan", 8 | "04": "Anibare", 9 | "05": "Baiti", 10 | "06": "Boe", 11 | "07": "Buada", 12 | "08": "Denigomodu", 13 | "09": "Ewa", 14 | "10": "Ijuw", 15 | "11": "Meneng", 16 | "12": "Nibok", 17 | "13": "Uaboe", 18 | "14": "Yaren" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/NU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NU/administrative-division-niue.html", 3 | "country": "Niue", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/NZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/NZ/administrative-division-new-zealand.html", 3 | "country": "New Zealand", 4 | "subdivisions": { 5 | "AUK": "Auckland", 6 | "BOP": "Bay of Plenty", 7 | "CAN": "Canterbury", 8 | "CIT": "Chatham Islands", 9 | "GIS": "Gisborne", 10 | "HKB": "Hawke's Bay", 11 | "MBH": "Marlborough", 12 | "MWT": "Manawatu-Wanganui", 13 | "NSN": "Nelson", 14 | "NTL": "Northland", 15 | "OTA": "Otago", 16 | "STL": "Southland", 17 | "TAS": "Tasman", 18 | "TKI": "Taranaki", 19 | "WGN": "Wellington", 20 | "WKO": "Waikato", 21 | "WTC": "West Coast" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /data/iso_3166-2/OM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/OM/administrative-division-oman.html", 3 | "country": "Oman", 4 | "subdivisions": { 5 | "BJ": "Al Batinah South", 6 | "BS": "Shamāl al Bāţinah", 7 | "BU": "Al Buraymī", 8 | "DA": "Ad Dakhiliyah", 9 | "MA": "Masqat", 10 | "MU": "Musandam", 11 | "SJ": "Ash Sharqiyah South", 12 | "SS": "Shamāl ash Sharqīyah", 13 | "WU": "Al Wusta", 14 | "ZA": "Az Zahirah", 15 | "ZU": "Zufar" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/PA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PA/administrative-division-panama.html", 3 | "country": "Panama", 4 | "subdivisions": { 5 | "1": "Bocas del Toro", 6 | "10": "Panamá Oeste Province", 7 | "2": "Cocle", 8 | "3": "Colon", 9 | "4": "Chiriqui", 10 | "5": "Darien", 11 | "6": "Herrera", 12 | "7": "Los Santos", 13 | "8": "Panama", 14 | "9": "Veraguas", 15 | "EM": "Comarca Emberá-Wounaan", 16 | "KY": "Comarca de Kuna Yala", 17 | "NB": "Ngöbe-Buglé" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/PE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PE/administrative-division-peru.html", 3 | "country": "Peru", 4 | "subdivisions": { 5 | "AMA": "Amazonas", 6 | "ANC": "Ancash", 7 | "APU": "Apurimac", 8 | "ARE": "Arequipa", 9 | "AYA": "Ayacucho", 10 | "CAJ": "Cajamarca", 11 | "CAL": "Callao", 12 | "CUS": "Cusco", 13 | "HUC": "Huanuco", 14 | "HUV": "Huancavelica", 15 | "ICA": "Ica", 16 | "JUN": "Junin", 17 | "LAL": "La Libertad", 18 | "LAM": "Lambayeque", 19 | "LIM": "Lima", 20 | "LMA": "Municipalidad Metropolitana de Lima", 21 | "LOR": "Loreto", 22 | "MDD": "Madre de Dios", 23 | "MOQ": "Moquegua", 24 | "PAS": "Pasco", 25 | "PIU": "Piura", 26 | "PUN": "Puno", 27 | "SAM": "San Martin", 28 | "TAC": "Tacna", 29 | "TUM": "Tumbes", 30 | "UCA": "Ucayali" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /data/iso_3166-2/PF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PF/administrative-division-french-polynesia.html", 3 | "country": "French Polynesia", 4 | "subdivisions": { 5 | "I": "Austral Islands", 6 | "M": "Marquesas Islands", 7 | "S": "Iles Sous-le-Vent", 8 | "T": "Tuamotu-Gambier", 9 | "V": "Iles du Vent" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/PG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PG/administrative-division-papua-new-guinea.html", 3 | "country": "Papua New Guinea", 4 | "subdivisions": { 5 | "CPK": "Chimbu", 6 | "CPM": "Central", 7 | "EBR": "East New Britain", 8 | "EHG": "Eastern Highlands", 9 | "EPW": "Enga", 10 | "ESW": "East Sepik", 11 | "GPK": "Gulf", 12 | "HLA": "Hela", 13 | "JWK": "Jiwaka", 14 | "MBA": "Milne Bay", 15 | "MPL": "Morobe", 16 | "MPM": "Madang", 17 | "MRL": "Manus", 18 | "NCD": "National Capital", 19 | "NIK": "New Ireland", 20 | "NPP": "Northern", 21 | "NSB": "Bougainville", 22 | "SAN": "Sandaun", 23 | "SHM": "Southern Highlands", 24 | "WBK": "West New Britain", 25 | "WHM": "Western Highlands", 26 | "WPD": "Western" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/PK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PK/administrative-division-pakistan.html", 3 | "country": "Pakistan", 4 | "subdivisions": { 5 | "BA": "Balochistan", 6 | "GB": "Gilgit-Baltistan", 7 | "IS": "Islamabad Capital Territory", 8 | "JK": "Azad Kashmir", 9 | "KP": "Khyber Pakhtunkhwa", 10 | "PB": "Punjab", 11 | "SD": "Sindh", 12 | "TA": "Federally Administered Tribal Areas" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/PL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PL/administrative-division-poland.html", 3 | "country": "Poland", 4 | "subdivisions": { 5 | "DS": "Dolnoslaskie", 6 | "KP": "Kujawsko-Pomorskie", 7 | "LB": "Lubuskie", 8 | "LD": "Lodzkie", 9 | "LU": "Lubelskie", 10 | "MA": "Malopolskie", 11 | "MZ": "Mazowieckie", 12 | "OP": "Opolskie", 13 | "PD": "Podlaskie", 14 | "PK": "Podkarpackie", 15 | "PM": "Pomorskie", 16 | "SK": "Swietokrzyskie", 17 | "SL": "Slaskie", 18 | "WN": "Warminsko-Mazurskie", 19 | "WP": "Wielkopolskie", 20 | "ZP": "Zachodniopomorskie" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/PM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PM/administrative-division-saint-pierre-and-miquelon.html", 3 | "country": "Saint Pierre and Miquelon", 4 | "subdivisions": { 5 | "M": "Miquelon", 6 | "P": "Saint Pierre" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/iso_3166-2/PN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PN/administrative-division-pitcairn-islands.html", 3 | "country": "Pitcairn Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/PR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PR/administrative-division-puerto-rico.html", 3 | "country": "Puerto Rico", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/PS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PS/administrative-division-palestine.html", 3 | "country": "Palestine", 4 | "subdivisions": { 5 | "BTH": "Bethlehem [conventional] / Bayt Laḩm [Arabic]", 6 | "DEB": "Deir El Balah [conventional] /Dayr al Balaḩ[Arabic]", 7 | "GZA": "Gaza [conventional] / Ghazzah[Arabic]", 8 | "HBN": "Hebron [conventional] / Al Khalīl [Arabic]", 9 | "JEM": "Jerusalem [conventional] / Al Quds [Arabic]", 10 | "JEN": "Jenin [conventional] / Janīn [Arabic]", 11 | "JRH": "Jericho [conventional] / Arīḩā wal Aghwār [Arabic]", 12 | "KYS": "Khan Yunis [conventional] / Khān Yūnis[Arabic]", 13 | "NBS": "Nablus [conventional] / Nāblus [Arabic]", 14 | "NGZ": "North Gaza [conventional] / Shamāl Ghazzah[Arabic]", 15 | "QQA": "Qalqiyah [conventional] / Qalqīlyah [Arabic]", 16 | "RBH": "Ramallah and Al Birah [conventional] / Rām Allāh wal Bīrah [Arabic]", 17 | "RFH": "Rafah [conventional] / Rafaḩ[Arabic]", 18 | "SLT": "Salfit [conventional] / Salfīt [Arabic]", 19 | "TBS": "Tubas [conventional] / Ţūbās [Arabic]", 20 | "TKM": "Tulkarm [conventional] /Ţūlkarm [Arabic]" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/PT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PT/administrative-division-portugal.html", 3 | "country": "Portugal", 4 | "subdivisions": { 5 | "01": "Aveiro", 6 | "02": "Beja", 7 | "03": "Braga", 8 | "04": "Braganca", 9 | "05": "Castelo Branco", 10 | "06": "Coimbra", 11 | "07": "Evora", 12 | "08": "Faro", 13 | "09": "Guarda", 14 | "10": "Leiria", 15 | "11": "Lisboa", 16 | "12": "Portalegre", 17 | "13": "Porto", 18 | "14": "Santarem", 19 | "15": "Setubal", 20 | "16": "Viana do Castelo", 21 | "17": "Vila Real", 22 | "18": "Viseu", 23 | "20": "Acores (Azores)", 24 | "30": "Madeira" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /data/iso_3166-2/PW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PW/administrative-division-palau.html", 3 | "country": "Palau", 4 | "subdivisions": { 5 | "002": "Aimeliik", 6 | "004": "Airai", 7 | "010": "Angaur", 8 | "050": "Hatohobei", 9 | "100": "Kayangel", 10 | "150": "Koror", 11 | "212": "Melekeok", 12 | "214": "Ngaraard", 13 | "218": "Ngarchelong", 14 | "222": "Ngardmau", 15 | "224": "Ngatpang", 16 | "226": "Ngchesar", 17 | "227": "Ngeremlengui", 18 | "228": "Ngiwal", 19 | "350": "Peleliu", 20 | "370": "Sonsorol" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/iso_3166-2/PY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/PY/administrative-division-paraguay.html", 3 | "country": "Paraguay", 4 | "subdivisions": { 5 | "1": "Concepcion", 6 | "10": "Alto Parana", 7 | "11": "Central", 8 | "12": "Neembucu", 9 | "13": "Amambay", 10 | "14": "Canindeyu", 11 | "15": "Presidente Hayes", 12 | "16": "Alto Paraguay", 13 | "19": "Boqueron", 14 | "2": "San Pedro", 15 | "3": "Cordillera", 16 | "4": "Guaira", 17 | "5": "Caaguazu", 18 | "6": "Caazapa", 19 | "7": "Itapua", 20 | "8": "Misiones", 21 | "9": "Paraguari", 22 | "ASU": "Asuncion" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/QA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/QA/administrative-division-qatar.html", 3 | "country": "Qatar", 4 | "subdivisions": { 5 | "DA": "Ad Dawhah", 6 | "KH": "Al Khawr wa adh Dhakhīrah", 7 | "MS": "Ash Shamāl", 8 | "RA": "Ar Rayyan", 9 | "SH": "Al-Shahaniya", 10 | "US": "Umm Salal", 11 | "WA": "Al Wakrah", 12 | "ZA": "Az Z a‘āyin" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/RE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/RE/administrative-division-reunion.html", 3 | "country": "Réunion", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/RO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/RO/administrative-division-romania.html", 3 | "country": "Romania", 4 | "subdivisions": { 5 | "AB": "Alba", 6 | "AG": "Arges", 7 | "AR": "Arad", 8 | "B": "Bucuresti", 9 | "BC": "Bacau", 10 | "BH": "Bihor", 11 | "BN": "Bistrita-Nasaud", 12 | "BR": "Braila", 13 | "BT": "Botosani", 14 | "BV": "Brasov", 15 | "BZ": "Buzau", 16 | "CJ": "Cluj", 17 | "CL": "Calarasi", 18 | "CS": "Caras-Severin", 19 | "CT": "Constanta", 20 | "CV": "Covasna", 21 | "DB": "Dimbovita", 22 | "DJ": "Dolj", 23 | "GJ": "Gorj", 24 | "GL": "Galati", 25 | "GR": "Giurgiu", 26 | "HD": "Hunedoara", 27 | "HR": "Harghita", 28 | "IF": "Ilfov", 29 | "IL": "Ialomita", 30 | "IS": "Iasi", 31 | "MH": "Mehedinti", 32 | "MM": "Maramures", 33 | "MS": "Mures", 34 | "NT": "Neamt", 35 | "OT": "Olt", 36 | "PH": "Prahova", 37 | "SB": "Sibiu", 38 | "SJ": "Salaj", 39 | "SM": "Satu Mare", 40 | "SV": "Suceava", 41 | "TL": "Tulcea", 42 | "TM": "Timis", 43 | "TR": "Teleorman", 44 | "VL": "Vilcea", 45 | "VN": "Vrancea", 46 | "VS": "Vaslui" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /data/iso_3166-2/RS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/RS/administrative-division-serbia.html", 3 | "country": "Serbia", 4 | "subdivisions": { 5 | "00": "Beograd", 6 | "01": "Severnobački okrug", 7 | "02": "Srednjebanatski okrug", 8 | "03": "Severnobanatski okrug", 9 | "04": "Južnobanatski okrug", 10 | "05": "Zapadno-Bački Okrug", 11 | "06": "Južnobački okrug", 12 | "07": "Srem", 13 | "08": "Mačvanski okrug", 14 | "09": "Kolubarski okrug", 15 | "10": "Podunavski okrug", 16 | "11": "Braničevski okrug", 17 | "12": "Šumadija", 18 | "13": "Pomoravski okrug", 19 | "14": "Borski okrug", 20 | "15": "Zaječarski okrug", 21 | "16": "Zlatibor", 22 | "17": "Moravički okrug", 23 | "18": "Raški okrug", 24 | "19": "Rasinski okrug", 25 | "20": "Nišavski okrug", 26 | "21": "Toplica", 27 | "22": "Pirotski okrug", 28 | "23": "Jablanički okrug", 29 | "24": "Pčinjski okrug", 30 | "25": "Kosovski okrug", 31 | "26": "Pećki okrug", 32 | "27": "Prizrenski okrug", 33 | "28": "Kosovsko-Mitrovački okrug", 34 | "29": "Kosovsko-Pomoravski okrug", 35 | "KM": "Kosovo", 36 | "VO": "Vojvodina" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /data/iso_3166-2/RW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/RW/administrative-division-rwanda.html", 3 | "country": "Rwanda", 4 | "subdivisions": { 5 | "01": "Kigali", 6 | "02": "Est", 7 | "03": "Nord", 8 | "04": "Ouest", 9 | "05": "Sud" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/SA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SA/administrative-division-saudi-arabia.html", 3 | "country": "Saudi Arabia", 4 | "subdivisions": { 5 | "01": "Ar Riyad", 6 | "02": "Makkah", 7 | "03": "Al Madinah", 8 | "04": "Ash Sharqiyah (Eastern Province)", 9 | "05": "Al Qasim", 10 | "06": "Ha'il", 11 | "07": "Tabuk", 12 | "08": "Al Hudud ash Shamaliyah", 13 | "09": "Jizan", 14 | "10": "Najran", 15 | "11": "Al Bahah", 16 | "12": "Al Jawf", 17 | "14": "'Asir" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/SB.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SB/administrative-division-solomon-islands.html", 3 | "country": "Solomon Islands", 4 | "subdivisions": { 5 | "CE": "Central", 6 | "CH": "Choiseul", 7 | "CT": "Capital Territory", 8 | "GU": "Guadalcanal", 9 | "IS": "Isabel", 10 | "MK": "Makira", 11 | "ML": "Malaita", 12 | "RB": "Rennell and Bellona", 13 | "TE": "Temotu", 14 | "WE": "Western" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/SC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SC/administrative-division-seychelles.html", 3 | "country": "Seychelles", 4 | "subdivisions": { 5 | "01": "Anse aux Pins", 6 | "02": "Anse Boileau", 7 | "03": "Anse Etoile", 8 | "04": "Anse Louis", 9 | "05": "Anse Royale", 10 | "06": "Baie Lazare", 11 | "07": "Baie Sainte Anne", 12 | "08": "Beau Vallon", 13 | "09": "Bel Air", 14 | "10": "Bel Ombre", 15 | "11": "Cascade", 16 | "12": "Glacis", 17 | "13": "Grand' Anse (on Mahe)", 18 | "14": "Grand' Anse (on Praslin)", 19 | "15": "La Digue", 20 | "16": "La Riviere Anglaise", 21 | "17": "Mont Buxton", 22 | "18": "Mont Fleuri", 23 | "19": "Plaisance", 24 | "20": "Pointe La Rue", 25 | "21": "Port Glaud", 26 | "22": "Saint Louis", 27 | "23": "Takamaka", 28 | "24": "Les Mamelles", 29 | "25": "Roche Caïman" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /data/iso_3166-2/SD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SD/administrative-division-sudan.html", 3 | "country": "Sudan", 4 | "subdivisions": { 5 | "DC": "Wasaţ Dārfūr", 6 | "DE": "Sharq Dārfūr", 7 | "DN": "Shamāl Dārfūr", 8 | "DS": "Janūb Dārfūr", 9 | "DW": "Gharb Dārfūr", 10 | "GD": "Al Qaḑārif", 11 | "GK": "West Kurdufan", 12 | "GZ": "Al Jazīrah", 13 | "KA": "Kassalā", 14 | "KH": "Al Kharţūm", 15 | "KN": "Shamāl Kurdufān", 16 | "KS": "Janūb Kurdufān", 17 | "NB": "An Nīl al Azraq", 18 | "NO": "Ash Shamālīyah", 19 | "NR": "An Nīl", 20 | "NW": "An Nīl al Abyaḑ", 21 | "RS": "Al Baḩr al Aḩmar", 22 | "SI": "Sinnār" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/SE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SE/administrative-division-sweden.html", 3 | "country": "Sweden", 4 | "subdivisions": { 5 | "AB": "Stockholms", 6 | "AC": "Vasterbottens", 7 | "BD": "Norrbottens", 8 | "C": "Uppsala", 9 | "D": "Sodermanlands", 10 | "E": "Ostergotlands", 11 | "F": "Jonkopings", 12 | "G": "Kronobergs", 13 | "H": "Kalmar", 14 | "I": "Gotlands", 15 | "K": "Blekinge", 16 | "M": "Skåne", 17 | "N": "Hallands", 18 | "O": "Västra Götaland", 19 | "S": "Varmlands", 20 | "T": "Orebro", 21 | "U": "Vastmanlands", 22 | "W": "Dalarna", 23 | "X": "Gavleborgs", 24 | "Y": "Vasternorrlands", 25 | "Z": "Jamtlands" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /data/iso_3166-2/SG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SG/administrative-division-singapore.html", 3 | "country": "Singapore", 4 | "subdivisions": { 5 | "01": "Central Singapore", 6 | "02": "North East", 7 | "03": "North West", 8 | "04": "South East", 9 | "05": "South West" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/SH.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SH/administrative-division-saint-helena.html", 3 | "country": "Saint Helena", 4 | "subdivisions": { 5 | "AC": "Ascension", 6 | "HL": "Saint Helena", 7 | "TA": "Tristan da Cunha" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/SJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SJ/administrative-division-svalbard-and-jan-mayen.html", 3 | "country": "Svalbard and Jan Mayen", 4 | "subdivisions": { 5 | "21": "Svalbard", 6 | "22": "Jan Mayen" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/iso_3166-2/SK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SK/administrative-division-slovakia.html", 3 | "country": "Slovakia", 4 | "subdivisions": { 5 | "BC": "Banskobystricky", 6 | "BL": "Bratislavsky", 7 | "KI": "Kosicky", 8 | "NI": "Nitriansky", 9 | "PV": "Presovsky", 10 | "TA": "Trnavsky", 11 | "TC": "Trenciansky", 12 | "ZI": "Zilinsky" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/SL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SL/administrative-division-sierra-leone.html", 3 | "country": "Sierra Leone", 4 | "subdivisions": { 5 | "E": "Eastern", 6 | "N": "Northern", 7 | "NW": "North West Province", 8 | "S": "Southern", 9 | "W": "Western" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/SM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SM/administrative-division-san-marino.html", 3 | "country": "San Marino", 4 | "subdivisions": { 5 | "01": "Acquaviva", 6 | "02": "Chiesanuova", 7 | "03": "Domagnano", 8 | "04": "Faetano", 9 | "05": "Fiorentino", 10 | "06": "Borgo Maggiore", 11 | "07": "Citta di San Marino", 12 | "08": "Montegiardino", 13 | "09": "Serravalle" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/SN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SN/administrative-division-senegal.html", 3 | "country": "Senegal", 4 | "subdivisions": { 5 | "DB": "Diourbel", 6 | "DK": "Dakar", 7 | "FK": "Fatick", 8 | "KA": "Kaffrine", 9 | "KD": "Kolda", 10 | "KE": "Kédougou", 11 | "KL": "Kaolack", 12 | "LG": "Louga", 13 | "MT": "Matam", 14 | "SE": "Sédhiou", 15 | "SL": "Saint-Louis", 16 | "TC": "Tambacounda", 17 | "TH": "Thies", 18 | "ZG": "Ziguinchor" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/SO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SO/administrative-division-somalia.html", 3 | "country": "Somalia", 4 | "subdivisions": { 5 | "AW": "Awdal", 6 | "BK": "Bakool", 7 | "BN": "Banaadir", 8 | "BR": "Bari", 9 | "BY": "Bay", 10 | "GA": "Galguduud", 11 | "GE": "Gedo", 12 | "HI": "Hiiraan", 13 | "JD": "Jubbada Dhexe", 14 | "JH": "Jubbada Hoose", 15 | "MU": "Mudug", 16 | "NU": "Nugaal", 17 | "SA": "Sanaag", 18 | "SD": "Shabeellaha Dhexe", 19 | "SH": "Shabeellaha Hoose", 20 | "SO": "Sool", 21 | "TO": "Togdheer", 22 | "WO": "Woqooyi Galbeed" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/iso_3166-2/SR.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SR/administrative-division-suriname.html", 3 | "country": "Suriname", 4 | "subdivisions": { 5 | "BR": "Brokopondo", 6 | "CM": "Commewijne", 7 | "CR": "Coronie", 8 | "MA": "Marowijne", 9 | "NI": "Nickerie", 10 | "PM": "Paramaribo", 11 | "PR": "Para", 12 | "SA": "Saramacca", 13 | "SI": "Sipaliwini", 14 | "WA": "Wanica" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/SS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SS/administrative-division-south-sudan.html", 3 | "country": "South Sudan", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/ST.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ST/administrative-division-sao-tome-and-principe.html", 3 | "country": "São Tomé and Príncipe", 4 | "subdivisions": { 5 | "P": "Principe", 6 | "S": "Sao Tome" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/iso_3166-2/SV.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SV/administrative-division-el-salvador.html", 3 | "country": "El Salvador", 4 | "subdivisions": { 5 | "AH": "Ahuachapan", 6 | "CA": "Cabanas", 7 | "CH": "Chalatenango", 8 | "CU": "Cuscatlan", 9 | "LI": "La Libertad", 10 | "MO": "Morazan", 11 | "PA": "La Paz", 12 | "SA": "Santa Ana", 13 | "SM": "San Miguel", 14 | "SO": "Sonsonate", 15 | "SS": "San Salvador", 16 | "SV": "San Vicente", 17 | "UN": "La Union", 18 | "US": "Usulutan" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/SX.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SX/administrative-division-sint-maarten.html", 3 | "country": "Sint Maarten", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/SY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SY/administrative-division-syria.html", 3 | "country": "Syria", 4 | "subdivisions": { 5 | "DI": "Dimashq", 6 | "DR": "Dara", 7 | "DY": "Dayr az Zawr", 8 | "HA": "Al Hasakah", 9 | "HI": "Hims", 10 | "HL": "Halab", 11 | "HM": "Hamah", 12 | "ID": "Idlib", 13 | "LA": "Al Ladhiqiyah", 14 | "QU": "Al Qunaytirah", 15 | "RA": "Ar Raqqah", 16 | "RD": "Rif Dimashq", 17 | "SU": "As Suwayda", 18 | "TA": "Tartus" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/SZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/SZ/administrative-division-swaziland.html", 3 | "country": "Swaziland", 4 | "subdivisions": { 5 | "HH": "Hhohho", 6 | "LU": "Lubombo", 7 | "MA": "Manzini", 8 | "SH": "Shishelweni" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/iso_3166-2/TC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TC/administrative-division-turks-and-caicos-islands.html", 3 | "country": "Turks and Caicos Islands", 4 | "subdivisions": { 5 | "AC": "Ambergris Cays", 6 | "DC": "Dellis Cay", 7 | "EC": "East Caicos", 8 | "FC": "French Cay", 9 | "GT": "Grand Turk", 10 | "LW": "Little Water Cay", 11 | "MC": "Middle Caicos", 12 | "NC": "North Caicos", 13 | "PN": "Pine Cay", 14 | "PR": "Providenciales", 15 | "RC": "Parrot Cay", 16 | "SC": "South Caicos", 17 | "SL": "Salt Cay", 18 | "WC": "West Caicos" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/TD.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TD/administrative-division-chad.html", 3 | "country": "Chad", 4 | "subdivisions": { 5 | "BA": "Batha", 6 | "BG": "Barh el Ghazel", 7 | "BO": "Borkou", 8 | "CB": "Chari-Baguirmi", 9 | "EE": "Ennedi Est", 10 | "EO": "Ennedi Quest", 11 | "GR": "Guéra", 12 | "HL": "Hadjer-Lamis", 13 | "KA": "Kanem", 14 | "LC": "Lac", 15 | "LO": "Logone Occidental", 16 | "LR": "Logone Oriental", 17 | "MA": "Mandoul", 18 | "MC": "Moyen-Chari", 19 | "ME": "Mayo-Kebbi Est", 20 | "MO": "Mayo-Kebbi Ouest", 21 | "ND": "Ville de N'Djamena", 22 | "OD": "Ouaddaï", 23 | "SA": "Salamat", 24 | "SI": "Sila", 25 | "TA": "Tandjile", 26 | "TI": "Tibesti", 27 | "WF": "Wadi Fira" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /data/iso_3166-2/TF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TF/administrative-division-french-southern-territories.html", 3 | "country": "French Southern Territories", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/TG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TG/administrative-division-togo.html", 3 | "country": "Togo", 4 | "subdivisions": { 5 | "C": "Centrale", 6 | "K": "Kara", 7 | "M": "Maritime", 8 | "P": "Plateaux", 9 | "S": "Savanes" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/TJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TJ/administrative-division-tajikistan.html", 3 | "country": "Tajikistan", 4 | "subdivisions": { 5 | "DU": "Dushanbe", 6 | "GB": "Gorno-Badakhstan", 7 | "KT": "Khatlon", 8 | "RA": "Nohiyahoi Tobei Jumhurí", 9 | "SU": "Sughd" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/TK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TK/administrative-division-tokelau.html", 3 | "country": "Tokelau", 4 | "subdivisions": { 5 | "A": "Atafu", 6 | "F": "Fakaofo", 7 | "N": "Nukunonu" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/TL.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TL/administrative-division-east-timor.html", 3 | "country": "East Timor", 4 | "subdivisions": { 5 | "AL": "Aileu", 6 | "AN": "Ainaro", 7 | "BA": "Baucau", 8 | "BO": "Bobonaro", 9 | "CO": "Cova Lima", 10 | "DI": "Dili", 11 | "ER": "Ermera", 12 | "LA": "Lautem", 13 | "LI": "Liquica", 14 | "MF": "Manufahi", 15 | "MT": "Manatuto", 16 | "OE": "Oecussi", 17 | "VI": "Viqueque" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/iso_3166-2/TM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TM/administrative-division-turkmenistan.html", 3 | "country": "Turkmenistan", 4 | "subdivisions": { 5 | "A": "Ahal Welayaty", 6 | "B": "Balkan Welayaty", 7 | "D": "Dashhowuz Welayaty", 8 | "L": "Lebap Welayaty", 9 | "M": "Mary Welayaty", 10 | "S": "Aşgabat" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/TN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TN/administrative-division-tunisia.html", 3 | "country": "Tunisia", 4 | "subdivisions": { 5 | "11": "Tunis", 6 | "12": "L'Ariana", 7 | "13": "Ben Arous", 8 | "14": "La Manouba", 9 | "21": "Nabeul", 10 | "22": "Zaghouan", 11 | "23": "Bizerte", 12 | "31": "Béja", 13 | "32": "Jendouba", 14 | "33": "Le Kef", 15 | "34": "Siliana", 16 | "41": "Kairouan", 17 | "42": "Kasserine", 18 | "43": "Sidi Bouzid", 19 | "51": "Sousse", 20 | "52": "Monastir", 21 | "53": "Mahdia", 22 | "61": "Sfax", 23 | "71": "Gafsa", 24 | "72": "Tozeur", 25 | "73": "Kebili", 26 | "81": "Gabès", 27 | "82": "Medenine", 28 | "83": "Tataouine" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /data/iso_3166-2/TO.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TO/administrative-division-tonga.html", 3 | "country": "Tonga", 4 | "subdivisions": { 5 | "01": "Eua", 6 | "02": "Ha'apai", 7 | "03": "Niuas", 8 | "04": "Tongatapu", 9 | "05": "Vava'u" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/iso_3166-2/TT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TT/administrative-division-trinidad-and-tobago.html", 3 | "country": "Trinidad and Tobago", 4 | "subdivisions": { 5 | "ARI": "Arima", 6 | "CHA": "Chaguanas", 7 | "CTT": "Couva/Tabaquite/Talparo", 8 | "DMN": "Diego Martin", 9 | "MRC": "Mayaro/Rio Claro", 10 | "PED": "Penal/Debe", 11 | "POS": "Port of Spain", 12 | "PRT": "Princes Town", 13 | "PTF": "Point Fortin", 14 | "SFO": "San Fernando", 15 | "SGE": "Sangre Grande", 16 | "SIP": "Siparia", 17 | "SJL": "San Juan/Laventille", 18 | "TOB": "Tobago", 19 | "TUP": "Tunapuna/Piarco" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/iso_3166-2/TV.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TV/administrative-division-tuvalu.html", 3 | "country": "Tuvalu", 4 | "subdivisions": { 5 | "FUN": "Funafuti", 6 | "NIT": "Niutao", 7 | "NKF": "Nukufetau", 8 | "NKL": "Nukulaelae", 9 | "NMA": "Nanumea", 10 | "NMG": "Nanumanga", 11 | "NUI": "Nui", 12 | "VAI": "Vaitupu" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data/iso_3166-2/TW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TW/administrative-division-taiwan.html", 3 | "country": "Taiwan", 4 | "subdivisions": { 5 | "CHA": "Changhua", 6 | "CYI": "Chiayi", 7 | "CYQ": "Chiayi", 8 | "HSQ": "Hsinchu", 9 | "HSZ": "Hsinchu", 10 | "HUA": "Hualien", 11 | "ILA": "Ilan", 12 | "KEE": "Keelung", 13 | "KHH": "Kaohsiung", 14 | "KIN": "Kinmen", 15 | "LIE": "Lienchiang", 16 | "MIA": "Miaoli", 17 | "NAN": "Nantou", 18 | "NWT": "New Taipei", 19 | "PEN": "Penghu", 20 | "PIF": "Pingtung", 21 | "TAO": "Taoyuan", 22 | "TNN": "Tainan", 23 | "TPE": "Taipei", 24 | "TTT": "Taitung", 25 | "TXG": "Taichung", 26 | "YUN": "Yunlin" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/TZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/TZ/administrative-division-tanzania.html", 3 | "country": "Tanzania", 4 | "subdivisions": { 5 | "01": "Arusha", 6 | "02": "Dar es Salaam", 7 | "03": "Dodoma", 8 | "04": "Iringa", 9 | "05": "Kagera", 10 | "06": "Pemba North", 11 | "07": "Zanzibar North", 12 | "08": "Kigoma", 13 | "09": "Kilimanjaro", 14 | "10": "Pemba South", 15 | "11": "Zanzibar Central/South", 16 | "12": "Lindi", 17 | "13": "Mara", 18 | "14": "Mbeya", 19 | "15": "Zanzibar Urban/West", 20 | "16": "Morogoro", 21 | "17": "Mtwara", 22 | "18": "Mwanza", 23 | "19": "Pwani", 24 | "20": "Rukwa", 25 | "21": "Ruvuma", 26 | "22": "Shinyanga", 27 | "23": "Singida", 28 | "24": "Tabora", 29 | "25": "Tanga", 30 | "26": "Manyara", 31 | "27": "Geita", 32 | "28": "Katavi", 33 | "29": "Njombe", 34 | "30": "Simiyu" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /data/iso_3166-2/UA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/UA/administrative-division-ukraine.html", 3 | "country": "Ukraine", 4 | "subdivisions": { 5 | "05": "Vinnytsya", 6 | "07": "Volyn'", 7 | "09": "Luhans'k", 8 | "12": "Dnipropetrovs'k", 9 | "14": "Donets'k", 10 | "18": "Zhytomyr", 11 | "21": "Zakarpattya", 12 | "23": "Zaporizhzhya", 13 | "26": "Ivano-Frankivs'k", 14 | "30": "Kyyiv", 15 | "32": "Kiev", 16 | "35": "Kirovohrad", 17 | "40": "Sevastopol", 18 | "43": "Crimea", 19 | "46": "L'viv", 20 | "48": "Mykolayiv", 21 | "51": "Odesa", 22 | "53": "Poltava", 23 | "56": "Rivne", 24 | "59": "Sumy", 25 | "61": "Ternopil'", 26 | "63": "Kharkiv", 27 | "65": "Kherson", 28 | "68": "Khmel'nyts'kyy", 29 | "71": "Cherkasy", 30 | "74": "Chernihiv", 31 | "77": "Chernivtsi" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /data/iso_3166-2/UM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/UM/administrative-division-united-states-minor-outlying-islands.html", 3 | "country": "U.S. Minor Outlying Islands", 4 | "subdivisions": { 5 | "67": "Johnston Atoll", 6 | "71": "Midway Atoll", 7 | "76": "Navassa Island", 8 | "79": "Wake Island", 9 | "81": "Baker Island", 10 | "84": "Howland Island", 11 | "86": "Jarvis Island", 12 | "89": "Kingman Reef", 13 | "95": "Palmyra Atoll" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/US.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/US/administrative-division-united-states.html", 3 | "country": "United States", 4 | "subdivisions": { 5 | "AK": "Alaska", 6 | "AL": "Alabama", 7 | "AR": "Arkansas", 8 | "AS": "American Samoa", 9 | "AZ": "Arizona", 10 | "CA": "California", 11 | "CO": "Colorado", 12 | "CT": "Connecticut", 13 | "DC": "District of Columbia", 14 | "DE": "Delaware", 15 | "FL": "Florida", 16 | "GA": "Georgia", 17 | "GU": "Guam", 18 | "HI": "Hawaii", 19 | "IA": "Iowa", 20 | "ID": "Idaho", 21 | "IL": "Illinois", 22 | "IN": "Indiana", 23 | "KS": "Kansas", 24 | "KY": "Kentucky", 25 | "LA": "Louisiana", 26 | "MA": "Massachusetts", 27 | "MD": "Maryland", 28 | "ME": "Maine", 29 | "MI": "Michigan", 30 | "MN": "Minnesota", 31 | "MO": "Missouri", 32 | "MP": "Northern Mariana Islands", 33 | "MS": "Mississippi", 34 | "MT": "Montana", 35 | "NC": "North Carolina", 36 | "ND": "North Dakota", 37 | "NE": "Nebraska", 38 | "NH": "New Hampshire", 39 | "NJ": "New Jersey", 40 | "NM": "New Mexico", 41 | "NV": "Nevada", 42 | "NY": "New York", 43 | "OH": "Ohio", 44 | "OK": "Oklahoma", 45 | "OR": "Oregon", 46 | "PA": "Pennsylvania", 47 | "PR": "Puerto Rico", 48 | "RI": "Rhode Island", 49 | "SC": "South Carolina", 50 | "SD": "South Dakota", 51 | "TN": "Tennessee", 52 | "TX": "Texas", 53 | "UM": "U.S. Minor Outlying Islands", 54 | "UT": "Utah", 55 | "VA": "Virginia", 56 | "VI": "Virgin Islands of the U.S.", 57 | "VT": "Vermont", 58 | "WA": "Washington", 59 | "WI": "Wisconsin", 60 | "WV": "West Virginia", 61 | "WY": "Wyoming" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /data/iso_3166-2/UY.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/UY/administrative-division-uruguay.html", 3 | "country": "Uruguay", 4 | "subdivisions": { 5 | "AR": "Artigas", 6 | "CA": "Canelones", 7 | "CL": "Cerro Largo", 8 | "CO": "Colonia", 9 | "DU": "Durazno", 10 | "FD": "Florida", 11 | "FS": "Flores", 12 | "LA": "Lavalleja", 13 | "MA": "Maldonado", 14 | "MO": "Montevideo", 15 | "PA": "Paysandu", 16 | "RN": "Rio Negro", 17 | "RO": "Rocha", 18 | "RV": "Rivera", 19 | "SA": "Salto", 20 | "SJ": "San Jose", 21 | "SO": "Soriano", 22 | "TA": "Tacuarembó", 23 | "TT": "Treinta y Tres" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /data/iso_3166-2/UZ.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/UZ/administrative-division-uzbekistan.html", 3 | "country": "Uzbekistan", 4 | "subdivisions": { 5 | "AN": "Andijon", 6 | "BU": "Buxoro", 7 | "FA": "Farg'ona", 8 | "JI": "Jizzax", 9 | "NG": "Namangan", 10 | "NW": "Navoiy", 11 | "QA": "Qashqadaryo", 12 | "QR": "Qoraqalpog'iston Republikasi", 13 | "SA": "Samarqand", 14 | "SI": "Sirdaryo", 15 | "SU": "Surxondaryo", 16 | "TK": "Toshkent city", 17 | "TO": "Toshkent region", 18 | "XO": "Xorazm" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /data/iso_3166-2/VA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VA/administrative-division-vatican-city.html", 3 | "country": "Vatican City", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/VC.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VC/administrative-division-saint-vincent-and-the-grenadines.html", 3 | "country": "Saint Vincent and the Grenadines", 4 | "subdivisions": { 5 | "01": "Charlotte", 6 | "02": "Saint Andrew", 7 | "03": "Saint David", 8 | "04": "Saint George", 9 | "05": "Saint Patrick", 10 | "06": "Grenadines" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/VE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VE/administrative-division-venezuela.html", 3 | "country": "Venezuela", 4 | "subdivisions": { 5 | "A": "Federal Capital", 6 | "B": "Anzoategui", 7 | "C": "Apure", 8 | "D": "Aragua", 9 | "E": "Barinas", 10 | "F": "Bolivar", 11 | "G": "Carabobo", 12 | "H": "Cojedes", 13 | "I": "Falcon", 14 | "J": "Guarico", 15 | "K": "Lara", 16 | "L": "Merida", 17 | "M": "Miranda", 18 | "N": "Monagas", 19 | "O": "Nueva Esparta", 20 | "P": "Portuguesa", 21 | "R": "Sucre", 22 | "S": "Tachira", 23 | "T": "Trujillo", 24 | "U": "Yaracuy", 25 | "V": "Zulia", 26 | "W": "Federal Dependency", 27 | "X": "Vargas", 28 | "Y": "Delta Amacuro", 29 | "Z": "Amazonas" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /data/iso_3166-2/VG.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VG/administrative-division-british-virgin-islands.html", 3 | "country": "British Virgin Islands", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/VI.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VI/administrative-division-u-s-virgin-islands.html", 3 | "country": "U.S. Virgin Islands", 4 | "subdivisions": { 5 | "C": "Saint Croix", 6 | "J": "Saint John", 7 | "T": "Saint Thomas" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/VN.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VN/administrative-division-vietnam.html", 3 | "country": "Vietnam", 4 | "subdivisions": { 5 | "01": "Lai Chau", 6 | "02": "Lao Cai", 7 | "03": "Ha Giang", 8 | "04": "Cao Bang", 9 | "05": "Son La", 10 | "06": "Yen Bai", 11 | "07": "Tuyen Quang", 12 | "09": "Lang Son", 13 | "13": "Quang Ninh", 14 | "14": "Hoa Binh", 15 | "18": "Ninh Binh", 16 | "20": "Thai Binh", 17 | "21": "Thanh Hoa", 18 | "22": "Nghe An", 19 | "23": "Ha Tinh", 20 | "24": "Quang Binh", 21 | "25": "Quang Tri", 22 | "26": "Thua Thien-Hue", 23 | "27": "Quang Nam", 24 | "28": "Kon Tum", 25 | "29": "Quang Ngai", 26 | "30": "Gia Lai", 27 | "31": "Binh Dinh", 28 | "32": "Phu Yen", 29 | "33": "Dak Lak", 30 | "34": "Khanh Hoa", 31 | "35": "Lam Dong", 32 | "36": "Ninh Thuan", 33 | "37": "Tay Ninh", 34 | "39": "Dong Nai", 35 | "40": "Binh Thuan", 36 | "41": "Long An", 37 | "43": "Ba Ria-Vung Tau", 38 | "44": "An Giang", 39 | "45": "Dong Thap", 40 | "46": "Tien Giang", 41 | "47": "Kien Giang", 42 | "49": "Vinh Long", 43 | "50": "Ben Tre", 44 | "51": "Tra Vinh", 45 | "52": "Soc Trang", 46 | "53": "Bac Can", 47 | "54": "Bac Giang", 48 | "55": "Bac Lieu", 49 | "56": "Bac Ninh", 50 | "57": "Binh Duong", 51 | "58": "Binh Phuoc", 52 | "59": "Ca Mau", 53 | "61": "Hai Duong", 54 | "63": "Ha Nam", 55 | "66": "Hung Yen", 56 | "67": "Nam Dinh", 57 | "68": "Phu Tho", 58 | "69": "Thai Nguyen", 59 | "70": "Vinh Phuc", 60 | "71": "Dien Bien", 61 | "72": "Dak Nong", 62 | "73": "Hau Giang", 63 | "CT": "Can Tho", 64 | "DN": "Da Nang", 65 | "HN": "Ha Noi", 66 | "HP": "Hai Phong", 67 | "SG": "Ho Chi Minh" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /data/iso_3166-2/VU.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/VU/administrative-division-vanuatu.html", 3 | "country": "Vanuatu", 4 | "subdivisions": { 5 | "MAP": "Malampa", 6 | "PAM": "Penama", 7 | "SAM": "Sanma", 8 | "SEE": "Shefa", 9 | "TAE": "Tafea", 10 | "TOB": "Torba" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /data/iso_3166-2/WF.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/WF/administrative-division-wallis-and-futuna.html", 3 | "country": "Wallis and Futuna", 4 | "subdivisions": { 5 | "AL": "Alo", 6 | "SG": "Sigave", 7 | "UV": "ʻUvea" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/iso_3166-2/WS.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/WS/administrative-division-samoa.html", 3 | "country": "Samoa", 4 | "subdivisions": { 5 | "AA": "A'ana", 6 | "AL": "Aiga-i-le-Tai", 7 | "AT": "Atua", 8 | "FA": "Fa'asaleleaga", 9 | "GE": "Gaga'emauga", 10 | "GI": "Gagaifomauga", 11 | "PA": "Palauli", 12 | "SA": "Satupa'itea", 13 | "TU": "Tuamasaga", 14 | "VF": "Va'a-o-Fonoti", 15 | "VS": "Vaisigano" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /data/iso_3166-2/XK.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/XK/administrative-division-kosovo.html", 3 | "country": "Kosovo", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/YE.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/YE/administrative-division-yemen.html", 3 | "country": "Yemen", 4 | "subdivisions": { 5 | "AB": "Abyan", 6 | "AD": "Adan", 7 | "AM": "Amran", 8 | "BA": "Al Bayda", 9 | "DA": "Ad Dali", 10 | "DH": "Dhamar", 11 | "HD": "Hadramawt", 12 | "HJ": "Hajjah", 13 | "HU": "Al Hudaydah", 14 | "IB": "Ibb", 15 | "JA": "Al Jawf", 16 | "LA": "Lahij", 17 | "MA": "Ma'rib", 18 | "MR": "Al Mahrah", 19 | "MW": "Al Mahwit", 20 | "RA": "Raymah", 21 | "SA": "Amanat Al Asimah", 22 | "SD": "Sa'dah", 23 | "SH": "Shabwah", 24 | "SN": "San'a", 25 | "SU": "Socotra", 26 | "TA": "Ta'izz" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /data/iso_3166-2/YT.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/YT/administrative-division-mayotte.html", 3 | "country": "Mayotte", 4 | "subdivisions": [] 5 | } 6 | -------------------------------------------------------------------------------- /data/iso_3166-2/ZA.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ZA/administrative-division-south-africa.html", 3 | "country": "South Africa", 4 | "subdivisions": { 5 | "EC": "Eastern Cape", 6 | "FS": "Free State", 7 | "GT": "Gauteng", 8 | "LP": "Limpopo", 9 | "MP": "Mpumalanga", 10 | "NC": "Northern Cape", 11 | "NL": "KwaZulu-Natal", 12 | "NW": "North West", 13 | "WC": "Western Cape" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /data/iso_3166-2/ZM.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ZM/administrative-division-zambia.html", 3 | "country": "Zambia", 4 | "subdivisions": { 5 | "01": "Western Province", 6 | "02": "Central Province", 7 | "03": "Eastern Province", 8 | "04": "Luapula Province", 9 | "05": "Northern Province", 10 | "06": "North-Western Province", 11 | "07": "Southern Province", 12 | "08": "Copperbelt Province", 13 | "09": "Lusaka Province", 14 | "10": "Muchinga" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /data/iso_3166-2/ZW.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "http://www.geonames.org/ZW/administrative-division-zimbabwe.html", 3 | "country": "Zimbabwe", 4 | "subdivisions": { 5 | "BU": "Bulawayo (city)", 6 | "HA": "Harare (city)", 7 | "MA": "Manicaland", 8 | "MC": "Mashonaland Central", 9 | "ME": "Mashonaland East", 10 | "MI": "Midlands", 11 | "MN": "Matabeleland North", 12 | "MS": "Matabeleland South", 13 | "MV": "Masvingo", 14 | "MW": "Mashonaland West" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/validation/exclude_characters.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.ExcludeCharacters do 2 | @moduledoc false 3 | 4 | @spec exclude(String.t, String.t) :: String.t 5 | def exclude(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 6 | excluded_characters_list = String.codepoints(excluded_characters) 7 | 8 | {_, input} = Enum.map_reduce(excluded_characters_list, input, fn excluded_character, new_input -> 9 | new_input = String.replace(new_input, excluded_character, "") 10 | {excluded_character, new_input} 11 | end) 12 | 13 | input 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/validation/rules/alpha.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Alpha do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^[a-zA-Z]*$/) 7 | end 8 | 9 | @spec validate?(String.t, String.t) :: boolean 10 | def validate?(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 11 | validate?(Validation.ExcludeCharacters.exclude(input, excluded_characters)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/validation/rules/alphanumeric.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Alphanumeric do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^[a-zA-Z0-9]*$/) 7 | end 8 | 9 | @spec validate?(String.t, String.t) :: boolean 10 | def validate?(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 11 | validate?(Validation.ExcludeCharacters.exclude(input, excluded_characters)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/validation/rules/between.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Between do 2 | @moduledoc false 3 | 4 | @spec validate?(number | String.t, number | String.t, number | String.t) :: boolean 5 | def validate?(value, min, max) when 6 | (is_number(value) and is_number(min) and is_number(max)) 7 | or (is_binary(value) and is_binary(min) and is_binary(max)) 8 | do 9 | if is_binary(min) and is_binary(max) do 10 | if String.length(min) != 1 do 11 | raise "Minimum param has to be a single letter." 12 | end 13 | 14 | if String.length(max) != 1 do 15 | raise "Maximum param has to be a single letter." 16 | end 17 | end 18 | 19 | if min > max do 20 | raise "Minimum param can't be greater than maximum param." 21 | end 22 | 23 | value >= min and value <= max 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/validation/rules/cnh.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CNH do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | # only numbers 7 | input = Regex.replace(~r/\D/, input, "") 8 | 9 | if String.length(input) == 11 do 10 | # validate digits using a modulus 11 algorithm 11 | {_, s1, s2, _, input} = validate_digits(0, 0, 0, 9, input) 12 | 13 | dv1 = rem(s1, 11) 14 | 15 | input_9 = String.at(input, 9) |> String.to_integer 16 | check = if dv1 > 9, do: 0, else: dv1 17 | 18 | if input_9 == check do 19 | dv2 = rem(s2, 11) - (if dv1 > 9, do: 2, else: 0) 20 | 21 | input_10 = String.at(input, 10) |> String.to_integer 22 | 23 | check = 24 | if dv2 < 0 do 25 | dv2 + 11 26 | else 27 | if dv2 > 9, do: 0, else: dv2 28 | end 29 | 30 | input_10 == check 31 | else 32 | false 33 | end 34 | else 35 | false 36 | end 37 | end 38 | 39 | defp validate_digits(c, s1, s2, p, input) when c == 9 do 40 | {c, s1, s2, p, input} 41 | end 42 | 43 | defp validate_digits(c, s1, s2, p, input) do 44 | s1_digit = String.to_integer(String.at(input, c)) * p 45 | s2_digit = String.to_integer(String.at(input, c)) * (10 - p) 46 | 47 | s1 = s1 + s1_digit 48 | s2 = s2 + s2_digit 49 | 50 | c = c + 1 51 | p = p - 1 52 | 53 | validate_digits(c, s1, s2, p, input) 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /lib/validation/rules/cnpj.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CNPJ do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | # Yes, we know. This code is Ugly! 7 | # But it works. Code ported from jsfromhell.com 8 | 9 | # only numbers 10 | digits = Regex.replace(~r/\D/, input, "") 11 | 12 | bases = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] 13 | 14 | if validate_digits_sum(digits) and String.length(digits) == 14 do 15 | {_, n} = Enum.map_reduce(0..11, 0, fn i, n -> 16 | digit_item = String.at(digits, i) |> String.to_integer 17 | base_item = Enum.at(bases, i + 1) 18 | 19 | n = n + (digit_item * base_item) 20 | 21 | {i, n} 22 | end) 23 | 24 | n = rem(n, 11) 25 | 26 | digit_12 = String.at(digits, 12) |> String.to_integer 27 | check = if n < 2, do: 0 , else: 11 - n 28 | 29 | if digit_12 == check do 30 | {_, n} = Enum.map_reduce(0..12, 0, fn i, n -> 31 | digit_item = String.at(digits, i) |> String.to_integer 32 | base_item = Enum.at(bases, i) 33 | 34 | n = n + (digit_item * base_item) 35 | 36 | {i, n} 37 | end) 38 | 39 | n = rem(n, 11) 40 | 41 | digit_13 = String.at(digits, 13) |> String.to_integer 42 | check = if n < 2, do: 0, else: 11 - n 43 | 44 | digit_13 == check 45 | else 46 | false 47 | end 48 | else 49 | false 50 | end 51 | end 52 | 53 | defp validate_digits_sum(digits_string) do 54 | {_, sum} = 55 | digits_string 56 | |> String.codepoints 57 | |> Enum.map_reduce(0, fn digit, total -> 58 | digit = String.to_integer(digit) 59 | {digit, total + digit} 60 | end) 61 | 62 | sum > 0 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /lib/validation/rules/consonant.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Consonant do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^(\s|[b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z])*$/) 7 | end 8 | 9 | @spec validate?(String.t, String.t) :: boolean 10 | def validate?(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 11 | validate?(Validation.ExcludeCharacters.exclude(input, excluded_characters)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/validation/rules/cpf.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CPF do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | # Yes, we know. This code is Ugly! 7 | # But it works. Code ported from jsfromhell.com 8 | 9 | # only numbers 10 | c = Regex.replace(~r/\D/, input, "") 11 | 12 | if initial_validation(c) do 13 | {n, _, _, c} = loop_check(0, 10, 0, c) 14 | 15 | n = rem(n, 11) 16 | 17 | c_9 = String.at(c, 9) |> String.to_integer 18 | check = if n < 2, do: 0, else: 11 - n 19 | 20 | if c_9 == check do 21 | {n, _, _, c} = loop_check(0, 11, 0, c) 22 | 23 | n = rem(n, 11) 24 | 25 | c_10 = String.at(c, 10) |> String.to_integer 26 | check = if n < 2, do: 0, else: 11 - n 27 | 28 | c_10 == check 29 | else 30 | false 31 | end 32 | else 33 | false 34 | end 35 | end 36 | 37 | defp initial_validation(input) do 38 | validate_length(input) 39 | and validate_repeated_value(input) 40 | and validate_invalid_values(input) 41 | end 42 | 43 | defp validate_length(input) do 44 | String.length(input) == 11 45 | end 46 | 47 | defp validate_repeated_value(input) do 48 | first_character = String.at(input, 0) 49 | {:ok, pattern} = Regex.compile("^" <> first_character <> "*$") 50 | not String.match?(input, pattern) 51 | end 52 | 53 | defp validate_invalid_values(input) do 54 | input != "01234567890" 55 | end 56 | 57 | defp loop_check(n, s, i, c) when s == 1 do 58 | {n, s, i, c} 59 | end 60 | 61 | defp loop_check(n, s, i, c) do 62 | c_item = String.at(c, i) |> String.to_integer 63 | 64 | n = n + (c_item * s) 65 | 66 | i = i + 1 67 | s = s - 1 68 | 69 | loop_check(n, s, i, c) 70 | end 71 | end 72 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard do 2 | @moduledoc false 3 | alias Validation.Rules.Luhn 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | Luhn.validate?(input) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/amex.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Amex do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and amex_validation(input) 11 | end 12 | 13 | defp amex_validation(input) do 14 | String.match?(input, ~r/^3[47]\d{13}$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/diners.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Diners do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and diners_validation(input) 11 | end 12 | 13 | defp diners_validation(input) do 14 | String.match?(input, ~r/^3(?:0[0-5]|[68]\d)\d{11}$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/discover.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Discover do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and discover_validation(input) 11 | end 12 | 13 | defp discover_validation(input) do 14 | String.match?(input, ~r/^6(?:011|5\d{2})\d{12}$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/jcb.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Jcb do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and jcb_validation(input) 11 | end 12 | 13 | defp jcb_validation(input) do 14 | String.match?(input, ~r/^(?:2131|1800|35\d{3})\d{11}$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/master.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Master do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and master_validation(input) 11 | end 12 | 13 | defp master_validation(input) do 14 | String.match?(input, ~r/(5[1-5]|2[2-7])\d{14}$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/credit_card/visa.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.Visa do 2 | @moduledoc false 3 | alias Validation.Rules.CreditCard 4 | 5 | @spec validate?(String.t) :: boolean 6 | def validate?(input) when is_binary(input) do 7 | # only numbers 8 | input = Regex.replace(~r/\D/, input, "") 9 | 10 | CreditCard.validate?(input) and visa_validation(input) 11 | end 12 | 13 | defp visa_validation(input) do 14 | String.match?(input, ~r/^4\d{12}(?:\d{3})?$/) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/validation/rules/digit.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Digit do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^[0-9]+$/) 7 | end 8 | 9 | @spec validate?(String.t, String.t) :: boolean 10 | def validate?(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 11 | validate?(Validation.ExcludeCharacters.exclude(input, excluded_characters)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/validation/rules/even.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Even do 2 | @moduledoc false 3 | 4 | @spec validate?(Integer.t) :: boolean 5 | def validate?(input) when is_integer(input) do 6 | import Integer, only: [is_even: 1] 7 | is_even(input) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/validation/rules/lowercase.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Lowercase do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | input == String.downcase(input) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/validation/rules/luhn.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Luhn do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | # only numbers 7 | digits = Regex.replace(~r/\D/, input, "") 8 | 9 | num_digits = String.length(digits) 10 | 11 | if num_digits > 0 do 12 | parity = rem(num_digits, 2) 13 | 14 | {_, sum} = Enum.map_reduce(0..(num_digits - 1), 0, fn i, sum -> 15 | digit_i = String.at(digits, i) |> String.to_integer 16 | 17 | digit = 18 | if parity == rem(i, 2) do 19 | digit = bitwise(digit_i, 1) 20 | 21 | if 9 < digit, do: digit - 9, else: digit 22 | else 23 | digit_i 24 | end 25 | 26 | sum = sum + digit 27 | 28 | {i, sum} 29 | end) 30 | 31 | rem(sum, 10) == 0 32 | else 33 | false 34 | end 35 | end 36 | 37 | defp bitwise(a, b) do 38 | {_, sum} = Enum.map_reduce(1..b, a, fn a, sum -> 39 | {a, sum * 2} 40 | end) 41 | 42 | sum 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /lib/validation/rules/mac_address.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.MacAddress do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/validation/rules/no.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.No do 2 | @moduledoc false 3 | 4 | # @TODO: support other languages 5 | 6 | @spec validate?(String.t) :: boolean 7 | def validate?(input) when is_binary(input) do 8 | String.match?(input, ~r/^n(o(t|pe)?|ix|ay)?$/i) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/validation/rules/odd.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Odd do 2 | @moduledoc false 3 | 4 | @spec validate?(Integer.t) :: boolean 5 | def validate?(input) when is_integer(input) do 6 | import Integer, only: [is_odd: 1] 7 | is_odd(input) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/validation/rules/subdivision_code.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.SubdivisionCode do 2 | alias Validation.Rules.CountryCode 3 | 4 | @moduledoc false 5 | 6 | @spec validate?(String.t, String.t) :: boolean 7 | def validate?(country, subdivision) when is_binary(country) and is_binary(subdivision) do 8 | unless CountryCode.validate?(country) do 9 | raise "Invalid country code (ISO 3166 alpha-2)." 10 | end 11 | 12 | {:ok, root} = File.cwd() 13 | 14 | path = root <> "/data/iso_3166-2/" <> "#{country}.json" 15 | 16 | {:ok, country_string} = File.read(path) 17 | 18 | data = Poison.decode!(country_string) 19 | 20 | Map.has_key?(data, "subdivisions") 21 | and Map.has_key?(data["subdivisions"], subdivision) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/validation/rules/uppercase.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Uppercase do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | input == String.upcase(input) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/validation/rules/uuid.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.UUID do 2 | @moduledoc false 3 | 4 | @pattern_replace "__VERSION__" 5 | @pattern_format "^[0-9a-f]{8}-[0-9a-f]{4}-__VERSION__[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" 6 | 7 | @spec validate?(String.t, integer) :: boolean 8 | def validate?(input, version \\ nil) when is_binary(input) and (is_integer(version) or is_nil(version)) do 9 | validate_supported_versions(version) 10 | 11 | pattern_string = create_pattern(version) 12 | {:ok, pattern} = Regex.compile(pattern_string, "i") 13 | 14 | String.match?(input, pattern) 15 | end 16 | 17 | defp validate_supported_versions(version) do 18 | unless is_nil(version) do 19 | unless Enum.member?([1, 3, 4, 5], version) do 20 | raise "Only versions 1, 3, 4, and 5 are supported." 21 | end 22 | end 23 | end 24 | 25 | defp create_pattern(version) do 26 | if is_nil(version) do 27 | String.replace(@pattern_format, @pattern_replace, "[13-5]") 28 | else 29 | String.replace(@pattern_format, @pattern_replace, version |> Integer.to_string) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/validation/rules/vowel.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Vowel do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^[aeiouAEIOU]*$/) 7 | end 8 | 9 | @spec validate?(String.t, String.t) :: boolean 10 | def validate?(input, excluded_characters) when is_binary(input) and is_binary(excluded_characters) do 11 | validate?(Validation.ExcludeCharacters.exclude(input, excluded_characters)) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/validation/rules/yes.ex: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.Yes do 2 | @moduledoc false 3 | 4 | @spec validate?(String.t) :: boolean 5 | def validate?(input) when is_binary(input) do 6 | String.match?(input, ~r/^y(eah?|ep|es)?$/i) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /media/logo-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elixir-validation/validation/164a62c881e03a307172e4a20413f81260abb2dc/media/logo-docs.png -------------------------------------------------------------------------------- /media/logo-readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elixir-validation/validation/164a62c881e03a307172e4a20413f81260abb2dc/media/logo-readme.png -------------------------------------------------------------------------------- /media/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elixir-validation/validation/164a62c881e03a307172e4a20413f81260abb2dc/media/logo.png -------------------------------------------------------------------------------- /mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.MixProject do 2 | use Mix.Project 3 | 4 | @version "0.0.1-dev" 5 | 6 | def project do 7 | [ 8 | app: :validation, 9 | version: "0.0.2-dev", 10 | elixir: "~> 1.6", 11 | start_permanent: Mix.env() == :prod, 12 | deps: deps(), 13 | 14 | # Hex 15 | description: "Validation library with +25 fully tested rules — Email, IBAN, Credit Card, UUID, MacAddress... and many more!", 16 | package: package(), 17 | 18 | # Docs 19 | name: "Validation", 20 | docs: docs(), 21 | 22 | # coveralls 23 | test_coverage: [tool: ExCoveralls], 24 | preferred_cli_env: [coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test] 25 | ] 26 | end 27 | 28 | def application do 29 | [ 30 | extra_applications: [:logger] 31 | ] 32 | end 33 | 34 | defp package do 35 | [ 36 | maintainers: ["Matheus Gontijo"], 37 | licenses: ["MIT"], 38 | links: %{"GitHub" => "https://github.com/elixir-validation/validation"} 39 | ] 40 | end 41 | 42 | defp deps do 43 | [ 44 | {:poison, "~> 3.1"}, 45 | {:ex_doc, "~> 0.21", only: :dev, runtime: false}, 46 | {:inch_ex, only: :docs}, 47 | {:excoveralls, "~> 0.10", only: :test}, 48 | {:credo, "~> 1.1.0", only: [:dev, :test], runtime: false} 49 | ] 50 | end 51 | 52 | defp docs do 53 | [ 54 | main: "Validation", 55 | source_ref: "v#{@version}", 56 | canonical: "http://hexdocs.pm/validation", 57 | logo: "media/logo-docs.png", 58 | source_url: "https://github.com/elixir-validation/validation", 59 | ] 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | # @TODO: should it be deleted? 2 | 3 | ExUnit.start() 4 | -------------------------------------------------------------------------------- /test/validation/exclude_characters_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.ExcludeCharactersTest do 2 | use ExUnit.Case 3 | alias Validation.ExcludeCharacters 4 | doctest Validation 5 | 6 | test "valid" do 7 | assert(ExcludeCharacters.exclude("gontijo_", "_"), "gontijo") 8 | assert(ExcludeCharacters.exclude("google.com", "."), "googlecom") 9 | assert(ExcludeCharacters.exclude("matheus gontijo", " "), "matheusgontijo") 10 | assert(ExcludeCharacters.exclude("!@#$%^&*(){}abc", "!@#$%^&*(){}"), "abc") 11 | assert(ExcludeCharacters.exclude("[]?+=/\\-_|\",<>.abc", "[]?+=/\\-_|\",<>."), "abc") 12 | assert(ExcludeCharacters.exclude("abc[]?+=/\\-_|\",<>. \t\n", "[]?+=/\\-_|\",<>. \t\n"), "") 13 | assert(ExcludeCharacters.exclude("a-123*d", "123-*"), "ad") 14 | assert(ExcludeCharacters.exclude("gontijo_123", "$"), "gontijo_123") 15 | assert(ExcludeCharacters.exclude("google.com321", "*"), "google.com321") 16 | assert(ExcludeCharacters.exclude("matheus gontijo1", "_"), "matheus gontijo1") 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /test/validation/rules/alpha_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.AlphaTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Alpha, as: V 4 | doctest Validation 5 | 6 | test "valid alpha" do 7 | assert V.validate?("") 8 | assert V.validate?("matheus") 9 | assert V.validate?("gontijo") 10 | assert V.validate?("a") 11 | assert V.validate?("foobar") 12 | end 13 | 14 | test "valid with exclusion of characters" do 15 | assert V.validate?("gontijo_", "_") 16 | assert V.validate?("google.com", ".") 17 | assert V.validate?("matheus gontijo", " ") 18 | assert V.validate?("!@#$%^&*(){}abc", "!@#$%^&*(){}") 19 | assert V.validate?("[]?+=/\\-_|\",<>.abc", "[]?+=/\\-_|\",<>.") 20 | assert V.validate?("abc[]?+=/\\-_|\",<>. \t\n", "[]?+=/\\-_|\",<>. \t\n") 21 | assert V.validate?("a-123*d", "123-*") 22 | end 23 | 24 | test "invalid alpha" do 25 | refute V.validate?("123") 26 | refute V.validate?("number 100%") 27 | refute V.validate?("@#$") 28 | refute V.validate?("_") 29 | refute V.validate?("dgç") 30 | refute V.validate?("\t") 31 | # refute V.validate?("\n") @TODO: WHY IS BREAKLINE MATCHING? 32 | refute V.validate?("\nabc") 33 | refute V.validate?("\tdef") 34 | refute V.validate?("\nabc \t") 35 | refute V.validate?("matheus_gontijo") 36 | end 37 | 38 | test "invalid with exclusion of characters" do 39 | refute V.validate?("gontijo_123", "$") 40 | refute V.validate?("google.com321", "*") 41 | refute V.validate?("matheus gontijo1", "_") 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /test/validation/rules/alphanumeric_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.AlphanumericTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Alphanumeric, as: V 4 | doctest Validation 5 | 6 | test "valid alphanumeric" do 7 | assert V.validate?("") 8 | assert V.validate?("matheus") 9 | assert V.validate?("gontijo") 10 | assert V.validate?("gontijo123") 11 | assert V.validate?("1") 12 | assert V.validate?("a") 13 | assert V.validate?("foobar") 14 | end 15 | 16 | test "valid alphanumeric with exclusion of characters" do 17 | assert V.validate?("gontijo_", "_") 18 | assert V.validate?("google.com", ".") 19 | assert V.validate?("matheus gontijo", " ") 20 | assert V.validate?("!@#$%^&*(){}abc123", "!@#$%^&*(){}") 21 | assert V.validate?("[]?+=/\\-_|\",<>.abc123", "[]?+=/\\-_|\",<>.") 22 | assert V.validate?("abc[]?+=/\\-_|\",<>. \t\n123", "[]?+=/\\-_|\",<>. \t\n") 23 | assert V.validate?("a-1*d", "-*") 24 | end 25 | 26 | test "invalid alphanumeric" do 27 | refute V.validate?("number 100%") 28 | refute V.validate?("@#$") 29 | refute V.validate?("_") 30 | refute V.validate?("dgç") 31 | refute V.validate?("\t") 32 | # refute V.validate?("\n") @TODO: WHY IS BREAKLINE MATCHING? 33 | refute V.validate?("\nabc") 34 | refute V.validate?("\tdef") 35 | refute V.validate?("\nabc \t") 36 | refute V.validate?("matheus_gontijo") 37 | end 38 | 39 | test "invalid alphanumeric with exclusion of characters" do 40 | refute V.validate?("gontijo_", "$") 41 | refute V.validate?("google.com", "*") 42 | refute V.validate?("matheus gontijo", "_") 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/validation/rules/between_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.BetweenTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Between, as: V 4 | doctest Validation 5 | 6 | test "valid ranges - digits" do 7 | assert V.validate?(11, 10, 20) 8 | assert V.validate?(10, 10, 20) 9 | assert V.validate?(20, 10, 20) 10 | assert V.validate?(-11, -20, -10) 11 | assert V.validate?(0, 0, 0) 12 | assert V.validate?(10, 10, 10) 13 | end 14 | 15 | test "valid ranges - letters" do 16 | assert V.validate?("b", "a", "c") 17 | assert V.validate?("b", "a", "z") 18 | assert V.validate?("u", "c", "y") 19 | assert V.validate?("a", "a", "a") 20 | assert V.validate?("z", "z", "z") 21 | assert V.validate?("a", "a", "z") 22 | assert V.validate?("B", "A", "Z") 23 | end 24 | 25 | test "invalid mac address - digits" do 26 | refute V.validate?(99, 10, 20) 27 | refute V.validate?(88, 10, 20) 28 | refute V.validate?(-99, -20, -10) 29 | end 30 | 31 | test "invalid ranges - letters" do 32 | refute V.validate?("b", "t", "u") 33 | refute V.validate?("a", "z", "z") 34 | refute V.validate?("A", "Z", "Z") 35 | end 36 | 37 | test "exception - Minimum param can't be greater than maximum param." do 38 | assert_raise RuntimeError, "Minimum param can't be greater than maximum param.", fn -> 39 | V.validate?(0, 20, 10) 40 | V.validate?("a", "z", "a") 41 | end 42 | end 43 | 44 | test "exception - Minimum param has to be a single letter." do 45 | assert_raise RuntimeError, "Minimum param has to be a single letter.", fn -> 46 | V.validate?("a", "abc", "a") 47 | end 48 | end 49 | 50 | test "exception - Maximum param has to be a single letter." do 51 | assert_raise RuntimeError, "Maximum param has to be a single letter.", fn -> 52 | V.validate?("a", "a", "abc") 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /test/validation/rules/cnpj_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CNPJTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CNPJ, as: V 4 | doctest Validation 5 | 6 | test "valid cnpj" do 7 | assert V.validate?("32.063.364/0001-07") 8 | assert V.validate?("24.663.454/0001-00") 9 | assert V.validate?("57.535.083/0001-30") 10 | assert V.validate?("24.760.428/0001-09") 11 | assert V.validate?("27.355.204/0001-00") 12 | assert V.validate?("36.310.327/0001-07") 13 | assert V.validate?("38175021000110") 14 | assert V.validate?("37550610000179") 15 | assert V.validate?("12774546000189") 16 | assert V.validate?("77456211000168") 17 | assert V.validate?("02023077000102") 18 | end 19 | 20 | test "invalid cnpj" do 21 | refute V.validate?("12.345.678/9012-34") 22 | refute V.validate?("11.111.111/1111-11") 23 | refute V.validate?("00000000000000") 24 | refute V.validate?("11111111111111") 25 | refute V.validate?("22222222222222") 26 | refute V.validate?("33333333333333") 27 | refute V.validate?("44444444444444") 28 | refute V.validate?("55555555555555") 29 | refute V.validate?("66666666666666") 30 | refute V.validate?("77777777777777") 31 | refute V.validate?("88888888888888") 32 | refute V.validate?("99999999999999") 33 | refute V.validate?("12345678900123") 34 | refute V.validate?("99299929384987") 35 | refute V.validate?("84434895894444") 36 | refute V.validate?("44242340000000") 37 | refute V.validate?("1") 38 | refute V.validate?("22") 39 | refute V.validate?("123") 40 | refute V.validate?("992999999999929384") 41 | refute V.validate?("99-010-0.") 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /test/validation/rules/consonant_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.ConsonantTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Consonant, as: V 4 | doctest Validation 5 | 6 | test "valid consonant" do 7 | assert V.validate?("b") 8 | assert V.validate?("c") 9 | assert V.validate?("d") 10 | assert V.validate?("w") 11 | assert V.validate?("y") 12 | assert V.validate?("qrst") 13 | assert V.validate?("bcdfghklmnp") 14 | end 15 | 16 | test "valid consonant with exclusion of characters" do 17 | assert V.validate?("wo", "o") 18 | assert V.validate?("", "_") 19 | assert V.validate?("_", "_") 20 | assert V.validate?("bcdfghklm np", " ") 21 | assert V.validate?("\nz\t", "\n\t") 22 | assert V.validate?("www%", "%") 23 | assert V.validate?("!@#$%^&*(){} bc dfg", "!@#$%^&*(){} ") 24 | end 25 | 26 | test "invalid consonant" do 27 | refute V.validate?("a") 28 | refute V.validate?("ul") 29 | refute V.validate?("aeiou") 30 | refute V.validate?("Foo") 31 | refute V.validate?("basic") 32 | end 33 | 34 | test "invalid consonant with exclusion of characters" do 35 | refute V.validate?("ou", "o") 36 | refute V.validate?("&_", "_") 37 | refute V.validate?("abcdfghklm np", " ") 38 | refute V.validate?("i\nz\t", "\n\t") 39 | refute V.validate?("wwwa%", "%") 40 | refute V.validate?("+!@#$%^&*(){} bc dfg", "!@#$%^&*(){} ") 41 | refute V.validate?("a+!@#$%^&*(){} bc dfg", "!@#$%^&*(){} ") 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /test/validation/rules/country_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CountryCodeTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CountryCode, as: V 4 | doctest Validation 5 | 6 | test "valid country code" do 7 | assert V.validate?("BR", :alpha2) 8 | assert V.validate?("BRA", :alpha3) 9 | assert V.validate?("076", :numeric) 10 | assert V.validate?("DE", :alpha2) 11 | assert V.validate?("DEU", :alpha3) 12 | assert V.validate?("276", :numeric) 13 | assert V.validate?("US", :alpha2) 14 | assert V.validate?("USA", :alpha3) 15 | assert V.validate?("840", :numeric) 16 | end 17 | 18 | test "invalid country code" do 19 | refute V.validate?("", :alpha2) 20 | refute V.validate?("USA", :alpha2) 21 | refute V.validate?("US", :alpha3) 22 | refute V.validate?("000", :numeric) 23 | end 24 | 25 | test "exception - Invalid type param. It should be either: :alpha2, :alpha3 or :numeric." do 26 | assert_raise RuntimeError, "Invalid type param. It should be either: :alpha2, :alpha3 or :numeric.", fn -> 27 | V.validate?("BR", :unknown_type) 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /test/validation/rules/cpf_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CPFTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CPF, as: V 4 | doctest Validation 5 | 6 | test "valid cpf" do 7 | assert V.validate?("342.444.198-88") 8 | assert V.validate?("342.444.198.88") 9 | assert V.validate?("350.45261819") 10 | assert V.validate?("693-319-118-40") 11 | assert V.validate?("3.6.8.8.9.2.5.5.4.8.8") 12 | assert V.validate?("11598647644") 13 | assert V.validate?("86734718697") 14 | assert V.validate?("86223423284") 15 | assert V.validate?("24845408333") 16 | assert V.validate?("95574461102") 17 | end 18 | 19 | test "invalid cpf" do 20 | refute V.validate?("") 21 | refute V.validate?("01234567890") 22 | refute V.validate?("000.000.000-00") 23 | refute V.validate?("111.222.444-05") 24 | refute V.validate?("999999999.99") 25 | refute V.validate?("8.8.8.8.8.8.8.8.8.8.8") 26 | refute V.validate?("693-319-110-40") 27 | refute V.validate?("698.111-111.00") 28 | refute V.validate?("11111111111") 29 | refute V.validate?("22222222222") 30 | refute V.validate?("12345678900") 31 | refute V.validate?("99299929384") 32 | refute V.validate?("84434895894") 33 | refute V.validate?("44242340000") 34 | refute V.validate?("1") 35 | refute V.validate?("22") 36 | refute V.validate?("123") 37 | refute V.validate?("992999999999929384") 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/amex_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.AmexTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Amex, as: V 4 | doctest Validation 5 | 6 | test "valid credit card - amex" do 7 | assert V.validate?("340-3161-9380-9364") 8 | end 9 | 10 | test "invalid credit card - amex" do 11 | refute V.validate?("6011000990139424") # discover 12 | refute V.validate?("30351042633884") # diners 13 | refute V.validate?("3566002020360505") # jcb 14 | refute V.validate?("5376 7473 9720 8720") # master 15 | refute V.validate?("2222 4000 4124 0011") # master 16 | refute V.validate?("4024.0071.5336.1885") # visa 17 | refute V.validate?("4024 007 193 879") # visa 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/diners_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.DinersTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Diners, as: V 4 | doctest Validation 5 | 6 | test "valid credit card - diners" do 7 | assert V.validate?("30351042633884") 8 | end 9 | 10 | test "invalid credit card - diners" do 11 | refute V.validate?("340-3161-9380-9364") # amex 12 | refute V.validate?("6011000990139424") # discover 13 | refute V.validate?("3566002020360505") # jcb 14 | refute V.validate?("5376 7473 9720 8720") # master 15 | refute V.validate?("2222 4000 4124 0011") # master 16 | refute V.validate?("4024.0071.5336.1885") # visa 17 | refute V.validate?("4024 007 193 879") # visa 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/discover_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.DiscoverTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Discover, as: V 4 | doctest Validation 5 | 6 | test "valid credit card - discover" do 7 | assert V.validate?("6011000990139424") 8 | end 9 | 10 | test "invalid credit card - discover" do 11 | refute V.validate?("340-3161-9380-9364") # amex 12 | refute V.validate?("30351042633884") # diners 13 | refute V.validate?("3566002020360505") # jcb 14 | refute V.validate?("5376 7473 9720 8720") # master 15 | refute V.validate?("2222 4000 4124 0011") # master 16 | refute V.validate?("4024.0071.5336.1885") # visa 17 | refute V.validate?("4024 007 193 879") # visa 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/jcb_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.JcbTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Jcb, as: V 4 | doctest Validation 5 | 6 | test "valid credit card - jcb" do 7 | assert V.validate?("3566002020360505") 8 | end 9 | 10 | test "invalid credit card - jcb" do 11 | refute V.validate?("340-3161-9380-9364") # amex 12 | refute V.validate?("6011000990139424") # discover 13 | refute V.validate?("30351042633884") # diners 14 | refute V.validate?("5376 7473 9720 8720") # master 15 | refute V.validate?("2222 4000 4124 0011") # master 16 | refute V.validate?("4024.0071.5336.1885") # visa 17 | refute V.validate?("4024 007 193 879") # visa 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/master_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.MasterTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Master, as: V 4 | doctest Validation 5 | 6 | test "invalid credit card - master" do 7 | assert V.validate?("2222 4000 4124 0011") 8 | assert V.validate?("5376 7473 9720 8720") 9 | end 10 | 11 | test "invalid credit card - visa" do 12 | refute V.validate?("340-3161-9380-9364") # amex 13 | refute V.validate?("6011000990139424") # discover 14 | refute V.validate?("30351042633884") # diners 15 | refute V.validate?("3566002020360505") # jcb 16 | refute V.validate?("4024.0071.5336.1885") # visa 17 | refute V.validate?("4024 007 193 879") # visa 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card/visa_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCard.VisaTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard.Visa, as: V 4 | doctest Validation 5 | 6 | test "valid credit card - visa" do 7 | assert V.validate?("4024 007 193 879") 8 | assert V.validate?("4024.0071.5336.1885") 9 | end 10 | 11 | test "invalid credit card - visa" do 12 | refute V.validate?("340-3161-9380-9364") # amex 13 | refute V.validate?("6011000990139424") # discover 14 | refute V.validate?("30351042633884") # diners 15 | refute V.validate?("3566002020360505") # jcb 16 | refute V.validate?("5376 7473 9720 8720") # master 17 | refute V.validate?("2222 4000 4124 0011") # master 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /test/validation/rules/credit_card_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CreditCardTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CreditCard, as: V 4 | doctest Validation 5 | 6 | test "valid credit card" do 7 | assert V.validate?("5555444433331111") 8 | assert V.validate?("5376 7473 9720 8720") 9 | assert V.validate?("2223000048400011") 10 | assert V.validate?("2222 4000 4124 0011") 11 | assert V.validate?("4024.0071.5336.1885") 12 | assert V.validate?("4024 007 193 879") 13 | assert V.validate?("340-3161-9380-9364") 14 | assert V.validate?("30351042633884") 15 | assert V.validate?("6011000990139424") 16 | assert V.validate?("3566002020360505") 17 | end 18 | 19 | test "invalid credit card" do 20 | refute V.validate?("") 21 | refute V.validate?("it isnt my credit c)ard number") 22 | refute V.validate?("&stR@ng3|) (|-|@r$") 23 | refute V.validate?("1234 1234 1234 1234") 24 | refute V.validate?("1234.1234.1234.12)34") 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /test/validation/rules/currency_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.CurrencyCodeTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.CurrencyCode, as: V 4 | doctest Validation 5 | 6 | test "valid currency code" do 7 | assert V.validate?("EUR") 8 | assert V.validate?("GBP") 9 | assert V.validate?("XAU") 10 | assert V.validate?("XBA") 11 | assert V.validate?("XXX") 12 | end 13 | 14 | test "invalid currency code" do 15 | refute V.validate?("BTC") 16 | refute V.validate?("GGP") 17 | refute V.validate?("USA") 18 | refute V.validate?("xxx") 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /test/validation/rules/digit_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.DigitTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Digit, as: V 4 | doctest Validation 5 | 6 | test "valid digit" do 7 | assert V.validate?("165") 8 | assert V.validate?("01650") 9 | assert V.validate?("01") 10 | end 11 | 12 | test "valid digit with exclusion of characters" do 13 | assert V.validate?("1.0", ".") 14 | assert V.validate?("16-50", "-") 15 | assert V.validate?("16-5.0", "-.") 16 | assert V.validate?("!@#$%^8&*(){}", "!@#$%^&*(){}") 17 | assert V.validate?("012.071.070-69", "-.") 18 | end 19 | 20 | test "invalid digit" do 21 | refute V.validate?("") 22 | refute V.validate?("-1.1") 23 | refute V.validate?("-12") 24 | refute V.validate?("1.0") 25 | refute V.validate?("16 50") 26 | refute V.validate?("16-50") 27 | refute V.validate?("1\n1") 28 | refute V.validate?("1\t1") 29 | refute V.validate?("a") 30 | refute V.validate?("a1") 31 | end 32 | 33 | test "invalid digit with exclusion of characters" do 34 | refute V.validate?("1.%0", ".") 35 | refute V.validate?("16-a50", "-") 36 | refute V.validate?("3333316-5.0/", "-.") 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /test/validation/rules/email_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.EmailTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Email, as: V 4 | doctest Validation 5 | 6 | test "valid email" do 7 | assert V.validate?("test@test.com") 8 | assert V.validate?("mail+mail@gmail.com") 9 | assert V.validate?("mail.email@e.test.com") 10 | assert V.validate?("a@a.a") 11 | assert V.validate?("email@domain.com") 12 | assert V.validate?("firstname.lastname@domain.com") 13 | assert V.validate?("email@subdomain.domain.com") 14 | assert V.validate?("firstname+lastname@domain.com") 15 | assert V.validate?("email@123.123.123.123") 16 | assert V.validate?("email@[123.123.123.123]") 17 | assert V.validate?("\"email\"@domain.com") 18 | assert V.validate?("1234567890@domain.com") 19 | assert V.validate?("email@domain-one.com") 20 | assert V.validate?("_______@domain.com") 21 | assert V.validate?("email@domain.name") 22 | assert V.validate?("email@domain.co.jp") 23 | assert V.validate?("firstname-lastname@domain.com") 24 | end 25 | 26 | test "invalid email" do 27 | refute V.validate?("") 28 | refute V.validate?("test") 29 | refute V.validate?("@test.com") 30 | refute V.validate?("mail@test@test.com") 31 | refute V.validate?("test.test@") 32 | refute V.validate?("test.@test.com") 33 | refute V.validate?("test@.test.com") 34 | refute V.validate?("test@test..com") 35 | refute V.validate?("test@test.com.") 36 | refute V.validate?(".test@test.com") 37 | refute V.validate?("plainaddress") 38 | refute V.validate?("#@%^%#$@#$@#.com") 39 | refute V.validate?("@domain.com") 40 | refute V.validate?("email.domain.com") 41 | refute V.validate?("email@domain@domain.com") 42 | refute V.validate?(".email@domain.com") 43 | refute V.validate?("email.@domain.com") 44 | refute V.validate?("email..email@domain.com") 45 | refute V.validate?("email@domain.com (Joe Smith)") 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /test/validation/rules/even_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.EvenTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Even, as: V 4 | doctest Validation 5 | 6 | test "valid even" do 7 | assert V.validate?(0) 8 | assert V.validate?(2) 9 | assert V.validate?(4) 10 | assert V.validate?(100) 11 | assert V.validate?(-2) 12 | assert V.validate?(9_999_998) 13 | end 14 | 15 | test "invalid even" do 16 | refute V.validate?(1) 17 | refute V.validate?(3) 18 | refute V.validate?(5) 19 | refute V.validate?(-1) 20 | refute V.validate?(9_999_999) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/validation/rules/language_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.LanguageCodeTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.LanguageCode, as: V 4 | doctest Validation 5 | 6 | test "valid language code" do 7 | assert V.validate?("en", :alpha2) 8 | assert V.validate?("it", :alpha2) 9 | assert V.validate?("la", :alpha2) 10 | assert V.validate?("pt", :alpha2) 11 | assert V.validate?("eng", :alpha3) 12 | assert V.validate?("ita", :alpha3) 13 | assert V.validate?("lat", :alpha3) 14 | assert V.validate?("por", :alpha3) 15 | end 16 | 17 | test "invalid language code" do 18 | refute V.validate?("por", :alpha2) 19 | refute V.validate?("", :alpha2) 20 | refute V.validate?("pt", :alpha3) 21 | refute V.validate?("", :alpha3) 22 | end 23 | 24 | test "exception - Invalid type param. It should be either: :alpha2 or :alpha3." do 25 | assert_raise RuntimeError, "Invalid type param. It should be either: :alpha2 or :alpha3.", fn -> 26 | V.validate?("pt", :unknown_type) 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /test/validation/rules/lowercase_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.LowercaseTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Lowercase, as: V 4 | doctest Validation 5 | 6 | test "valid lowercase" do 7 | assert V.validate?("") 8 | assert V.validate?("lowercase") 9 | assert V.validate?("lowercase-with-dashes") 10 | assert V.validate?("lowercase with spaces") 11 | assert V.validate?("lowercase with numbers 123") 12 | assert V.validate?("lowercase with specials characters like ã ç ê") 13 | assert V.validate?("with specials characters like # $ % & * +") 14 | assert V.validate?("τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός") 15 | assert V.validate?("42") 16 | assert V.validate?("!@#$%^") 17 | end 18 | 19 | test "invalid lowercase" do 20 | refute V.validate?("UPPERCASE") 21 | refute V.validate?("CamelCase") 22 | refute V.validate?("First Character Uppercase") 23 | refute V.validate?("With Numbers 1 2 3") 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/validation/rules/luhn_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.LuhnTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Luhn, as: V 4 | doctest Validation 5 | 6 | test "valid luhn" do 7 | assert V.validate?("9773725370") 8 | assert V.validate?("2222400041240011") 9 | assert V.validate?("340316193809364") 10 | assert V.validate?("6011000990139424") 11 | end 12 | 13 | test "invalid luhn" do 14 | refute V.validate?("") 15 | refute V.validate?("true") 16 | refute V.validate?("2222400041240021") 17 | refute V.validate?("340316193809334") 18 | refute V.validate?("8888888888888887") 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /test/validation/rules/mac_address_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.MacAddressTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.MacAddress, as: V 4 | doctest Validation 5 | 6 | test "valid mac address" do 7 | assert V.validate?("00:11:22:33:44:55") 8 | assert V.validate?("66-77-88-99-aa-bb") 9 | assert V.validate?("AF:0F:bd:12:44:ba") 10 | assert V.validate?("90-bc-d3-1a-dd-cc") 11 | end 12 | 13 | test "invalid mac address" do 14 | refute V.validate?("") 15 | refute V.validate?("00-1122:33:44:55") 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/validation/rules/no_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.NoTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.No, as: V 4 | doctest Validation 5 | 6 | test "valid no" do 7 | assert V.validate?("N") 8 | assert V.validate?("n") 9 | assert V.validate?("Nay") 10 | assert V.validate?("Nix") 11 | assert V.validate?("No") 12 | assert V.validate?("Nope") 13 | assert V.validate?("Not") 14 | end 15 | 16 | test "invalid no" do 17 | refute V.validate?("Donnot") 18 | refute V.validate?("Never") 19 | refute V.validate?("Niet") 20 | refute V.validate?("Noooooooo") 21 | refute V.validate?("Não") 22 | refute V.validate?("não") 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /test/validation/rules/odd_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.OddTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Odd, as: V 4 | doctest Validation 5 | 6 | test "valid odd" do 7 | assert V.validate?(1) 8 | assert V.validate?(3) 9 | assert V.validate?(5) 10 | assert V.validate?(-1) 11 | assert V.validate?(9_999_999) 12 | end 13 | 14 | test "invalid odd" do 15 | refute V.validate?(0) 16 | refute V.validate?(2) 17 | refute V.validate?(4) 18 | refute V.validate?(100) 19 | refute V.validate?(-2) 20 | refute V.validate?(9_999_998) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/validation/rules/subdivision_code_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.SubdivisionCodeTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.SubdivisionCode, as: V 4 | doctest Validation 5 | 6 | test "valid subdivision code" do 7 | assert V.validate?("US", "TX") 8 | assert V.validate?("BR", "SP") 9 | assert V.validate?("CA", "BC") 10 | end 11 | 12 | test "invalid subdivision code" do 13 | refute V.validate?("US", "AA") 14 | refute V.validate?("BR", "BB") 15 | refute V.validate?("CA", "CC") 16 | end 17 | 18 | test "exception - Invalid country code (ISO 3166 alpha-2)." do 19 | assert_raise RuntimeError, "Invalid country code (ISO 3166 alpha-2).", fn -> 20 | V.validate?("AAAA", "CA") 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /test/validation/rules/tld_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.TldTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Tld, as: V 4 | doctest Validation 5 | 6 | test "valid tld" do 7 | assert V.validate?("br") 8 | assert V.validate?("cafe") 9 | assert V.validate?("com") 10 | assert V.validate?("democrat") 11 | assert V.validate?("eu") 12 | assert V.validate?("gmbh") 13 | assert V.validate?("us") 14 | end 15 | 16 | test "invalid tld" do 17 | refute V.validate?("") 18 | refute V.validate?("1") 19 | refute V.validate?("1.0") 20 | refute V.validate?("wrongtld") 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/validation/rules/uppercase_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.UppercaseTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Uppercase, as: V 4 | doctest Validation 5 | 6 | test "valid uppercase" do 7 | assert V.validate?("") 8 | assert V.validate?("UPPERCASE") 9 | assert V.validate?("UPPERCASE-WITH-DASHES") 10 | assert V.validate?("UPPERCASE WITH SPACES") 11 | assert V.validate?("UPPERCASE WITH NUMBERS 123") 12 | assert V.validate?("UPPERCASE WITH SPECIALS CHARACTERS LIKE Ã Ç Ê") 13 | assert V.validate?("WITH SPECIALS CHARACTERS LIKE # $ % & * +") 14 | assert V.validate?("ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ") 15 | assert V.validate?("42") 16 | assert V.validate?("!@#$%^") 17 | end 18 | 19 | test "invalid uppercase" do 20 | refute V.validate?("lowercase") 21 | refute V.validate?("CamelCase") 22 | refute V.validate?("First Character Uppercase") 23 | refute V.validate?("With Numbers 1 2 3") 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/validation/rules/uuid_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.UUIDTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.UUID, as: V 4 | doctest Validation 5 | 6 | @uuid_version_1 "e4eaaaf2-d142-11e1-b3e4-080027620cdd" 7 | @uuid_version_3 "11a38b9a-b3da-360f-9353-a5a725514269" 8 | @uuid_version_4 "25769c6c-d34d-4bfe-ba98-e0ee856f3e7a" 9 | @uuid_version_5 "c4a760a8-dbcf-5254-a0d9-6a4474bd1b62" 10 | 11 | test "valid yes" do 12 | assert V.validate?(@uuid_version_1) 13 | assert V.validate?(@uuid_version_3) 14 | assert V.validate?(@uuid_version_4) 15 | assert V.validate?(@uuid_version_5) 16 | 17 | assert V.validate?(@uuid_version_1, 1) 18 | assert V.validate?(@uuid_version_3, 3) 19 | assert V.validate?(@uuid_version_4, 4) 20 | assert V.validate?(@uuid_version_5, 5) 21 | end 22 | 23 | test "invalid yes" do 24 | refute V.validate?("") 25 | refute V.validate?("00000000-0000-0000-0000-000000000000") 26 | refute V.validate?("Not an UUID") 27 | refute V.validate?("g71a18f4-3a13-11e7-a919-92ebcb67fe33") 28 | refute V.validate?("a71a18f43a1311e7a91992ebcb67fe33") 29 | 30 | refute V.validate?(@uuid_version_1, 5) 31 | refute V.validate?(@uuid_version_3, 4) 32 | refute V.validate?(@uuid_version_4, 3) 33 | refute V.validate?(@uuid_version_5, 1) 34 | end 35 | 36 | test "exception - Only versions 1, 3, 4, and 5 are supported." do 37 | assert_raise RuntimeError, "Only versions 1, 3, 4, and 5 are supported.", fn -> 38 | assert V.validate?(@uuid_version_1, -888) 39 | assert V.validate?(@uuid_version_1, 9999) 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /test/validation/rules/vowel_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.VowelTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Vowel, as: V 4 | doctest Validation 5 | 6 | test "valid vowel" do 7 | assert V.validate?("a") 8 | assert V.validate?("e") 9 | assert V.validate?("i") 10 | assert V.validate?("o") 11 | assert V.validate?("u") 12 | assert V.validate?("aeiou") 13 | assert V.validate?("uoiea") 14 | end 15 | 16 | test "valid vowel with exclusion of characters" do 17 | assert V.validate?("!@#$%^&*(){}aeoiu", "!@#$%^&*(){}") 18 | assert V.validate?("[]?+=/\\-_|\"\',<>.aeoiu", "[]?+=/\\-_|\"\',<>.") 19 | end 20 | 21 | test "invalid vowel" do 22 | # refute V.validate?("\n") @TODO: WHY IS BREAKLINE MATCHING? 23 | refute V.validate?("\t") 24 | refute V.validate?("\r") 25 | refute V.validate?("ul") 26 | refute V.validate?("16") 27 | refute V.validate?("F") 28 | refute V.validate?("g") 29 | refute V.validate?("Foo") 30 | refute V.validate?("5") 31 | refute V.validate?("basic") 32 | end 33 | 34 | test "invalid vowel with exclusion of characters" do 35 | refute V.validate?("!@#$%^&*(){}aeoiuk", "!@#$%^&*(){}") 36 | refute V.validate?("k[]?+=/\\-_|\"\',<>.aeoiu", "[]?+=/\\-_|\"\',<>.") 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /test/validation/rules/yes_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Validation.Rules.YesTest do 2 | use ExUnit.Case 3 | alias Validation.Rules.Yes, as: V 4 | doctest Validation 5 | 6 | test "valid yes" do 7 | assert V.validate?("Y") 8 | assert V.validate?("Yea") 9 | assert V.validate?("Yeah") 10 | assert V.validate?("Yep") 11 | assert V.validate?("Yes") 12 | assert V.validate?("yes") 13 | end 14 | 15 | test "invalid yes" do 16 | refute V.validate?("let's thrown an error") 17 | refute V.validate?("Yydoesnotmatter") 18 | refute V.validate?("Si") 19 | refute V.validate?("Sim") 20 | refute V.validate?("Yoo") 21 | refute V.validate?("Yiip") 22 | end 23 | end 24 | --------------------------------------------------------------------------------