Geotext extracts countriy and city mentions from text
Geotext extracts country and city mentions from text
- Free software: MIT license
- Documentation: https://geotext.readthedocs.org.
from geotext import GeoText places = GeoText("London is a great city") places.cities # "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 https://github.com/elyase/geotext/archive/master.zip
- No external dependencies
- Data from http://www.geonames.org licensed under the Creative Commons Attribution 3.0 License.
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.
Fix unicode errors
Support for Brazilian cities (credit to @joseluizcoe)
- Python 3 support (credit to @freezer9)
- First release on PyPI.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size & hash SHA256 hash help||File type||Python version||Upload date|
|geotext-0.4.0-py2.py3-none-any.whl (2.0 MB) Copy SHA256 hash SHA256||Wheel||py2.py3|
|geotext-0.4.0.tar.gz (2.0 MB) Copy SHA256 hash SHA256||Source||None|