{ "info": { "author": "Dhruv Baldawa", "author_email": "dhruvbaldawa@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: Utilities" ], "description": "commute.py\n==========\n\nThis is a helper script for multi-modal commute planning based on the\ninformation that you specify.\n\n| commute.py helps users who travel across multiple modes of transport\n| and multiple waypoints to make data-based decisions about which route\n| to use and prefer at a given time or at a given time in future.\n\nTable of contents\n-----------------\n\n- `Sample Usage <#sample-usage>`__\n- `Installation <#installation>`__\n- `Configuration <#configuration>`__\n\n - `Get the Google API key <#get-the-google-api-key>`__\n - `Create the configuration file <#create-the-configuration-file>`__\n\n - `Sample configuration <#sample-configuration>`__\n - `Parts of the configuration\n file <#parts-of-the-configuration-file>`__\n\n - `api\\_key <#apikey>`__\n - `places <#places>`__\n - `map <#map>`__\n\n- `Usage <#usage>`__\n- `Status <#status>`__\n\nSample Usage\n------------\n\n.. code:: shell\n\n $ commute -c config.yml -s HOME -d WORK\n Total time: 26min.\n Home (time: 26m. w/traffic drive)\n Work\n -----\n Total time: 43min.\n Home (time: 41m. waiting: 02min. bus)\n Work\n -----\n Total time: 45min.\n Home (time: 25m. w/traffic drive)\n Kwik-e-Mart (time: 20m. w/traffic drive)\n Work\n -----\n ....\n\nInstallation\n------------\n\nYou can easily install this script using either ``pip`` or\n``easy_install``\n\n.. code:: shell\n\n $ pip install commute\n\nor\n\n.. code:: shell\n\n $ easy_install commute\n\nConfiguration\n-------------\n\nGet the Google API key\n~~~~~~~~~~~~~~~~~~~~~~\n\nThis information is borrowed from `Google Maps Python client\nrepo `__\n\n| Each Google Maps Web Service requires an API key or Client ID. API\n keys are\n| freely available with a Google Account at\n https://developers.google.com/console.\n| To generate a server key for your project:\n\n#. Visit https://developers.google.com/console and log in with\n a Google Account.\n#. Select an existing project, or create a new project.\n#. Click **Enable an API**.\n#. Browse for the API, and set its status to \"On\". The Python Client for\n Google Maps Services\n accesses the following APIs:\n\n - Directions API\n - Distance Matrix API\n - Elevation API\n - Geocoding API\n - Time Zone API\n - Roads API\n\n#. Once you've enabled the APIs, click **Credentials** from the left\n navigation of the Developer\n Console.\n#. In the \"Public API access\", click **Create new Key**.\n#. Choose **Server Key**.\n#. If you'd like to restrict requests to a specific IP address, do so\n now.\n#. Click **Create**.\n\nYour API key should be 40 characters long, and begin with ``AIza``.\n\nCreate the configuration file\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThen you will need to create a ``config.yml`` file, or just any ``yaml``\nfile with the following key fields\n\n.. code:: yaml\n\n api_key: # your Google API key over here\n places: # all the places which need to be tracked\n map: # the map, or essentially how you commute between any two places\n\nSample configuration\n^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n api_key: AIzaaaaaaaaaaaaaaaaaaaaaaaaaaa\n\n places:\n HOME:\n location: 742, Evergreen Terrace, Springfield\n alias: Home\n WORK:\n location: Springfield Nuclear Power Plant, Springfield\n alias: Work\n KWIK_E_MART:\n location: Kwik-e-Mart, Springfield\n alias: Apu's\n MOES_TAVERN:\n location: Moe's Tavern, Springfield\n alias: Moe's\n\n map:\n HOME:\n KWIK_E_MART:\n - mode: driving\n MOES_TAVERN:\n - mode: driving\n - mode: walking\n WORK:\n - mode: driving\n - mode: transit\n transit_mode: bus\n KWIK_E_MART:\n HOME:\n - mode: driving\n MOES_TAVERN:\n - mode: driving\n - mode: walking\n WORK:\n - mode: driving\n MOES_TAVERN:\n HOME:\n - mode: driving # drinking and driving is not encouraged\n - mode: walking\n # You don't go to Kwik-e-mart or to work from Moe's\n WORK:\n MOES_TAVERN:\n - mode: driving\n\nParts of the configuration file\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\napi\\_key\n''''''''\n\n``api_key`` will hold the information about the Google Developer's API\nkey.\n\nplaces\n''''''\n\n| ``places`` holds information about all the places to be taken under\n| consideration, and a small description about their physical address\n| add how to refer to them in the output\n\n| Each place has two attributes\n| - location: the physical location of the place (the thing you type\n into Google Maps).\n| - alias: an alias to refer by and to use while printing the output.\n\nmap\n'''\n\n| ``map`` key contains all the connections between the places, possible\n| ways to travel between the places and multiple ways, if any\n| It can also contain other detailed information about the specific way\n of travel.\n\nThe first nesting under map contains the source, use the identifier from\nthe places key above.\n\n.. code:: yaml\n\n map:\n PLACE1:\n PLACE2:\n ....\n ....\n ....\n\nThe next nesting contains a map of possible destinations from the\nsource, which contains the possible ways to travel from the source to\nthe destination\n\n.. code:: yaml\n\n map:\n PLACE1:\n PLACE2:\n - mode: driving\n - mode: transit\n ....\n ....\n ....\n\nThe routing information supports all the arguments that the Google Maps\npython client takes. For more information refer to `Google Maps Python\nAPI\ndocumentation `__\n\nUsage\n-----\n\n.. code:: shell\n\n $ commute -c config.yml -s HOME -d WORK\n $ commute -c config.yml -s HOME -d WORK -w now\n $ commute -c config.yml -s HOME -d WORK -w 'in an hour'\n $ commute -c config.yml -s HOME -d WORK -w 'friday evening @ 7'\n\n| The date/time parsing is done with the help of\n `parsedatetime `__ library, so\n look at the\n| documentation to find more about the formats supported.\n\nFor using it as a library,\n\n.. code:: python\n\n import time\n from commute import get_all_paths, format_path\n\n config_file = \"/path/to/config/file\"\n src = \"HOME\"\n dst = \"WORK\"\n when = time.time()\n\n for rank, path in get_all_paths(config, src, dst, when):\n print(format_path(rank, path))\n print(\"-\" * 5)\n\nStatus\n------\n\nThis project is at a very early stage right now. Please try it out and\nreport any issues.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dhruvbaldawa/commute.py", "keywords": "commute googlemaps directions", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "commute", "package_url": "https://pypi.org/project/commute/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/commute/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dhruvbaldawa/commute.py" }, "release_url": "https://pypi.org/project/commute/0.2/", "requires_dist": null, "requires_python": null, "summary": "commute.py helps users who travel across multiple modes of transport\nand multiple waypoints to make data-based decisions about which route\nto use and prefer at a given time or at a given time in future.", "version": "0.2" }, "last_serial": 2138769, "releases": { "0.1": [], "0.2": [] }, "urls": [] }