How to use the iso3166.countries.get 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 davidmcclure / open-syllabus-project / osp / institutions / models / institution_index.py View on Github external
def materialize_country_facets(cls, counts):

        """
        Materialize country facet counts.

        Returns:
            dict: {label, value, count}
        """

        facets = []
        for abbr, count in counts:

            country = countries.get(abbr)

            if country:
                facets.append(dict(
                    label = country.name,
                    value = abbr.upper(),
                    count = count,
                ))

        return facets

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