How to use the iso3166.countries.lookup function in iso3166

To help you get started, we’ve selected a few iso3166 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streamlink / streamlink / src / streamlink / utils / l10n.py View on Github external
def get(cls, country):
        try:
            if PYCOUNTRY:
                c = countries.lookup(country)
                return Country(c.alpha_2, c.alpha_3, c.numeric, c.name, getattr(c, "official_name", c.name))
            else:
                c = countries.get(country)
                return Country(c.alpha2, c.alpha3, c.numeric, c.name, c.apolitical_name)
        except (LookupError, KeyError):
            raise LookupError("Invalid country code: {0}".format(country))

iso3166

Self-contained ISO 3166-1 country definitions.

MIT
Latest version published 2 years ago

Package Health Score

55 / 100
Full package analysis

Similar packages