{ "info": { "author": "Christopher Joakim", "author_email": "christopher.joakim@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "m26 - calculations for sports like running, cycling, and swimming\n=================================================================\n\nFeatures\n--------\n\n- Create Distances in either miles, kilometers, or yards.\n- Translates Distances to the other units of measure.\n- Specify ElapsedTime either in 'hh:mm:ss' strings, or int second values.\n- Calculates Speed from a given Distance and ElapsedTime - per mile, per kilometer, and per yard.\n- Calculates pace_per_mile and seconds_per_mile for a given Speed.\n- Projects one Speed to another Distance with either a simple or algorithmic formula.\n- RunWalkCalculator calculates pace and mph from given time intervals and paces.\n- Calculates the Age of person, and age_graded times.\n- Calculates five standard heart-rate training zones based on Age.\n\n\nQuick start\n-----------\n\nInstallation:\n\n.. code-block:: console\n\n $ pip install m26\n\nUse:\n\n.. code-block:: pycon\n\n >>> import m26\n\n >>> d1 = m26.Distance(26.2)\n >>> d1\n \n >>> d1.as_miles()\n 26.2\n >>> d1.as_kilometers()\n 42.1648128\n >>> d1.as_yards()\n 46112.0\n\n >>> d2 = m26.Distance(50.0, m26.Constants.uom_kilometers())\n >>> d2\n \n\n >>> d3 = m26.Distance(7040, m26.Constants.uom_yards())\n >>> d3\n \n\n >>> d4 = m26.Distance(10.0, m26.Constants.uom_kilometers())\n >>> d4.add(d1)\n >>> d4\n \n >>> d4.subtract(d3)\n >>> d4\n \n\n >>> t1 = m26.ElapsedTime('3:47:30')\n >>> t1\n \n\n >>> t2 = m26.ElapsedTime(3662)\n >>> t2\n \n\n >>> s = m26.Speed(d1, t1)\n >>> s\n etime:>\n\n >>> s.mph()\n 6.90989010989011\n\n >>> s.kph()\n 11.120390189010989\n\n >>> s.yph()\n 12161.406593406595\n\n >>> s.seconds_per_mile()\n 520.9923664122138\n\n >>> s.pace_per_mile()\n '8:40.99'\n\n >>> s.projected_time(d2, 'simple')\n '04:29:46'\n\n >>> s.projected_time(d2, 'riegel')\n '04:32:32'\n\n >>> result = m26.RunWalkCalculator.calculate('2:30', '9:16', '0:45', '17:00', 31.0)\n >>> result\n {\n \"avg_mph\": 5.4292343387471,\n \"avg_ppm\": \"11:03.07\",\n \"miles\": 31.0,\n \"proj_miles\": 31.0,\n \"proj_time\": \"05:42:35\",\n \"run_hhmmss\": \"2:30\",\n \"run_ppm\": \"9:16\",\n \"walk_hhmmss\": \"0:45\",\n \"walk_ppm\": \"17:00\"\n }\n\n >>> a = m26.AgeCalculator.calculate('1960-10-01', '2015-10-18')\n >>> a\n \n\n >>> a2 = m26.Age(58.1)\n >>> a2\n \n\n >>> graded = s.age_graded(a, a2)\n >>> graded\n etime:>\n\n >>> zones = a2.training_zones()\n >>> zones\n [\n {\n \"age\": 58.1,\n \"max\": 161.9,\n \"pct_max\": 0.95,\n \"pulse\": 153.805,\n \"zone\": 1\n },\n {\n \"age\": 58.1,\n \"max\": 161.9,\n \"pct_max\": 0.9,\n \"pulse\": 145.71,\n \"zone\": 2\n },\n {\n \"age\": 58.1,\n \"max\": 161.9,\n \"pct_max\": 0.85,\n \"pulse\": 137.615,\n \"zone\": 3\n },\n {\n \"age\": 58.1,\n \"max\": 161.9,\n \"pct_max\": 0.8,\n \"pulse\": 129.52,\n \"zone\": 4\n },\n {\n \"age\": 58.1,\n \"max\": 161.9,\n \"pct_max\": 0.75,\n \"pulse\": 121.42500000000001,\n \"zone\": 5\n }\n ]\n\n\nSource Code\n===========\n\nSee `m26-py at GitHub `_ .\n\n\nChangelog\n=========\n\nVersion 0.2.0\n-------------\n\n- 2017/09/27. Version 0.2.0, Converted to the pytest testing framework; coverage at 100%.\n- 2015/10/31. Initial Production release.\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/cjoakim/m26-py", "keywords": "calculator running cycling swimming pace-per-mile mph age-grading", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "m26", "package_url": "https://pypi.org/project/m26/", "platform": "", "project_url": "https://pypi.org/project/m26/", "project_urls": { "Homepage": "https://github.com/cjoakim/m26-py" }, "release_url": "https://pypi.org/project/m26/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "m26 is a python library for speed and pace calculations for sports like running and cycling", "version": "0.2.0" }, "last_serial": 3209741, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "aab3ea0b8e907015d9137d765c37568a", "sha256": "45f516cae1941b38bcbcd740b66f75f2efd6dcd59e8296efaeaad9e5a2bf8847" }, "downloads": -1, "filename": "m26-0.1.0.tar.gz", "has_sig": false, "md5_digest": "aab3ea0b8e907015d9137d765c37568a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9265, "upload_time": "2015-10-31T19:06:38", "url": "https://files.pythonhosted.org/packages/e0/57/6cba907ec4fa871feae11675ac892f6608bec7458346add7762ed15f4851/m26-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7d880ad3a9afd8e21a3b90a5176f602d", "sha256": "cb09e14d02f402ea90c6f6a699aa48e08bc9ff35f10a159af08a720f429e843a" }, "downloads": -1, "filename": "m26-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7d880ad3a9afd8e21a3b90a5176f602d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9440, "upload_time": "2017-09-28T11:04:46", "url": "https://files.pythonhosted.org/packages/9b/90/c8e68b691a880494b012c2b20f058e7e3ddfbdc032f42971ab30ab352124/m26-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d880ad3a9afd8e21a3b90a5176f602d", "sha256": "cb09e14d02f402ea90c6f6a699aa48e08bc9ff35f10a159af08a720f429e843a" }, "downloads": -1, "filename": "m26-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7d880ad3a9afd8e21a3b90a5176f602d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9440, "upload_time": "2017-09-28T11:04:46", "url": "https://files.pythonhosted.org/packages/9b/90/c8e68b691a880494b012c2b20f058e7e3ddfbdc032f42971ab30ab352124/m26-0.2.0.tar.gz" } ] }