{ "info": { "author": "Kyle Fitzsimmons", "author_email": "kfitzsimmons@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# itinerum-tripkit\n\n[![Python Version](https://img.shields.io/badge/Python-3.6%7C3.7-blue.svg?style=flat-square)]()\n\nDocumentation for library usage: https://itinerum-tripkit.readthedocs.io/\n\nThis library serves as a framework to process data from the Itinerum platform and hardware GPS loggers (e.g., QStarz). It can be used both through Jupyter to explore datasets interactively or imported as a module in standalone scripts and applications.\n\nThis repository also serves as the development bed for the Itinerum platform algorithms within the TRIP Lab repositories. \n\n## Setup\n\n### Quickstart\n\n1. Clone this repository and `pip install -r requirements.txt` (using a Python [virtual environment](https://docs.python.org/3/library/venv.html) is recommended)\n2. Place source *.csv* data in the `itinerum-tripkit/input` folder (create if necessary) and edit `./tripkit/config.py` to reflect the correct filepaths.\n\nThen either:\n\n - Start Jupyter in repository directly and get started by `from tripkit import Itinerum`\n\n *or*\n\n - Copy the `tripkit` directory into other projects as a library (more complete packaging to come)\n\nFor more complete installation information, see the official [itinerum-tripkit documentation](https://itinerum-tripkit.readthedocs.io/en/stable/usage/installation.html).\n\n\n### Loading Subway Stations\n\nSubway station data for trip detection can be loaded similarly for all processing modules. Place a *.csv* file of station entrances with the columns of `x` (or `longitude`) and `y` (or `latitude`). Locations are expected as geographic coordinates only. Edit the `SUBWAY_STATIONS_FP` config parameter to reflect the subway stations *.csv* filepath.\n\n#### Example\n\n*View attributes on a User*\n\n```python\nimport tripkit_config\nitinerum = Itinerum(tripkit_config)\n\n# create a new database and read in .csv data\nitinerum.setup()\n\n# load all users from database\nusers = itinerum.load_all_users()\n\ntest_user = users[0]\nprint(test_user.coordinates)\nprint(test_user.prompt_responses)\n```\n\n*Run trip detection on a User*\n\n```python\nimport tripkit_config\nitinerum = Itinerum(tripkit_config)\n\n# load user from database by uuid\nuser = itinerum.database.load_user('00000000-0000-0000-0000-000000000000')\n\n# run a provided trip detection algorithm\nparameters = {\n 'subway_entrances': itinerum.database.load_subway_entrances(),\n 'break_interval_seconds': tripkit_config.TRIP_DETECTION_BREAK_INTERVAL_SECONDS,\n 'subway_buffer_meters': tripkit_config.TRIP_DETECTION_SUBWAY_BUFFER_METERS,\n 'cold_start_distance': tripkit_config.TRIP_DETECTION_COLD_START_DISTANCE_METERS,\n 'accuracy_cutoff_meters': tripkit_config.TRIP_DETECTION_ACCURACY_CUTOFF_METERS\n}\ntrips = itinerum.process.trip_detection.triplab.v2.algorithm.run(user.coordinates, parameters)\n```\n\n## Processing\n\n#### Trip Detection\n\n| Arguments | |\n| ----------------- | ------------------------------------------------------------ |\n| `parameters` | A dictionary to supply arbitrary kwargs to an algorithm |\n| `subway_stations` | A list of subway station entrance database objects containing `latitude` and `longitude` attributes |\n| `coordinates` | A timestamp-ordered list of coordinates as dicts for a specific user. Multiple users should be run in sequence and have their output coordinates concatenated into a single list after if desired. |\n\n#### Trip Outputs\n\nTrips will be output with the following trip codes to indicate the type of trip:\n\n| Trip Code | Description |\n| --------- | ----------------------------------- |\n| 1 | Complete trip |\n| 2 | Complete trip - subway |\n| 101 | Missing trip |\n| 102 | Missing trip - subway |\n| 103 | Missing trip - less than 250m |\n| 201 | Single point |\n| 202 | Distance too short - less than 250m |\n\n\n## Outputs\nThe aim of this library is to provide easy visualization of Itinerum data to assist in writing trip processing algorthms. Therefore at a minimum, the library provides exporting processed coordinates and traces as .geojson files (TBA: GeoPackage format). With a PostgreSQL backend for caching, PostGIS can be enabled (unimplemented) and a `geom` column generated for directly connection QGIS to the output data. The library should also easily provide methods for easily plotting GPS within Jupyter notebooks.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/TRIP-Lab/itinerum-tripkit", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "itinerum-tripkit", "package_url": "https://pypi.org/project/itinerum-tripkit/", "platform": "", "project_url": "https://pypi.org/project/itinerum-tripkit/", "project_urls": { "Homepage": "https://github.com/TRIP-Lab/itinerum-tripkit" }, "release_url": "https://pypi.org/project/itinerum-tripkit/0.0.2/", "requires_dist": [ "ciso8601 (>=2.1.1)", "fiona (>=1.8.6)", "geopy (>=1.20.0)", "numpy (>=1.17.2)", "peewee (>=3.10.0)", "polyline (>=1.4.0)", "pytz (>=2019.2)", "requests (>=2.22.0)", "scipy (>=1.3.1)", "utm (>=0.5.0)" ], "requires_python": ">=3.6", "summary": "A toolkit for inferencing trips and trip metadata from Itinerum GPS data", "version": "0.0.2" }, "last_serial": 5842655, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "cbb0c8aab44c3306d4f3a17b44f4027b", "sha256": "6d153a08c97b614b7751cff97ea5ed80178df5b4e829aaa1c178b0534a73821a" }, "downloads": -1, "filename": "itinerum_tripkit-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cbb0c8aab44c3306d4f3a17b44f4027b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 83882, "upload_time": "2019-09-17T15:56:42", "url": "https://files.pythonhosted.org/packages/f5/23/b9d7067a9cec6d44da6f5c9ab2384b8f7af09ff3ef87e32d38e5e27b13a5/itinerum_tripkit-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6724f814f7936827d5bede79b6aac8b0", "sha256": "1864329c33f89b34970d8af25790ebd2ba1d563f8cfe860bdaef351e46c38402" }, "downloads": -1, "filename": "itinerum-tripkit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6724f814f7936827d5bede79b6aac8b0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 44939, "upload_time": "2019-09-17T15:56:45", "url": "https://files.pythonhosted.org/packages/a8/14/628eb64670d75eef109b1ceedd081e2d3988a6362b63659cc7ad9e54d1fc/itinerum-tripkit-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "70e7abeb73ecc6d0b7cbc51f66a64e43", "sha256": "3b0efb02db1a593a63e7fe3c709480e8d134c480e343dcba148ada9a0e624f75" }, "downloads": -1, "filename": "itinerum_tripkit-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "70e7abeb73ecc6d0b7cbc51f66a64e43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 83866, "upload_time": "2019-09-17T16:33:07", "url": "https://files.pythonhosted.org/packages/3b/b7/ba2257fccf181282803f6af1431ea44a08ac87bbb49ccf54678488435ded/itinerum_tripkit-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "367ac3ab0779332911a3031b3ce1be8c", "sha256": "1eb8102472b4a8e4062fb62731a62d1ff332a283141746a88a0c5252117bcc91" }, "downloads": -1, "filename": "itinerum-tripkit-0.0.2.tar.gz", "has_sig": false, "md5_digest": "367ac3ab0779332911a3031b3ce1be8c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 44984, "upload_time": "2019-09-17T16:33:09", "url": "https://files.pythonhosted.org/packages/ba/3b/528f7e55e47dc1f6879d84002b75b00beb01c79a3ddde3aca1548b179436/itinerum-tripkit-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70e7abeb73ecc6d0b7cbc51f66a64e43", "sha256": "3b0efb02db1a593a63e7fe3c709480e8d134c480e343dcba148ada9a0e624f75" }, "downloads": -1, "filename": "itinerum_tripkit-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "70e7abeb73ecc6d0b7cbc51f66a64e43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 83866, "upload_time": "2019-09-17T16:33:07", "url": "https://files.pythonhosted.org/packages/3b/b7/ba2257fccf181282803f6af1431ea44a08ac87bbb49ccf54678488435ded/itinerum_tripkit-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "367ac3ab0779332911a3031b3ce1be8c", "sha256": "1eb8102472b4a8e4062fb62731a62d1ff332a283141746a88a0c5252117bcc91" }, "downloads": -1, "filename": "itinerum-tripkit-0.0.2.tar.gz", "has_sig": false, "md5_digest": "367ac3ab0779332911a3031b3ce1be8c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 44984, "upload_time": "2019-09-17T16:33:09", "url": "https://files.pythonhosted.org/packages/ba/3b/528f7e55e47dc1f6879d84002b75b00beb01c79a3ddde3aca1548b179436/itinerum-tripkit-0.0.2.tar.gz" } ] }