![]() ![]() The country subdivisions are a little more complex than the countries itselfīecause they provide a nested and typed structure.Īll subdivisons can be accessed directly: > len ( pycountry. withdrawal_date '' Country subdivisions (ISO 3166-2) name 'USSR, Union of Soviet Socialist Republics' get ( alpha_3 = 'SUN' ) > ussr Country(alpha_3='SUN', alpha_4='SUHH', withdrawal_date='', name='USSR, Union of Soviet Socialist Republics', numeric='810') Removed from the standard and are now included in ISO 3166-3, excludingĮxisting ones: > ussr = pycountry. The historic_countries database contains former countries that have been search_fuzzy ( 'Cote' ) Historic Countries (ISO 3166-3) With more matches be listed before ones with fewer matches: > pycountry. To prefer matches on country names before subdivision names and have countries There’s also a bit of prioritization included Names that might only actually be subdivisions. There’s also a “fuzzy” search to help people discover “proper” countries for official_name 'Federal Republic of Germany' get ( alpha_2 = 'DE' ) > germany Country(alpha_2='DE', alpha_3='DEU', name='Germany', numeric='276', official_name='Federal Republic of Germany') Information included in the standard as attributes: > germany = pycountry. Specific countries can be looked up by their various codes and provide the countries ) Country(alpha_2='AF', alpha_3='AFG', name='Afghanistan', numeric='004', official_name='Islamic Republic of Afghanistan') Upon import of pycountry and works as an iterable: > import pycountry > len ( pycountry. Countries (ISO 3166-1)Ĭountries are accessible through a database object that is already configured The code lives in a git repository on GitHub, and issues must be reported in there as well. Also, let the world know youĭid so, so that others can follow your path. The project then I would love if you would donate to Feminist Frequency instead. This is a small project that I maintain in my personal time. If you need changes to the political situation in the world, please talk to This is a pure wrapperĪround the ISO standard using the pkg-isocodes database from Debian as is. No changes to the data will be accepted into pycountry. Translation files for the various strings are included as well. The package includes a copy from Debian’s pkg-isocodes and makes the data Pycountry provides the ISO databases for the standards:ģ166 Codes for representation of names of countries and their subdivisions ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |