Skip to main content

Extract countries, regions and cities from a URL or text

Project description

Extract place names from a URL or text, and add context to those names – for example distinguishing between a country, region or city.

## Install & Setup

Grab the package using pip (this will take a few minutes)

pip install geograpy2

Geograpy2 uses [NLTK]( for entity recognition, so you’ll also need to download the models we’re using. Fortunately there’s a command that’ll take care of this for you.


## Basic Usage

Import the module, give some text or a URL, and presto.

import geograpy2 url = ‘’ places = geograpy2.get_place_context(url=url)

## Credits

Geograpy2 is a fork of [geograpy]( and inherits most of it, but solves several problems (such as support for utf8, places names with multiple words, confusion over homonyms etc).

Geograpy2 uses the following excellent libraries:

Geograpy uses the following data sources:

Hat tip to [Chris Albon]( for the name.

Released under the MIT license.

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 geograpy2, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size geograpy2-0.1.0.tar.gz (5.5 kB) 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