Converter Bases

class babelfish.converters.Converter

A Converter supports converting an alpha3 language code with an alpha2 country code into a custom code

convert(alpha3, country=None)

Convert an alpha3 language code with an alpha2 country code into a custom code

Parameters:
  • alpha3 (string) – ISO-639-3 language code
  • country (string or None) – ISO-3166 country code, if any
Returns:

the corresponding custom code

Return type:

string

class babelfish.converters.ReverseConverter

A Converter able to reverse a custom code into a alpha3 ISO-639-3 language code and alpha2 ISO-3166-1 country code

reverse(code)

Reverse a custom code into alpha3 and country code

Parameters:code (string) – custom code to reverse
Returns:the corresponding alpha3 ISO-639-3 language code and alpha2 ISO-3166-1 country code
Return type:tuple

BabelFish

BabelFish is a Python library to work with countries and languages.

PyPI downloads

Donate

If you like babelfish, please consider making a donation

Related Topics

This Page

Fork me on GitHub