pycountry / pycountry

A Python library to access ISO country, subdivision, language, currency and script definitions and their translations.
GNU Lesser General Public License v2.1
761 stars 125 forks source link

Attribute error when querying for ceubano 'ceb" iso code #29

Closed datashinobi closed 4 years ago

datashinobi commented 4 years ago

pycountry==19.8.18 https://iso639-3.sil.org/code/ceb

============= `from pycountry import languages languages.get(alpha_2 = 'ceb').name

AttributeError Traceback (most recent call last)

in 1 from pycountry import languages 2 print(pycountry.Languages) ----> 3 languages.get(alpha_2 = 'ceb').name AttributeError: 'NoneType' object has no attribute 'name' `
ctheune commented 4 years ago

Small mistake in the example code: 'CEB' has three letters and is an alpha_3 code. Using alpha_3 works. (At least on the current trunk which will be released in the next minutes, not sure whether this data was touched in the last months).