{ "info": { "author": "Christopher Tunnell", "author_email": "christopher.douglas.tunnell@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "==========\nTime range\n==========\n\n\n.. image:: https://img.shields.io/pypi/v/time_range.svg\n :target: https://pypi.python.org/pypi/time_range\n\n.. image:: https://img.shields.io/travis/tunnell/time_range.svg\n :target: https://travis-ci.org/tunnell/time_range\n\n.. image:: https://readthedocs.org/projects/time-range/badge/?version=latest\n :target: https://time-range.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n.. image:: https://pyup.io/repos/github/tunnell/time_range/shield.svg\n :target: https://pyup.io/repos/github/tunnell/time_range/\n :alt: Updates\n\n.. image:: https://pyup.io/repos/github/tunnell/time_range/python-3-shield.svg\n :target: https://pyup.io/repos/github/tunnell/time_range/\n :alt: Python 3\n \n.. image:: https://api.codacy.com/project/badge/Grade/54ccc5b06b2142baade214ad0da62ac4\n :alt: Codacy Badge\n :target: https://app.codacy.com/app/tunnell/time_range?utm_source=github.com&utm_medium=referral&utm_content=tunnell/time_range&utm_campaign=badger\n\nMethods for handling time range overlaps for scheduling, taxes, and physics applications.\n\n\n* Free software: GNU General Public License v3\n* Documentation: https://time-range.readthedocs.io.\n\n\nTutorial\n--------\n\n\n.. code:: ipython3\n\n import time_range as tr\n\nSpecify a year\n\n.. code:: ipython3\n\n year = 2017\n\nFor this year, define all your trips by defining where they are and when\nthe trip started. This is an ordered list so the end date is inferred\nfrom the next trip in the list. For the start date, the first number is\nmonth, the second is the day, the third is the hour, and so forth.\n\n.. code:: ipython3\n\n trips = ({'country': 'NL', 'start': (1, 1)},\n {'country': 'ES', 'start': (3, 4, 14, 0)},\n {'country': 'NL', 'start': (4, 11, 19, 50)},\n {'country': 'US', 'start': (5, 22, 12), 'state': 'NJ'},\n {'country': 'US', 'start': (6, 30, 12, 30), 'state': 'TX'},\n {'country': 'US', 'start': (7, 3, 16, 28), 'state': 'NJ'})\n \n\n\nDetermine your time distribution over the year as follows for just\nworking days:\n\n.. code:: ipython3\n\n series = tr.time_distribution(trips=trips, year=2004)\n series\n\n\n\n\n.. parsed-literal::\n\n working_day 251.0\n (NL, NL) 73.0\n (ES, ES) 26.0\n (US, NJ) 150.0\n (US, TX) 2.0\n dtype: float64\n\n\n\nAnd your fraction of income in each place as follows:\n\n.. code:: ipython3\n\n tr.fraction_of_year(trips=trips, year=2004, income=100000)\n\n\n\n\n.. raw:: html\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
daysfraction_of_yearincome
working_day251.01.000000100000.000000
(NL, NL)73.00.29083729083.665339
(ES, ES)26.00.10358610358.565737
(US, NJ)150.00.59761059760.956175
(US, TX)2.00.007968796.812749
\n
\n\n\n\nLastly, if you're just curious about the working days of that year:\n\n.. code:: ipython3\n\n tr.get_working_days(2013).head()\n\n\n\n\n.. raw:: html\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
working_day
2013-01-01False
2013-01-02True
2013-01-03True
2013-01-04True
2013-01-05False
\n
\n\n\n\n\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n\n\n=======\nHistory\n=======\n\n0.3.0 (2018-03-24)\n------------------\n\n* Functioning enough for taxes at least.\n\n0.1.0 (2018-02-11)\n------------------\n\n* First release on PyPI.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tunnell/time_range", "keywords": "time_range", "license": "GNU General Public License v3", "maintainer": "", "maintainer_email": "", "name": "time-range", "package_url": "https://pypi.org/project/time-range/", "platform": "", "project_url": "https://pypi.org/project/time-range/", "project_urls": { "Homepage": "https://github.com/tunnell/time_range" }, "release_url": "https://pypi.org/project/time-range/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Methods for handling time range overlaps for scheduling, taxes, and physics applications.", "version": "0.3.0" }, "last_serial": 4979677, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7576cf5244be2c0b06cd082275eea821", "sha256": "2557ad0d5d2aa9846ff92548dbcc18c2332ddaf23ab6ad9a3de6c1a8aad319ab" }, "downloads": -1, "filename": "time_range-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7576cf5244be2c0b06cd082275eea821", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4647, "upload_time": "2019-03-24T19:45:06", "url": "https://files.pythonhosted.org/packages/8e/bd/822292c82a7f24a2235f5d998d63b9520de64c5d0229aabecbded6a3b954/time_range-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78fe3dae965f063d62f06eee9e197e9c", "sha256": "1fad31a17ff04a7d0da64525d22562e1d9927b40dfae2a7c3f0b27039b612002" }, "downloads": -1, "filename": "time_range-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "78fe3dae965f063d62f06eee9e197e9c", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 5610, "upload_time": "2019-03-24T19:45:08", "url": "https://files.pythonhosted.org/packages/93/7f/d27b9eda7c133965f97b35d02037963e5af63b0c10178a07a44a6a46fa10/time_range-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "58314becec2bb574d67fe459087081a0", "sha256": "3353873fe8317ff5a70f8ef4ddad158c9699a8535110fe52f8f8eceb618c69a2" }, "downloads": -1, "filename": "time_range-0.1.0.tar.gz", "has_sig": false, "md5_digest": "58314becec2bb574d67fe459087081a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12102, "upload_time": "2019-03-24T19:45:10", "url": "https://files.pythonhosted.org/packages/94/b7/80e960f83cf7039906fb049c890b36fa1109c0d88b8dd4f054c90d59c38e/time_range-0.1.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "eb8f0a86b7565819e56c15e5180c1f54", "sha256": "1fef6121fe9f2bc989e76bef262a691132dc85626ebcb910a0ae9cf16c8ebe19" }, "downloads": -1, "filename": "time_range-0.3.0.tar.gz", "has_sig": false, "md5_digest": "eb8f0a86b7565819e56c15e5180c1f54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12164, "upload_time": "2019-03-24T19:49:14", "url": "https://files.pythonhosted.org/packages/5d/b3/ca39f851352d4b53cdf9c5d98317fb76f19261a621c3d5f6fb4bdb9ee8bd/time_range-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb8f0a86b7565819e56c15e5180c1f54", "sha256": "1fef6121fe9f2bc989e76bef262a691132dc85626ebcb910a0ae9cf16c8ebe19" }, "downloads": -1, "filename": "time_range-0.3.0.tar.gz", "has_sig": false, "md5_digest": "eb8f0a86b7565819e56c15e5180c1f54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12164, "upload_time": "2019-03-24T19:49:14", "url": "https://files.pythonhosted.org/packages/5d/b3/ca39f851352d4b53cdf9c5d98317fb76f19261a621c3d5f6fb4bdb9ee8bd/time_range-0.3.0.tar.gz" } ] }