Skip to content

elyase/geotext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

add0334 · Mar 8, 2020

History

45 Commits
Oct 4, 2014
Jan 19, 2019
Dec 27, 2018
Sep 30, 2014
Mar 14, 2017
Mar 12, 2017
Mar 12, 2017
Sep 30, 2014
Mar 12, 2017
Oct 4, 2014
Oct 5, 2014
Sep 30, 2014
Mar 8, 2020
Sep 30, 2014
Sep 30, 2014
Mar 12, 2017
Mar 12, 2017

Repository files navigation

geotext

https://travis-ci.org/elyase/geotext.png?branch=master

Geotext extracts country and city mentions from text

Usage

from geotext import GeoText

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

# filter by country code
result = 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)])

Installation

pip install https://github.com/elyase/geotext/archive/master.zip

Features

  • No external dependencies
  • Fast
  • Data from http://www.geonames.org 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.