Skip to main content

Geotext extracts countriy and city mentions from text

Project description

Geotext extracts country and city mentions from text


from geotext import GeoText

places = GeoText("London is a great city")
# "London"

# filter by country code
result = geotext.GeoText('I loved Rio de Janeiro and Havana', 'BR').cities
# 'Rio de Janeiro'

GeoText('New York, Texas, and also China').country_mentions
# OrderedDict([(u'US', 2), (u'CN', 1)])


pip install


  • No external dependencies
  • Fast
  • Data from licensed under the Creative Commons Attribution 3.0 License.

Similar projects

geography: geography is more advanced and bigger in scope compared to geotext and can do everything geotext does. On the other hand geotext is leaner: has no external dependencies, is faster (re vs nltk) and also depends on libraries and data covered with more permissive licenses.


0.4.0 (2018-07-30)

Fix unicode errors

0.3.0 (2017-12-03)

Support for Brazilian cities (credit to @joseluizcoe)

0.2.0 (2017-07-01)

  • Python 3 support (credit to @freezer9)

0.1.0 (2014-01-11)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for geotext, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size geotext-0.4.0-py2.py3-none-any.whl (2.0 MB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size geotext-0.4.0.tar.gz (2.0 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page