{ "info": { "author": "Jordan Mackie", "author_email": "jmackie@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering :: Medical Science Apps." ], "description": "==========================================\nactivityio: Exercise data handling library\n==========================================\n\nExercise/activity data has become a prolific resource, but applying any kind of sophisticated analyses is made difficult by the variety of file formats. This ``python`` library is intended to munge a number of these formats and present the data in a predictable and useable form. Moreover, the API is both closely intertwined with, and an extension of, the awesome `Pandas library `_.\n\nStability\n---------\nPlease note this package is still very much an *alpha* release, so **breaking changes** are likely.\n\nInstallation\n------------\n\nThe package is available on PyPI::\n\n\t$ pip install activityio\n\n\nExample Usage\n-------------\n\nThere is a ``read`` function at the top-level of ``activityio`` that dispatches the appropriate reader based on file extension:\n\n>>> import activityio as aio\n>>> data = aio.read('example.srm')\n\n**NOTE** substitute ``'example.srm'`` with a path to your own activity file.\n\nBut you can also call sub-packages directly:\n\n>>> from activityio import srm\n>>> data = srm.read('example.srm')\n\n``data`` in the above example is a subclass of the ``pandas.DataFrame`` and provides some neat additional functionality. Most notably, certain columns are \"magic\" in that they return specific ``pandas.Series`` subclasses. These subclasses make unit-switching easy, and provide other useful methods:\n\n>>> type(data)\n\n\n>>> data.head(5)\n temp lap dist alt cad pwr speed hr\ntime\n00:00:00 26.1 1 1.027 67 0 0 1.027 71\n00:00:01 26.1 1 2.721 67 0 0 1.694 71\n00:00:02 26.2 1 4.415 67 0 0 1.694 71\n00:00:03 26.2 1 6.331 67 0 0 1.916 71\n00:00:04 26.2 1 8.469 67 0 0 2.138 75\n\n>>> data.normpwr()\n249.54104255943844\n\n>>> type(data.speed)\n\n\n>>> data.speed.base_unit\n'm/s'\n>>> data.speed.kph.mean() # use a different unit\n38.485063801685477\n\n>>> data.dist.base_unit\n'm'\n>>> data.dist.miles[-1]\n134.78580023361226\n\n>>> data.alt.base_unit\n'm'\n>>> data.alt.ascent.sum()\n1898.0\n```\n\nBut **NOTE** you lose this functionality if you go changing column names\n\n>>> data = data.rename(columns={'alt': 'altitude'})\n>>> type(data.altitude)\n\n\nAPI Notes\n---------\n\nThe main package is composed of sub-packages that contain the reading logic for the file format after which they're named. (e.g. ``activityio.fit`` is for parsing ANT/Garmin FIT files.)\n\nThe ultimate logic is defined in a ``_reading`` module, which provides two functions: ``gen_records`` and ``read_and_format``.\n\n+ ``gen_records`` is a generator function for iterating over the data-points in a file. The rows of the data table if you like. A \"record\" is a dictionary object.\n+ ``read_and_format`` uses the above generator to return an ``ActivityData`` object.\n\n``read_and_format`` is available at the top-level of a sub-package aliased as ``read``; so reading in a file looks like ``srm.read('path_to_file.srm')``. ``gen_records`` is imported under the same name.\n\nThere are also some useful ``tools`` provided in module by the same name.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jmackie4/activityio", "keywords": "exercise cycling running garmin data", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "activityio", "package_url": "https://pypi.org/project/activityio/", "platform": "", "project_url": "https://pypi.org/project/activityio/", "project_urls": { "Homepage": "https://github.com/jmackie4/activityio" }, "release_url": "https://pypi.org/project/activityio/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Exercise data handling library", "version": "0.0.3" }, "last_serial": 2751714, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7edec446f45e4d018ffcb64f094b9b0f", "sha256": "9715e3538e9a831be9e34bf816b3c5b4bc7211cbe3c7791487669fe587537a8a" }, "downloads": -1, "filename": "activityio-0.0.1.tar.gz", "has_sig": false, "md5_digest": "7edec446f45e4d018ffcb64f094b9b0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50673, "upload_time": "2016-11-01T12:33:41", "url": "https://files.pythonhosted.org/packages/bc/71/29b512becacd5483dfc165f8cdadebe7eae0e7fbe6f3a1ad9130e8cecb7c/activityio-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "a4a96f67e0efd7844dc14a7508b9fed9", "sha256": "eb478eab8ddba1026d54942966806b18c52643782b32d9cac7efb38b83384dbc" }, "downloads": -1, "filename": "activityio-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a4a96f67e0efd7844dc14a7508b9fed9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56045, "upload_time": "2016-11-02T17:37:07", "url": "https://files.pythonhosted.org/packages/6e/c2/049e357bf3b2d838f8590686828fc89836dee51b51cbf57ca5f43ac90a18/activityio-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b4d2d4c8f2766255a1fe5e3e464b7e21", "sha256": "7886dba0d9eda8f5d03af0b7d16756169f54522f374099fe60c5759534488008" }, "downloads": -1, "filename": "activityio-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b4d2d4c8f2766255a1fe5e3e464b7e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57270, "upload_time": "2017-04-04T10:56:56", "url": "https://files.pythonhosted.org/packages/61/12/f710dbda53a79bcc12de1b0a3c78902aeef1d14e4f0904477ae2de1e046a/activityio-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4d2d4c8f2766255a1fe5e3e464b7e21", "sha256": "7886dba0d9eda8f5d03af0b7d16756169f54522f374099fe60c5759534488008" }, "downloads": -1, "filename": "activityio-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b4d2d4c8f2766255a1fe5e3e464b7e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57270, "upload_time": "2017-04-04T10:56:56", "url": "https://files.pythonhosted.org/packages/61/12/f710dbda53a79bcc12de1b0a3c78902aeef1d14e4f0904477ae2de1e046a/activityio-0.0.3.tar.gz" } ] }