I am currently exploring using the geograpy package for python to pull locations from text. It uses nltk, among other things to pull locations from URL's and text.

The only problem is it doesn't support two word places, like "South Carolina".

Is there a good python package/gazetteer to try to pull these? I am trying to feed it into a twitter feed mapper.

1 Answer 1


You essentially want to perform geocoding. You can't go past geopy for this. You can pick from multiple providers, some of which require an authentication token and/or rate limit you. Depending on what you're doing with it, an interesting use is to query multiple providers and develop an estimate of error. Note that these all will reduce "North Carolina" to a single point, not return administrative boundaries. You might want OSM for the latter.

  • Thanks for the help! I have been using the Google Maps API / Package to do the mapping part as you are suggesting, but I am interested in a two-tiered approach, first collecting all the places that match the gazetteer(as text) and returning them, then using a package like geopy to then map it. geograpy doesn't do a great part of the first step.
    – bwp8nt
    Feb 24, 2016 at 2:28
  • Ah, sorry for the confusion. I've never tried what you're attempting so I'm afraid I can't be of any more help. Feb 24, 2016 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.