Geotext extracts countriy and city mentions from text
Project description
Geotext extracts country and city mentions from text
Free software: MIT license
Documentation: https://geotext.readthedocs.org.
Usage
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)])
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.
History
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.
Source Distribution
Built Distribution
File details
Details for the file geotext-0.4.0.tar.gz
.
File metadata
- Download URL: geotext-0.4.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ba5aa03db8246a8f77f9a334e79bc1f5875b38fd63589f0be4c83c1d94c52fd |
|
MD5 | 74347ce77536de0a533361e2dcee68df |
|
BLAKE2b-256 | 6d3e25ecf87381f0f042a528714fa0a12987d8d5842e35b2ceb212c2119aa877 |
File details
Details for the file geotext-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: geotext-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afc17c170337195b0fc9990ff2dec822bb4eb548c0541f5b7c853ff06ae164dc |
|
MD5 | 4ab1777a96f33e50e39a88324afc64d3 |
|
BLAKE2b-256 | 25c536351193092cb4c1d7002d2a3babe5e72ae377868473933d6f63b41e5454 |