{
"info": {
"author": "S\u0142awomir Kabik",
"author_email": "slawek@redsoftware.pl",
"bugtrack_url": null,
"classifiers": [],
"description": ".. image:: https://travis-ci.org/slawek87/geolocation-python.svg?branch=master\r\n.. image:: https://badge.fury.io/py/geolocation-python.svg\r\n\r\nWhat is Geolocation 0.2.2?\r\n--------------------------\r\n\r\nGeolocation is a simple and clever application which uses google maps api.\r\n\r\n1. Geocode Module allows you to easily and quickly get information about given location.\r\n\r\nGeocode Module returns such information as:\r\n - country,\r\n - country short form,\r\n - city,\r\n - route/street,\r\n - street number,\r\n - postal code,\r\n - formatted address,\r\n - administrative areas,\r\n - lat,\r\n - lng.\r\n\r\n\r\n2. Distance Module allows you to get information about travel distance and time for a matrix of origins and destinations.\r\n\r\nDistance Module returns such information as:\r\n - origin address,\r\n - destination address,\r\n - duration,\r\n - distance: kilometers, meters, miles.\r\n\r\nPython2 or Python3?\r\n-------------------\r\nBoth!. Currently it supports python 2.7, 3.3 and 3.4.\r\n\r\nWhat do You need?\r\n-----------------\r\nTo use this application you need to have Google API key.\r\n `Google Maps Documentation `_\r\n\r\n1. Open `APIs console `_.\r\n\r\n.. image:: https://github.com/iknowledge-io/geolocation-python/blob/geolocation-0.2.0/docs/images/geocode-1.png?raw=true\r\n\r\n\r\n2. Turn On Geocode API.\r\n\r\n.. image:: https://github.com/iknowledge-io/geolocation-python/blob/geolocation-0.2.0/docs/images/geocode-2.png?raw=true\r\n\r\n\r\n3. Turn On Distance Matrix API.\r\n\r\n.. image:: https://github.com/iknowledge-io/geolocation-python/blob/geolocation-0.2.0/docs/images/distance-1.png?raw=true\r\n\r\n\r\n4. Get your API Key.\r\n\r\n .. image:: https://github.com/iknowledge-io/geolocation-python/blob/geolocation-0.2.0/docs/images/geocode-3.png?raw=true\r\n\r\n\r\n\r\nHow to install it?\r\n-------------------\r\n pip install geolocation-python\r\n\r\n\r\nHow to use Geocode Module?\r\n----------------------------\r\n\r\n # -*- coding: utf-8 -*-\r\n\r\n from geolocation.main import GoogleMaps\r\n from geolocation.distance_matrix.client import DistanceMatrixApiClient\r\n\r\n address = \"New York City Wall Street 12\"\r\n\r\n google_maps = GoogleMaps(api_key='your_google_maps_key')\r\n\r\n location = google_maps.search(location=address) # sends search to Google Maps.\r\n\r\n print(location.all()) # returns all locations.\r\n\r\n my_location = location.first() # returns only first location.\r\n\r\n print(my_location.city)\r\n print(my_location.route)\r\n print(my_location.street_number)\r\n print(my_location.postal_code)\r\n\r\n for administrative_area in my_location.administrative_area:\r\n print(\"{}: {} ({})\".format(administrative_area.area_type,\r\n administrative_area.name,\r\n administrative_area.short_name))\r\n\r\n print(my_location.country)\r\n print(my_location.country_shortcut)\r\n\r\n print(my_location.formatted_address)\r\n\r\n print(my_location.lat)\r\n print(my_location.lng)\r\n\r\n # reverse geocode\r\n\r\n lat = 40.7060008\r\n lng = -74.0088189\r\n\r\n my_location = google_maps.search(lat=lat, lng=lng).first()\r\n\r\nHow to use Distance Module?\r\n----------------------------\r\nMode parameter \u2014 specifies the mode of transport to use when calculating directions.\r\n\r\nValid values are:\r\n* driving (default) indicates standard driving directions using the road network.\r\n* walking requests walking directions via pedestrian paths & sidewalks (where available).\r\n* bicycling requests bicycling directions via bicycle paths & preferred streets (currently only available in the US and some Canadian cities).\r\n* transit requests distance calculation via public transit routes (where available).\r\n\r\nAvoid parameter - Directions may be calculated that adhere to certain restrictions. Restrictions are indicated by use of the avoid parameter, and an argument to that parameter indicating the restriction to avoid.\r\n\r\nThe following restrictions are supported:\r\n - avoid=tolls\r\n - avoid=highways\r\n - avoid=ferries\r\n\r\n # -*- coding: utf-8 -*-\r\n\r\n from geolocation.main import GoogleMaps\r\n from geolocation.distance_matrix.client import DistanceMatrixApiClient\r\n\r\n origins = ['rybnik', 'oslo']\r\n destinations = ['zagrzeb']\r\n\r\n google_maps = GoogleMaps(api_key='your_google_maps_key')\r\n\r\n items = google_maps.distance(origins, destinations).all() # default mode parameter is DistanceMatrixApiClient.MODE_DRIVING.\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration) # returns string.\r\n\r\n print('duration datetime: %s' % item.duration.datetime) # returns datetime.\r\n\r\n # you can also get items from duration, returns int() values.\r\n print('duration days: %s' % item.duration.days)\r\n\r\n print('duration hours: %s' % item.duration.hours)\r\n\r\n print('duration minutes: %s' % item.duration.minutes)\r\n\r\n print('duration seconds: %s' % item.duration.seconds)\r\n\r\nMode Bicycling:\r\n\r\n items = google_maps.distance(origins, destinations, DistanceMatrixApiClient.MODE_BICYCLING).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nMode Walking:\r\n\r\n items = google_maps.distance(origins, destinations, DistanceMatrixApiClient.MODE_WALKING).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nMode Transit:\r\n\r\n items = google_maps.distance(origins, destinations, DistanceMatrixApiClient.MODE_TRANSIT).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nMode Highway:\r\n\r\n items = google_maps.distance(origins, destinations, avoid=DistanceMatrixApiClient.AVOID_HIGHWAYS).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nAvoid Ferries:\r\n\r\n items = google_maps.distance(origins, destinations, avoid=DistanceMatrixApiClient.AVOID_FERRIES).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n\r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n\r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nAvoid Tolls:\r\n\r\n items = google_maps.distance(origins, destinations, avoid=DistanceMatrixApiClient.AVOID_TOLLS).all()\r\n\r\n for item in items:\r\n print('origin: %s' % item.origin)\r\n \r\n print('destination: %s' % item.destination)\r\n\r\n print('km: %s' % item.distance.kilometers)\r\n \r\n print('m: %s' % item.distance.meters)\r\n\r\n print('miles: %s' % item.distance.miles)\r\n\r\n print('duration: %s' % item.duration)\r\n\r\n\r\nMore examples you should find `here `_\r\n.",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/slawek87/geolocation-python/",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "UNKNOWN",
"keywords": "Python Google Maps Api,Google lat,Google lng,Python Google Maps,Google Maps Distance",
"license": "Copyright (c) 2014, S\u0142awomir Kabik\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, this\r\n list of conditions and the following disclaimer.\r\n\r\n* Redistributions in binary form must reproduce the above copyright notice,\r\n this list of conditions and the following disclaimer in the documentation\r\n and/or other materials provided with the distribution.\r\n\r\n* Neither the name of the {organization} nor the names of its\r\n contributors may be used to endorse or promote products derived from\r\n this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
"maintainer": "",
"maintainer_email": "",
"name": "geolocation-python",
"package_url": "https://pypi.org/project/geolocation-python/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/geolocation-python/",
"project_urls": {
"Download": "https://github.com/slawek87/geolocation-python/",
"Homepage": "UNKNOWN"
},
"release_url": "https://pypi.org/project/geolocation-python/0.2.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Geolocation is a simple and clever application which uses google maps api. This application allows you to easily and quickly get information about given localisation. Application returns such information as: country, city, route/street, street number, lat and lng,travel distance and time for a matrix of origins and destinations.",
"version": "0.2.2"
},
"last_serial": 1878632,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "f40ced0e10593d567030efb1aed98908",
"sha256": "e410295d92dd82f0feaebc912cc381578e40ea1ac01cf80ffbbe2f101394fbb4"
},
"downloads": -1,
"filename": "geolocation-python-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "f40ced0e10593d567030efb1aed98908",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3780,
"upload_time": "2014-09-16T19:56:54",
"url": "https://files.pythonhosted.org/packages/6c/c0/0d5944685da6fca47cee378e4f6b3becff4c1de13d59742e762825d02716/geolocation-python-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "1fa985cbf09bb8df0f346e05ee5f9967",
"sha256": "ae882a879b81d5dee8564b932ee34e99c3eb6b533695df87a402048a95c299f9"
},
"downloads": -1,
"filename": "geolocation-python-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "1fa985cbf09bb8df0f346e05ee5f9967",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4778,
"upload_time": "2014-09-23T17:53:03",
"url": "https://files.pythonhosted.org/packages/5b/53/c425fbf2fee2937d8e3190cdbddc136c3025c1627a03311b8917ae6e234c/geolocation-python-0.1.1.tar.gz"
}
],
"0.1.1a": [
{
"comment_text": "",
"digests": {
"md5": "1c5efa11aa0d65ed3c8c5996754753f5",
"sha256": "63949f55bf4ca042c52a02af813b259de330cc90d519d3178d1267b0894f0e4e"
},
"downloads": -1,
"filename": "geolocation-python-0.1.1a.tar.gz",
"has_sig": false,
"md5_digest": "1c5efa11aa0d65ed3c8c5996754753f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4521,
"upload_time": "2014-10-23T16:51:11",
"url": "https://files.pythonhosted.org/packages/c1/43/018d6f4999b42f432f9076728890595306a376be47831bec6469fb2f8f34/geolocation-python-0.1.1a.tar.gz"
}
],
"0.1.2b": [
{
"comment_text": "",
"digests": {
"md5": "43a92ca964986810584027354b950cee",
"sha256": "6cd1ddcc8add2680226583c132b260225e528b35634e7724b7f7bb7c6b5ebc60"
},
"downloads": -1,
"filename": "geolocation-python-0.1.2b.tar.gz",
"has_sig": false,
"md5_digest": "43a92ca964986810584027354b950cee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5398,
"upload_time": "2014-11-24T16:01:21",
"url": "https://files.pythonhosted.org/packages/7c/f6/2afb4a17b928fcd8358dd8ec02face050484bd9312f72d9287aba0bfb790/geolocation-python-0.1.2b.tar.gz"
}
],
"0.1.2c": [
{
"comment_text": "",
"digests": {
"md5": "6c5c7d516df5b5bebff640a9927787a5",
"sha256": "92cac50fc5a348c6a556a23ed8e115e138ae76dc0a96b3e8cf11806adfe428e1"
},
"downloads": -1,
"filename": "geolocation-python-0.1.2c.tar.gz",
"has_sig": false,
"md5_digest": "6c5c7d516df5b5bebff640a9927787a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5093,
"upload_time": "2014-11-24T16:16:25",
"url": "https://files.pythonhosted.org/packages/e9/90/1ee9f74420d0caa427a2b2f27a1a65bf95c5e1ab00f47d3a47992fbc87f0/geolocation-python-0.1.2c.tar.gz"
}
],
"0.1.2d": [
{
"comment_text": "",
"digests": {
"md5": "451491bf8d5b2642584651891a34d8f0",
"sha256": "e134bf021e01d43e6580c1f988fd55eef9e894cb506f2c87e80a99053880d802"
},
"downloads": -1,
"filename": "geolocation-python-0.1.2d.tar.gz",
"has_sig": false,
"md5_digest": "451491bf8d5b2642584651891a34d8f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5220,
"upload_time": "2014-11-25T20:36:15",
"url": "https://files.pythonhosted.org/packages/31/55/e84683add161e309d4be45ed281b1a572b88f5c65f0983857174b6b567ec/geolocation-python-0.1.2d.tar.gz"
}
],
"0.1.3": [
{
"comment_text": "",
"digests": {
"md5": "4545c9a0e99be2b179016b4e9089d3ca",
"sha256": "339b99713bbdc1284942909b13993d35eac0cb71fa824659f7bfc9c869addf1f"
},
"downloads": -1,
"filename": "geolocation-python-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "4545c9a0e99be2b179016b4e9089d3ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5205,
"upload_time": "2014-11-30T19:21:35",
"url": "https://files.pythonhosted.org/packages/db/c1/eb0f3b7bba003c5490d5f870371d9c986f15e6a6e31e17049ddb6575808c/geolocation-python-0.1.3.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "722085f1e9625f98140b3de8a5631f6a",
"sha256": "ae1940dd14374bb9417f75bd43bb6b7055e8ccde5e0651dcc58d589c6d6465e2"
},
"downloads": -1,
"filename": "geolocation-python-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "722085f1e9625f98140b3de8a5631f6a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8248,
"upload_time": "2015-01-05T12:23:27",
"url": "https://files.pythonhosted.org/packages/f9/b8/b5f4877e6e4887c628118dac575bca6d6695fc347f1c2f90eb1966ee73a9/geolocation-python-0.2.0.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "fbd949df75a138e785c67e108a18792c",
"sha256": "cd136ac099e8ef6e055a1f8f772baec6fbe679692e9c1abb852a5938dcaa34e2"
},
"downloads": -1,
"filename": "geolocation-python-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "fbd949df75a138e785c67e108a18792c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8118,
"upload_time": "2015-08-29T08:26:21",
"url": "https://files.pythonhosted.org/packages/22/6c/0b41a8dc43f1a82404531dc6389e484ece6d4f3a5d1c1f1cf895eb6398c0/geolocation-python-0.2.1.tar.gz"
}
],
"0.2.2": [
{
"comment_text": "",
"digests": {
"md5": "f3a8b79bf9620ba8038ea76b35363088",
"sha256": "550c6f59ff7e97b2bdfe8e7731994a7b622ba8adb223b3425137b8b2ff08eeb8"
},
"downloads": -1,
"filename": "geolocation-python-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "f3a8b79bf9620ba8038ea76b35363088",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8421,
"upload_time": "2015-12-27T09:12:00",
"url": "https://files.pythonhosted.org/packages/b3/c2/6ab94ba4e90966e9b8fa900b31e5bc1cbca18a17d7383119c3dd45559aef/geolocation-python-0.2.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "f3a8b79bf9620ba8038ea76b35363088",
"sha256": "550c6f59ff7e97b2bdfe8e7731994a7b622ba8adb223b3425137b8b2ff08eeb8"
},
"downloads": -1,
"filename": "geolocation-python-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "f3a8b79bf9620ba8038ea76b35363088",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8421,
"upload_time": "2015-12-27T09:12:00",
"url": "https://files.pythonhosted.org/packages/b3/c2/6ab94ba4e90966e9b8fa900b31e5bc1cbca18a17d7383119c3dd45559aef/geolocation-python-0.2.2.tar.gz"
}
]
}