o
    1iyE                     @   s  U d Z ddlZddlZddlmZmZ ddlmZ er!ddlm	Z	 zddl
mZ W n ey;   dedd	fd
dZY nw i deddeddeddeddeddeddeddeddeddedd ed!d"ed#d$ed%d&ed'd(ed)d*ed+d,ed-i d.ed/d0ed1d2ed3d4ed5d6ed7d8ed9d:ed;d<ed=d>ed?d@edAdBedCdDedEdFedGdHedIdJedKdLedMdNedOi dPedQdRedSdTedUdVedWdXedYdZed[d\ed]d^ed_d`edadbedcddededfedgdhedidjedkdledmdnedodpedqi dredsdtedudvedwdxedydzed{d|ed}d~eddeddeddeddeddeddeddeddeddeddedi deddeddeddeddeddeddeddeddeddeddeddeddeddeddeddeddedi deddeddeddeddeddeddedÃdedŃdedǃdedɃded˃ded̓dedσdedуdedӃdedՃded׃i dedكdedۃded݃ded߃deddeddeddeddeddeddeddeddeddeddeddeddedi deddeddedd eddeddeddedded	d
eddeddeddeddeddeddeddeddedi deddedd ed!d"ed#d$ed%d&ed'd(ed)d*ed+d,ed-d.ed/d0ed1d2ed3d4ed5d6ed7d8ed9d:ed;d<ed=i d>ed?d@edAdBedCdDedEdFedGdHedIdJedKdLedMdNedOdPedQdRedSdTedUdVedWdXedYdZed[d\ed]d^ed_i d`edadbedcddededfedgdhedidjedkdledmdnedodpedqdredsdtedudvedwdxedydzed{d|ed}d~eddedi deddeddeddeddeddeddeddeddeddeddeddeddeddeddeddeddedi deddeddeddeddeddeddeddeddeddeddeddeddeddeddeddedÃdedŃi dedǃdedɃded˃ded̓dedσdedуdedӃdedՃded׃dedكdedۃded݃ded߃deddeddeddededededededededededededdZded< i ddddddddddddddddddddd d d"dd$dd&dd(dd*dd,di d.dd0dd2d	d4d
d6dd8dd:dd<dd>dd@ddBddDddFddHddJddLddNdi dPddRddTddVddXddZdd\dd^dd`d dbd!ddd"dfd#dhd$djd%dld&dnd'dpd(i drd)dtd*dvd+dxd,dzd-d|d.d~d/dd0dd1dd2dd3dd4dd5dd6dd7dd8dd9i dd:dd;dd<dd=dd>dd?dd@ddAddBddCddDddEddFddGddHddIddJi ddKddLddMddNddOddPddQdĐdRdƐdSdȐdTdʐdUd̐dVdΐdWdАdXdҐdYdԐdZd֐d[i dؐd\dڐd]dܐd^dސd_dd`ddaddbddcdddddeddfddgddhddiddjddkddli ddmddnddod dpddqddrddsddtd
duddvddwddxddyddzdd{dd|dd}i dd~ddd dd"dd$dd&dd(dd*dd,dd.dd0dd2dd4dd6dd8dd:dd<di d>dd@ddBddDddFddHddJddLddNddPddRddTddVddXddZdd\dd^di d`ddbdddddfddhddjddlddnddpddrddtddvddxddzdd|dd~dddi ddddddddddddddddddddddddddddddddddi ddddÓddēddœddƓddǓddȓddɓddʓdd˓dd̓dd͓ddΓddϓddГddѓdĐdғi dƐdӓdȐdԓdʐdՓd̐d֓dΐdדdАdؓdҐdٓdԐdړd֐dۓdؐdܓdڐdݓdܐdޓdސdߓddddddddddddddddddddZ	ddedefddZddefddZd ddZedk
reeZedee d ed e  e  dS dS (  a  
This is a self-generating script that contains all of the iso3166-1 data.

To regenerate, a CSV file must be created that contains the latest data. Here's
how to do that:

1. Visit https://www.iso.org/obp
2. Click the "Country Codes" radio option and click the search button
3. Change the results per page to 300
4. Copy the html table and paste into Libreoffice Calc / Excel
5. Delete the French short name column
6. Delete the heading row.
7. Save as a CSV file in django_countries/iso3166-1.csv
8. Run this script from the command line
    N)TYPE_CHECKINGDict)CountriesBase)
StrPromise)gettext_lazymessagereturnr   c                 C   s   | S )N )r   r	   r	   V/var/www/html/humari/django-venv/lib/python3.10/site-packages/django_countries/data.py_   s   r   AFAfghanistanAXu   Åland IslandsALAlbaniaDZAlgeriaASzAmerican SamoaADAndorraAOAngolaAIAnguillaAQ
AntarcticaAGzAntigua and BarbudaAR	ArgentinaAMArmeniaAWArubaAU	AustraliaATAustriaAZ
AzerbaijanBSzBahamas (The)BHBahrainBD
BangladeshBBBarbadosBYBelarusBEBelgiumBZBelizeBJBeninBMBermudaBTBhutanBOz Bolivia (Plurinational State of)BQz Bonaire, Sint Eustatius and SabaBAzBosnia and HerzegovinaBWBotswanaBVzBouvet IslandBRBrazilIOzBritish Indian Ocean TerritoryBNzBrunei DarussalamBGBulgariaBFzBurkina FasoBIBurundiCVz
Cabo VerdeKHCambodiaCMCameroonCACanadaKYzCayman IslandsCFzCentral African RepublicTDChadCLChileCNChinaCXzChristmas IslandCCzCocos (Keeling) IslandsCOColombiaKMComorosCGCongoCDz&Congo (the Democratic Republic of the)CKzCook IslandsCRz
Costa RicaCIu   Côte d'IvoireHRCroatiaCUCubaCWu   CuraçaoCYCyprusCZCzechiaDKDenmarkDJDjiboutiDMDominicaDOzDominican RepublicECEcuadorEGEgyptSVzEl SalvadorGQzEquatorial GuineaEREritreaEEEstoniaSZEswatiniETEthiopiaFKzFalkland Islands (Malvinas)FOzFaroe IslandsFJFijiFIFinlandFRFranceGFzFrench GuianaPFzFrench PolynesiaTFzFrench Southern TerritoriesGAGabonGMGambiaGEGeorgiaDEGermanyGHGhanaGI	GibraltarGRGreeceGL	GreenlandGDGrenadaGP
GuadeloupeGUGuamGT	GuatemalaGGGuernseyGNGuineaGWzGuinea-BissauGYGuyanaHTHaitiHMz!Heard Island and McDonald IslandsVAzHoly SeeHNHondurasHKz	Hong KongHUHungaryISIcelandINIndiaID	IndonesiaIRzIran (Islamic Republic of)IQIraqIEIrelandIMzIsle of ManILIsraelITItalyJMJamaicaJPJapanJEJerseyJOJordanKZ
KazakhstanKEKenyaKIKiribatiKPz+Korea (the Democratic People's Republic of)KRzKorea (the Republic of)KWKuwaitKG
KyrgyzstanLAz Lao People's Democratic RepublicLVLatviaLBLebanonLSLesothoLRLiberiaLYLibyaLILiechtensteinLT	LithuaniaLU
LuxembourgMOMacaoMG
MadagascarMWMalawiMYMalaysiaMVMaldivesMLMaliMTMaltaMHzMarshall IslandsMQ
MartiniqueMR
MauritaniaMU	MauritiusYTMayotteMXMexicoFMz Micronesia (Federated States of)MDzMoldova (the Republic of)MCMonacoMNMongoliaME
MontenegroMS
MontserratMAMoroccoMZ
MozambiqueMMMyanmarNANamibiaNRNauruNPNepalNLzNetherlands (Kingdom of the)NCzNew CaledoniaNZzNew ZealandNI	NicaraguaNENigerNGNigeriaNUNiueNFzNorfolk IslandMKzNorth MacedoniaMPzNorthern Mariana IslandsNONorwayOMOmanPKPakistanPWPalauPSzPalestine, State ofPAPanamaPGzPapua New GuineaPYParaguayPEPeruPHPhilippinesPNPitcairnPLPolandPTPortugalPRzPuerto RicoQAQatarREu   RéunionRORomaniaRUzRussian FederationRWRwandaBLu   Saint BarthélemySHz,Saint Helena, Ascension and Tristan da CunhaKNzSaint Kitts and NevisLCzSaint LuciaMFzSaint Martin (French part)PMzSaint Pierre and MiquelonVCz Saint Vincent and the GrenadinesWSSamoaSMz
San MarinoSTzSao Tome and PrincipeSAzSaudi ArabiaSNSenegalRSSerbiaSC
SeychellesSLzSierra LeoneSG	SingaporeSXzSint Maarten (Dutch part)SKSlovakiaSISloveniaSBzSolomon IslandsSOSomaliaZAzSouth AfricaGSz,South Georgia and the South Sandwich IslandsSSzSouth SudanESSpainLKz	Sri LankaSDSudanSRSurinameSJzSvalbard and Jan MayenSESwedenCHSwitzerlandSYzSyrian Arab RepublicTWzTaiwan (Province of China)TJ
TajikistanTZz Tanzania, the United Republic ofTHThailandTLzTimor-LesteTGTogoTKTokelauTOTongaTTzTrinidad and TobagoTNTunisiaTRu   TürkiyeTMTurkmenistanTCzTurks and Caicos IslandsTVTuvaluUGUgandaUAUkraineAEzUnited Arab EmiratesGBz4United Kingdom of Great Britain and Northern IrelandUMz$United States Minor Outlying IslandsUSzUnited States of AmericaUYUruguay
UzbekistanVanuatuz"Venezuela (Bolivarian Republic of)zViet NamzVirgin Islands (British)zVirgin Islands (U.S.)zWallis and FutunazWestern SaharaYemenZambiaZimbabwe)UZVUVEVNVGVIWFEHYEZMZWzDict[str, StrPromise]	COUNTRIES)AFG   )ALA   )ALB   )DZA   )ASM   )AND   )AGO   )AIAi  )ATA
   )ATG   )ARG    )ARM3   )ABWi  )AUS$   )AUT(   )AZE   )BHS,   )BHR0   )BGD2   )BRB4   )BLRp   )BEL8   )BLZT   )BEN   )BMU<   )BTN@   )BOLD   )BESi  )BIHF   )BWAH   )BVTJ   )BRAL   )IOTV   )BRN`   )BGRd   )BFAiV  )BDIl   )CPV   )KHMt   )CMRx   )CAN|   )CYM   )CAF   )TCD   )CHL   )CHN   )CXR   )CCK   )COL   )COM   )COG   )COD   )COK   )CRI   )CIVi  )HRV   )CUB   )CUWi  )CYP   )CZE   )DNK   )DJIi  )DMA   )DOM   )ECU   )EGYi2  )SLV   )GNQ   )ERI   )EST   )SWZi  )ETH   )FLK   )FRO   )FJI   )FIN   )FRA   )GUF   )PYFi  )ATFi  )GABi
  )GMBi  )GEOi  )DEUi  )GHAi   )GIBi$  )GRCi,  )GRLi0  )GRDi4  )GLPi8  )GUMi<  )GTMi@  )GGYi?  )GINiD  )GNBip  )GUYiH  )HTIiL  )HMDiN  )VATiP  )HNDiT  )HKGiX  )HUNi\  )ISLi`  )INDid  )IDNih  )IRNil  )IRQip  )IRLit  )IMNiA  )ISRix  )ITAi|  )JAMi  )JPNi  )JEYi@  )JORi  )KAZi  )KENi  )KIRi(  )PRKi  )KORi  )KWTi  )KGZi  )LAOi  )LVAi  )LBNi  )LSOi  )LBRi  )LBYi  )LIEi  )LTUi  )LUXi  )MACi  )MDGi  )MWIi  )MYSi  )MDVi  )MLIi  )MLTi  )MHLiH  )MTQi  )MRTi  )MUSi  )MYT   )MEXi  )FSMiG  )MDAi  )MCOi  )MNGi  )MNEi  )MSRi  )MARi  )MOZi  )MMRh   )NAMi  )NRUi  )NPLi  )NLDi  )NCLi  )NZLi*  )NICi.  )NERi2  )NGAi6  )NIUi:  )NFKi>  )MKDi'  )MNPiD  )NORiB  )OMNi   )PAKiJ  )PLWiI  )PSEi  )PANiO  )PNGiV  )PRYiX  )PERi\  )PHLi`  )PCNid  )POLih  )PRTil  )PRIiv  )QATiz  )REUi~  )ROUi  )RUSi  )RWAi  )BLMi  )SHNi  )KNAi  )LCAi  )MAFi  )SPMi  )VCTi  )WSMir  )SMRi  )STPi  )SAUi  )SENi  )SRBi  )SYCi  )SLEi  )SGPi  )SXMi  )SVKi  )SVNi  )SLBZ   )SOMi  )ZAFi  )SGS   )SSDi  )ESPi  )LKA   )SDNi  )SURi  )SJMi  )SWEi  )CHEi  )SYRi  )TWN   )TJKi  )TZAiB  )THAi  )TLSir  )TGOi   )TKLi  )TONi  )TTOi  )TUNi  )TURi  )TKMi  )TCAi  )TUVi  )UGAi   )UKRi$  )AREi  )GBRi:  )UMIiE  )USAiH  )URYiZ  )UZBi\  )VUTi$  )VENi^  )VNMi  )VGB\   )VIRiR  )WLFil  )ESHi  )YEMiw  )ZMBi~  )ZWEi  iso3166-1.csvoutput_filenamefilenamec              
      s  ddl }ddl}ddl g }t|8}||D ]*}|d d}|dd|}|dd|}|rB|||d |d	 t|d
 f qW d   n1 sMw   Y  tt	}|
 }	W d   n1 sew   Y   fdd}
t||
d}|d|	|j}|std| }g }|D ]}|d dd }|d|d  d| d q|d }|d|7 }|d|d	 |j}|std| }dd |D }||d 7 }|d|7 }||d	 7 }t| d}|| W d   |S 1 sw   Y  |S )z
    The following code can be used for self-generation of this file.

    It requires a UTF-8 CSV file containing the short ISO name and two letter
    country code as the first two columns.
    r   N*z\(the\) z
 +\[(.+)\]z (\1)         c                    s     d| d dddS )NNFKDr   asciiignore)	normalizeencodedecode)rowunicodedatar	   r
   sort_key6  s   zself_generate.<locals>.sort_key)keyz0(.*\nCOUNTRIES(?:: [^\n]+)? = \{\n)(.*?)(\n\}.*)z4Expected a "COUNTRIES =" section in the source file!"z\"    "z": _("z"),
z/(.*\nALT_CODES(?:: [^\n]+)? = \{\n)(.*)(\n\}.*)z5Expected an "ALT_CODES =" section in the source file!c              	   S   s0   g | ]}d |d  d|d  d|d  dqS )r  r  z": ("r  z", r  z),r	   ).0country_rowr	   r	   r
   
<listcomp>S  s    "z!self_generate.<locals>.<listcomp>w)csvrer  openreaderrstripsubappendint__file__readsortedmatchDOTALL
ValueErrorgroupsreplacestripjoinwrite)r  r  r  r  	countriescsv_filer  namesource_filecontentsr  r  bitscountry_listr  content	alt_matchalt_bitsalt_listoutput_filer	   r  r
   self_generate  sb   	
"


r&  r  	verbosityc                 C   s   i }t jt}tt j|dddD ]}||t jt j|d  < qt	t
t	| }|rJtd t|D ]}td| dt
|  d q9n| rPtd	 t	|t	t
 }d
D ]}|| qZ|rztd td t|D ]}td|  qpd S d S )Nstaticflagsz*.gifr   z/The following country codes are missing a flag:  z ()z All country codes have flags. :))EU__r  z7The following flags don't have a matching country code:)ospathdirnamer  globr  basenamesplitextuppersetr  printr  discard)r'  filesthis_dirr/  flags_missingcodecode_missingspecial_coder	   r	   r
   check_flags`  s,   "r>  c                  C   sJ   t tjt t } | r!td td t| D ]}td|  qd S d S )Nr  zAThe following common names do not match an official country code:r*  )r5  r   COMMON_NAMESr  r6  r  )common_names_missingr;  r	   r	   r
   check_common_namesy  s   rA  __main__zWrote z countries.r  )r  )r  )r   N)__doc__r1  r.  typingr   r   django_countries.baser   django_stubs_extr   django.utils.translationr   r   ImportErrorstrr  __annotations__	ALT_CODESr&  r  r>  rA  __name__r  r  r6  lenr	   r	   r	   r
   <module>   s^  	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                 	  
                                               !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  `  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  }	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                 	  
                                               !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  @  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  `  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p 
 C	

