{ "info": { "author": "Serhii Hulko", "author_email": "felytic@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# Time, Date, DateTime Pretty Breaks\n\nSplit time range into ~N \"rounded\" intervals using the following logic:\n\nDivide range by N and select the closest step from below:\n\n- One year\n- Six months, three months, one month\n- Two weeks, one week\n- One day\n- Hours: 12, 6, 4, 3, 2, 1\n- Minutes: 30, 20, 15, 10, 5, 1\n- Seconds: 30, 20, 15, 10, 5, 1\n\nIf the interval is greater than one year, then use Pretty Breaks algorithm for the step.\n\nEach interval starts with time multiple of step. E.g., if we have 20 min step\nand the range starts at 19:43, then the first interval should starts at 19:40.\n\n\n## Examples\n\n| Range start | Range end | N | Result | Description |\n|---------------------|------------------|----|---------------------------------------------------------------------------------------------------------------|-----------------------------------------|\n| 2019-04-04 | 2019-05-19 | 7 | 2019-04-01, 2019-04-08, 2019-04-15, 2019-04-22, 2019-04-29, 2019-05-06, 2019-05-13, 2019-05-20 | Split by one week, starts on Monday |\n| 2019-03-31 02:59:02 | 2019-03-31 03:02 | 50 | 2019-03-31 02:59:00, 2019-03-31 02:59:05, 2019-03-31 02:59:10, ... , 2019-03-31 03:01:55, 2019-03-31 03:02:00 | Split by 5 sec, starts at multiple time |\n| 2018-12-31 | 2019-12-19 | 5 | 2018-10-01, 2019-01-01, 2019-04-01, 2019-07-01, 2019-10-01, 2020-01-01 | Split by three months, starts at Jan. 1 |\n\n\n## Usage\n```python\n>>> from time_pretty_breaks import nice_dt_intervals\n>>> from datetime import datetime\n>>> nice_dt_intervals(datetime(2018, 12, 31), datetime(2019, 12, 19), 5)\n[datetime.datetime(2018, 10, 1, 0, 0), datetime.datetime(2019, 1, 1, 0, 0), datetime.datetime(2019, 4, 1, 0, 0), datetime.datetime(2019, 7, 1, 0, 0), datetime.datetime(2019, \n10, 1, 0, 0), datetime.datetime(2020, 1, 1, 0, 0)]\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eos-vision/time_pretty_breaks", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "time-pretty-breaks", "package_url": "https://pypi.org/project/time-pretty-breaks/", "platform": "", "project_url": "https://pypi.org/project/time-pretty-breaks/", "project_urls": { "Homepage": "https://github.com/eos-vision/time_pretty_breaks" }, "release_url": "https://pypi.org/project/time-pretty-breaks/0.1.1/", "requires_dist": [ "python-dateutil" ], "requires_python": "", "summary": "Split time, date and datetime intervals into \"pretty\" intervals", "version": "0.1.1" }, "last_serial": 5181264, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0c945f97bc6578239c6cd11d5c8bc022", "sha256": "1e8cbd8ff8c3fec4c53cbc4a4dea3e9b89414085c691528e4a4e062ea2d138df" }, "downloads": -1, "filename": "time_pretty_breaks-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0c945f97bc6578239c6cd11d5c8bc022", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3977, "upload_time": "2019-04-11T13:47:09", "url": "https://files.pythonhosted.org/packages/fc/74/a34c97d26071a76c5a0a92e5d457ba03087e0b8c662d9158fd8e37d694bb/time_pretty_breaks-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "585ab0635fc99e8df90c7c02d4d91dcd", "sha256": "8a009d6503ac56ef671088c85ecb20e19f434af1a8cf8dec6f048de384945075" }, "downloads": -1, "filename": "time-pretty-breaks-0.1.tar.gz", "has_sig": false, "md5_digest": "585ab0635fc99e8df90c7c02d4d91dcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2854, "upload_time": "2019-04-11T13:47:11", "url": "https://files.pythonhosted.org/packages/53/ce/0a798923d7b38be8069f15ffc55bec11e46935d828a349cb3e81cdf608e8/time-pretty-breaks-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6efc0f7a4bbacf2924ec98ebd08196be", "sha256": "13a023d679ef6dd92882fa4a817a7be4221b775a1feebfb22c8960d47ba9f4d1" }, "downloads": -1, "filename": "time_pretty_breaks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6efc0f7a4bbacf2924ec98ebd08196be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4130, "upload_time": "2019-04-24T09:51:55", "url": "https://files.pythonhosted.org/packages/67/85/321dc89fe370abbd723c6d5dd8c2920bf415d98e332c3663c26d26f0b333/time_pretty_breaks-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34acf132780cb06e479c684202ed932b", "sha256": "d3b3eff13e307acf74d873e7356f43ff8abe11f33278e6b68df0f376d23a346b" }, "downloads": -1, "filename": "time-pretty-breaks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "34acf132780cb06e479c684202ed932b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2981, "upload_time": "2019-04-24T09:51:56", "url": "https://files.pythonhosted.org/packages/97/c4/1c49bc61330fa29c0c1862140e2b97a0101a8824e10de5da5deb77d3009f/time-pretty-breaks-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6efc0f7a4bbacf2924ec98ebd08196be", "sha256": "13a023d679ef6dd92882fa4a817a7be4221b775a1feebfb22c8960d47ba9f4d1" }, "downloads": -1, "filename": "time_pretty_breaks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6efc0f7a4bbacf2924ec98ebd08196be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4130, "upload_time": "2019-04-24T09:51:55", "url": "https://files.pythonhosted.org/packages/67/85/321dc89fe370abbd723c6d5dd8c2920bf415d98e332c3663c26d26f0b333/time_pretty_breaks-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34acf132780cb06e479c684202ed932b", "sha256": "d3b3eff13e307acf74d873e7356f43ff8abe11f33278e6b68df0f376d23a346b" }, "downloads": -1, "filename": "time-pretty-breaks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "34acf132780cb06e479c684202ed932b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2981, "upload_time": "2019-04-24T09:51:56", "url": "https://files.pythonhosted.org/packages/97/c4/1c49bc61330fa29c0c1862140e2b97a0101a8824e10de5da5deb77d3009f/time-pretty-breaks-0.1.1.tar.gz" } ] }