Search code examples
pythonlocalizationcountry-codes

Match language code with countries where this language is an official or commonly used language


Is there any python library to get a list of countries for a specific language code where it is an official or commonly used language?

For example, language code of "fr" is associated with 29 countries where French is an official language plus 8 countries where it's commonly used.


Solution

  • pycountry (seriously). You can get it from the Package Index.