Skip to main content

A complete Python Geocoding module made easy.

Project description

Geocoder

A complete Python Geocoding module made easy.

Every task is made easy with tons of help & debug commands!

>>> import geocoder # pip install geocoder
>>> g = geocoder.google('<address>')
>>> g.lat, g.lng
45.413140 -75.656703
...
Providers

QuickStart

A place to get you started on how to use this module and set up your work station.

Install from PyPi

$ pip install geocoder

Using iPython with Geocoder

$ pip install ipython
$ ipython

Using the TAB key after entering ‘.’ you will see all the available providers.

>>> import geocoder
>>> g = geocoder.
geocoder.api             geocoder.geolytica       geocoder.mapquest
geocoder.arcgis          geocoder.geonames        geocoder.nokia
geocoder.base            geocoder.get             geocoder.osm
geocoder.bing            geocoder.google          geocoder.timezone
geocoder.bing_reverse    geocoder.google_reverse  geocoder.tomtom
geocoder.canadapost      geocoder.ip              geocoder.yahoo
geocoder.cli             geocoder.keys
geocoder.elevation       geocoder.location
...

Using the TAB key again, you can see all the available attributes.

>>> g = geocoder.google('Ottawa')
>>> g.
g.accuracy            g.latlng              g.south
g.address             g.lng                 g.southeast
g.api                 g.locality            g.southwest
g.attributes          g.location            g.state
g.bbox                g.neighborhood        g.status
g.content             g.north               g.status_code
g.country             g.northeast           g.status_description
g.county              g.northwest           g.street_number
g.debug               g.ok                  g.sublocality
g.east                g.params              g.subpremise
g.error               g.parse               g.url
g.geometry            g.postal              g.west
g.headers             g.provider            g.wkt
g.help                g.quality             g.x
g.json                g.route               g.y
g.lat                 g.short_name
...

Command Line Interface

The command line tool allows you to geocode one or many strings, either passed as an argument, passed via STDIN, or contained in a referenced file.

$ geocode "Ottawa"
{
  "accuracy": "Rooftop",
  "quality": "PopulatedPlace",
  "lng": -75.68800354003906,
  "status": "OK",
  "locality": "Ottawa",
  "country": "Canada",
  "provider": "bing",
  "state": "ON",
  "location": "Ottawa",
  "address": "Ottawa, ON",
  "lat": 45.389198303222656
}

Now, suppose you have a file with two lines, which you want to geocode.

$ geocode `textfile.txt`
{"status": "OK", "locality": "Ottawa", ...}
{"status": "OK", "locality": "Boston", ...}

The output is, by default, sent to stdout, so it can be conveniently parsed by json parsing tools like jq.

$ geocode `textfile.txt` | jq [.lat,.lng,.country] -c
[45.389198303222656,-75.68800354003906,"Canada"]
[42.35866165161133,-71.0567398071289,"United States"]

For more development requests for the CLI, please provide your input in the Github Issues Page.

Visit the Wiki

Please look at the following pages on the wiki for more information about a certain topic.

Providers

Here is a list of providers that are available for use with FREE or limited restrictions.

Extras

The fun extra stuff I added to enjoy some cool features the web has to offer.

Topic not available?

If you cannot find a topic you are looking for, please feel free to ask me [@DenisCarriere](https://github.com/DenisCarriere) or post them on the Github Issues Page.

Support

This project is free & open source, it would help greatly for you guys reading this to contribute, here are some of the ways that you can help make this Python Geocoder better.

Feedback

Please feel free to give any feedback on this module. If you find any bugs or any enhancements to recommend please send some of your comments/suggestions to the Github Issues Page.

Twitter

Speak up on Twitter @[DenisCarriere] and tell me how you use this Python Geocoder. New updates will be pushed to Twitter Hashtags #geocoder.

Thanks to

A big thanks to all the people that help contribute:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

geocoder-0.8.3.zip (41.2 kB view details)

Uploaded Source

geocoder-0.8.3.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geocoder-0.8.3-py2.py3-none-any.whl (33.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file geocoder-0.8.3.zip.

File metadata

  • Download URL: geocoder-0.8.3.zip
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for geocoder-0.8.3.zip
Algorithm Hash digest
SHA256 8b27f7d8be77310a7702e053eb3728c753928c34a71a532df956a66aee79342d
MD5 929cf0d9eef2d580d4be3603e66cdd6b
BLAKE2b-256 489f4296fb2fd39b92d2f26b613912aeb70c8a9bcd13fcae4fa99775876dcd74

See more details on using hashes here.

File details

Details for the file geocoder-0.8.3.tar.gz.

File metadata

  • Download URL: geocoder-0.8.3.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for geocoder-0.8.3.tar.gz
Algorithm Hash digest
SHA256 43aa5bc62305bac2b1b33076d962d6c5a578349e372b71cfee54563558c18a0c
MD5 287023f77d13adb6902930013da39658
BLAKE2b-256 a2b56e4de01ff0279a228d422f9f47d313f19888cb2bc4d84fd6f57578b93a4e

See more details on using hashes here.

File details

Details for the file geocoder-0.8.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for geocoder-0.8.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 936466fb69ddb6d1b6d3ad6452039c00c27562b61305bcafda4fe43254c02f7c
MD5 08b488762a803152c25621065f3bf6d9
BLAKE2b-256 07f47a7f29ef07d2825f691a61d2e1f292385dad4154de38f3eb3acee19c8627

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page