How to use the geonamescache.mappings.country_names.get function in geonamescache

To help you get started, we’ve selected a few geonamescache 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 yaph / geonamescache / geonamescache / mappers.py View on Github external
def mapper(input):
        # For country name inputs take the names mapping into account.
        if 'name' == from_key:
            input = mappings.country_names.get(input, input)
        # If there is a record return the demanded attribute.
        item = dataset.get(input)
        if item:
            return item[to_key]