globetrotter

Approximate language and country name matching
Download

globetrotter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • ISC License
  • Price:
  • FREE
  • Publisher Name:
  • Lars Yencken
  • Publisher web site:
  • http://hg@bitbucket.org/

globetrotter Tags


globetrotter Description

Globetrotter is a Python module that can approximate country and language name matching for the pycountry module.This library makes the pycountry module a much better reference for cluttered data.Motivation>>> import pycountry>>> pycountry.countries.get(name='Vietnam')Traceback (most recent call last): File "< stdin >", line 1, in < module > File "/Users/you/Library/Python/2.7/lib/python/site-packages/pycountry/db.py", line 85, in get return self.indicesKeyError: 'Vietnam'>>>'Nuff said.Installationpip install globetrotterUsageFind a country through the find_country() method, giving it an approximate string name. It returns a Country object with ISO metadata about the match.>>> import globetrotterg>>> globetrotter.find_country('Vietnam')< pycountry.db.Country object at 0x1038eed90 >>>> globetrotter.find_country('Vietnam').nameu'Viet Nam'Find a language through the find_language() method in a similar way. It returns a Language object.>>> import globetrotter>>> globetrotter.find_language('Spanish')< pycountry.db.Language object at 0x103a444d0 >>>> globetrotter.find_language('Spanish').nameu'Spanish; Castilian'Product's homepage


globetrotter Related Software