{ "info": { "author": "Targomo GmbH", "author_email": "mail@targomo.com", "bugtrack_url": null, "classifiers": [], "description": "# targomo_python - Python client library for Targomo webservices\n\n## API-Key\nGet your API key [here ](https://www.targomo.com/developers/pricing/).\n\n## Installation\n### the targomo_python library uses python3\nmake sure this is installed on your system\n### use virtualenv for a clean, global-free install\n[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/) is great. We can use it to sandbox versions and keep installs contained, so we can avoid global version conflicts.\n\nInstall virtualenv\n```\npip install virtualenv\n```\n\nCreate python3 virtualenv named 'venv'\n```\nvirtualenv -p python3 venv\n```\n\nActivate virtualenv\n```\nsource venv/bin/activate\n```\n_do this every time to enter into virtualenv called '(venv)' <= as shown in terminal prompt_\n\nInstall targomo_python\n```\npip install targomo_python\n```\n*this installs targomo_python and dependencies in our virtualenv*\n\nTest the install\n`python -m targomo_python.cli -h` _this shows the cli usage and help_\n\nWhen you are done using the virtualenv, shut it down\n```\ndeactivate\n```\n_prompt drops '(venv)' tag, virtualenv is no longer active_\n\n## Usage\n usage: python -m targomo_python.cli [-h] [--time TIME] [--date DATE]\n [--polygonSerializer POLYGONSERIALIZER]\n [--buffer BUFFER] [--minHoleSize MINHOLESIZE]\n [--simplify SIMPLIFY] [--srid SRID]\n [--quadrantSegments QUADRANTSEGMENTS]\n [--frameDuration FRAMEDURATION]\n [--reverse REVERSE] [--bikeSpeed BIKESPEED]\n [--bikeUphill BIKEUPHILL]\n [--bikeDownhill BIKEDOWNHILL]\n [--walkSpeed WALKSPEED] [--walkUphill WALKUPHILL]\n [--walkDownhill WALKDOWNHILL] --travelTimes\n TRAVELTIMES [TRAVELTIMES ...] --serviceUrl\n SERVICEURL --serviceKey SERVICEKEY --travelType\n TRAVELTYPE --source SOURCE --outputDir OUTPUTDIR\n --outputFilename OUTPUTFILENAME\n\n Query the Targomo Polygon service using python\n\n optional arguments:\n -h, --help show this help message and exit\n --time TIME The time in seconds of the day: 1.30 p.m. = 13 * 3600\n + 30 * 60 = 48600 (transit only) (default: 43200)\n --date DATE The date in the format YYYYMMDD, e.g.: 20160727 for\n the 27th of July 2016 (transit only) (default:\n 20162707)\n --polygonSerializer POLYGONSERIALIZER\n The serializer for the polygons: json or geojson\n (default: geojson)\n --buffer BUFFER The buffer (in srid units) that should be generated\n around the polygons. (default: None)\n --minHoleSize MINHOLESIZE\n The area threshold of a hole inside a polygon (in\n meters squared). (default: None)\n --simplify SIMPLIFY The threshold (in meter) that should be used for\n Douglas-Peucker (before buffering, max 500m).\n (default: None)\n --srid SRID The target SRID (Spatial Reference System Identifier),\n all that are supported via PostGIS. (default: None)\n --quadrantSegments QUADRANTSEGMENTS\n The number of quadrant segments (max 8), see:\n http://postgis.net/docs/ST_Buffer.html. (default:\n None)\n --frameDuration FRAMEDURATION\n The window (in seconds) during which connections are\n identified. (default: None)\n --reverse REVERSE Whether or not to measure from sources (default) or\n towards sources. (default: None)\n --bikeSpeed BIKESPEED\n Bike speed km/h (travelType 'bike' only). (default:\n None)\n --bikeUphill BIKEUPHILL\n Penalty applied to uphill bike travel. (default: None)\n --bikeDownhill BIKEDOWNHILL\n Penalty applied to downhill bike travel. (default:\n None)\n --walkSpeed WALKSPEED\n Walk speed km/h (travelType 'walk' only). (default:\n None)\n --walkUphill WALKUPHILL\n Penalty applied to uphill walk travel. (default: None)\n --walkDownhill WALKDOWNHILL\n Penalty applied to downhill bike travel. (default:\n None)\n\n required named arguments:\n --travelTimes TRAVELTIMES [TRAVELTIMES ...]\n The travel time in seconds as a list of integers.\n (default: None)\n --serviceUrl SERVICEURL\n The URL of the Targomo API endpoint. (default: None)\n --serviceKey SERVICEKEY\n Your personal key for the API. (default: None)\n --travelType TRAVELTYPE\n The travel type for the request: car, walk, bike or\n transit (default: None)\n --source SOURCE The source as doubles (lat,lng) separated by ';'.\n (default: None)\n --outputDir OUTPUTDIR\n The path where to write the output files (default:\n None)\n --outputFilename OUTPUTFILENAME\n The the name of the file to write to (default: None)\n\n\n### FYI\nnot all capabilities are available for all plan levels. Refer to the different [plans](https://www.targomo.com/developers/pricing/) to see the specifics.\n\n### Example\n\n python -m targomo_python.cli --travelType walk \\\n --travelTimes 1800 \\\n --source=\"52.52;13.405\" \\\n --outputDir=data/ \\\n --outputFilename=test.geojson \\\n --serviceKey='Your key here' \\\n --serviceUrl=http://api.targomo.com/germany/ \\\n --srid=4326 \\\n\n\n## Library Usage\n\nExample how to use the library from Python code:\n\n #!/usr/bin/env python3\n from targomo_python.rest.ServiceExecutor import ServiceExecutor\n from targomo_python.util.TravelOptions import TravelOptions\n from targomo_python.util.enum.TravelType import TravelType\n\n travelOptions = TravelOptions()\n travelOptions.setServiceKey('INSERT_YOUR_API_KEY_HERE')\n travelOptions.setTravelType(TravelType.TRANSIT)\n travelOptions.setServiceUrl('https://api.targomo.com/westcentraleurope/')\n travelOptions.setTravelTime(10 * 3600)\n travelOptions.setFrameDuration(3 * 3600)\n travelOptions.addSource({\"id\": \"source-1\", \"lng\": 53.5532, \"lat\": 10.00644})\n travelOptions.addTarget({\"id\": \"target-1\", \"lng\": 53.63265, \"lat\": 10.00667})\n\n response = ServiceExecutor().execute_service(travelOptions, \"route\")\n print(response)\n\n\n## Testing\n\nUsing unit test and nose, API assumes Python 3.x\n- rename _tests/config.py.txt_ to _tests/config.py_, add appropriate API key\n- run `nosetests -v`", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/targomo/targomo-python/tarball/0.23", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/targomo/targomo-python", "keywords": "isochrone,routing,polygon,openstreetmaps,gtfs,map", "license": "", "maintainer": "", "maintainer_email": "", "name": "targomo_python", "package_url": "https://pypi.org/project/targomo_python/", "platform": "", "project_url": "https://pypi.org/project/targomo_python/", "project_urls": { "Download": "https://github.com/targomo/targomo-python/tarball/0.23", "Homepage": "https://github.com/targomo/targomo-python" }, "release_url": "https://pypi.org/project/targomo_python/0.23/", "requires_dist": null, "requires_python": "", "summary": "A python client library to query the Targomo API", "version": "0.23" }, "last_serial": 4378439, "releases": { "0.22": [ { "comment_text": "", "digests": { "md5": "c8c5801b705d59b830c0f1bfc4e428d2", "sha256": "54c1755b2c83f74c3cef0dd2e8f5c1eca612808f017248cd521f9fad037b5c55" }, "downloads": -1, "filename": "targomo_python-0.22.tar.gz", "has_sig": false, "md5_digest": "c8c5801b705d59b830c0f1bfc4e428d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8834, "upload_time": "2018-10-12T18:30:15", "url": "https://files.pythonhosted.org/packages/48/58/cbf276f8027a46ff7ae63009b15cdb8d8355d97d2d3e86e5c3ff524303dc/targomo_python-0.22.tar.gz" } ], "0.23": [ { "comment_text": "", "digests": { "md5": "d4f23520318fd1b72eafff944da3684c", "sha256": "9071a21dea6466132a96aa4567cbc3c7e7c99c95a1cd5275d8be36b5f92cb867" }, "downloads": -1, "filename": "targomo_python-0.23.tar.gz", "has_sig": false, "md5_digest": "d4f23520318fd1b72eafff944da3684c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8816, "upload_time": "2018-10-15T18:13:39", "url": "https://files.pythonhosted.org/packages/45/6e/80d7ba3dd424d64ab7e91fe27b9b0ede4f61dedac4e4e7106681940b4fed/targomo_python-0.23.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d4f23520318fd1b72eafff944da3684c", "sha256": "9071a21dea6466132a96aa4567cbc3c7e7c99c95a1cd5275d8be36b5f92cb867" }, "downloads": -1, "filename": "targomo_python-0.23.tar.gz", "has_sig": false, "md5_digest": "d4f23520318fd1b72eafff944da3684c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8816, "upload_time": "2018-10-15T18:13:39", "url": "https://files.pythonhosted.org/packages/45/6e/80d7ba3dd424d64ab7e91fe27b9b0ede4f61dedac4e4e7106681940b4fed/targomo_python-0.23.tar.gz" } ] }