country_acronyms
1.0.0
此包是針對每個需要找到所有可能翻譯的人的包裹,特定國家名稱 /國家ISO的首字母縮寫詞。
country_acronyms提供了支持:
該代碼生活在GitHub上的GIT存儲庫中,並且也必須在其中報告。
通過運行安裝country_acronyms:
pip install country_acronyms from country_acronyms import get_supported_languages ,
get_country_acronyms ,
get_country_acronyms_iso ,
get_all_country_acronyms
# get available languages
get_supported_languages ()
> >> { 'afrikaans' : 'af' , 'albanian' : 'sq' , ... , 'yoruba' : 'yo' , 'zulu' : 'zu' }
# acronyms for given country name
get_country_acronyms ( "Austria" )
> >> { 'af' : 'Oostenryk' , ... , 'zu' : 'E-Austria' }
# acronyms for given country iso
get_country_acronyms_iso ( "it" )
> >> { 'af' : 'Italië' , ... , 'zu' : 'Italy' }
# acronyms for given country iso
get_country_acronyms_iso ( "usa" )
> >> { 'af' : 'Verenigde State' , ... , 'zu' : 'iziwe Ezihlangene' }
# getting all country acronyms by scraping wiki
get_all_country_acronyms ()
> >> { 'Abkhazia' : [ 'Abcasia' , ... , 'Apxazeti' ], , 'Afghanistan' : [ 'Æfganisthanaya' , ... , 'l-Afghanistan' ], ... }該軟件包使用deep_translator,Pycountry和BS4。為那些人大!
該項目是根據MIT許可證獲得許可的。