{ "info": { "author": "kardaj", "author_email": "bensalemhsn@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2" ], "description": "# WeeklyCalendar\n\nA simple library to deal with weekly opening hours and other recurrent weekly events\n\n## Usage\nMethods will either return a Boolean or datetime based intervals.\n```python\nfrom weekly_calendar import WeeklyCalendar\nfrom datetime import datetime, timedelta\n\nnow = datetime.now()\ntypical_week = WeeklyCalendar(resolution_in_minutes=60)\n# typical_week is mapped into a bitmap with a bit representing one hour\nassert typical_week.is_idle(now)\ntypical_week.add_busy_interval(now, now + timedelta(hours=3))\n# the date doens't really matter, only the day of the week does\nassert typical_week.is_busy(now)\nbusy_intervals = typical_week.get_busy_intervals(now, now + timedelta(hours=5))\n# The result is a list of intervals (start_time, end_time)\nidle_intervals = typical_week.get_idle_intervals(now, now + timedelta(hours=5))\n# The result is a list of intervals (start_time, end_time)\n```\n\nYou can also do union and intersection of different `WeeklyCalendar` objects:\n\n```python\nfrom weekly_calendar import WeeklyCalendar\n\ntw_60 = WeeklyCalendar(resolution_in_minutes=60)\ntw_30 = WeeklyCalendar(resolution_in_minutes=30)\n# resulting objects will have the lowest resolution\ntw_union = tw_30 + tw_60\ntw_intersection = tw_30 * tw_60\n```\nYou can change resolution of an existing `WeeklyCalendar` object:\n```python\nfrom weekly_calendar import WeeklyCalendar\n\ntw_60 = WeeklyCalendar(resolution_in_minutes=60)\ntw_60_to_30 = tw_60.copy(resolution_in_minutes=30)\n```\nYour `WeeklyCalendar` object is serializable:\n```python\nfrom weekly_calendar import WeeklyCalendar\n\ntw = WeeklyCalendar()\nstr_repr = tw.dumps()\ntw_loaded = WeeklyCalendar.loads(str_repr)\n# checks equal resolution, bitmap, and extra parameters\nassert tw == tw_loaded\n```\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/kardaj/weekly-calendar", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "weekly-calendar", "package_url": "https://pypi.org/project/weekly-calendar/", "platform": "", "project_url": "https://pypi.org/project/weekly-calendar/", "project_urls": { "Homepage": "https://github.com/kardaj/weekly-calendar" }, "release_url": "https://pypi.org/project/weekly-calendar/0.1.2/", "requires_dist": [ "pytz", "tzlocal" ], "requires_python": "", "summary": "A simple library to deal with weekly opening hours and other recurrent weekly events", "version": "0.1.2" }, "last_serial": 4367644, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "654f2765f78f6cea7879e8254cfb3e75", "sha256": "8669ebcd9f46b0cd7659bccf3ed65d21ee2a549871c3ad1ff6b7b380ea8838f3" }, "downloads": -1, "filename": "weekly_calendar-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "654f2765f78f6cea7879e8254cfb3e75", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4104, "upload_time": "2018-10-06T12:25:08", "url": "https://files.pythonhosted.org/packages/05/e4/d4320649995a54a0e595aa7558221858fb6ee378a3765f00663bba0efea1/weekly_calendar-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61a79e7cf80a60d3e9c2665a81b7a707", "sha256": "aa69fb3bd2d0ace494e68124a7efc1bd2e1c8e3e5366dda50b9cdbf93e2b9a63" }, "downloads": -1, "filename": "weekly-calendar-0.1.0.tar.gz", "has_sig": false, "md5_digest": "61a79e7cf80a60d3e9c2665a81b7a707", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3786, "upload_time": "2018-10-06T12:25:09", "url": "https://files.pythonhosted.org/packages/2a/e9/a8ab32691dbb85b26975905fed5568a08f18d55d1489b27c013a57f56b71/weekly-calendar-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "99513f636603f04a5c613ef8645ce751", "sha256": "713f5a72fa6bb726ccc65e58d376981d4d9eab14b2c54c72c31d7f503078c31d" }, "downloads": -1, "filename": "weekly_calendar-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "99513f636603f04a5c613ef8645ce751", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4157, "upload_time": "2018-10-12T08:02:14", "url": "https://files.pythonhosted.org/packages/56/02/f1565c6742cd3583c3b7f8e050be15101fc1429a69d8bbf131bb726a61b7/weekly_calendar-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d50e617a3b7a46e74fa6689592880d69", "sha256": "68cba81af9dd25c8dba1506d77aca9273db7fd12390618d4a9514391364cee2e" }, "downloads": -1, "filename": "weekly-calendar-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d50e617a3b7a46e74fa6689592880d69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3832, "upload_time": "2018-10-12T08:02:15", "url": "https://files.pythonhosted.org/packages/76/5c/c8f0d0dd41b29fe21a4d2155790c449cc986d4e3acd48376adf42412f375/weekly-calendar-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "70525e3e2379a50a529326e60f16a324", "sha256": "1c55c99949b2af5559c5cd0573635182977efef89fa6fd479b979adcd914304e" }, "downloads": -1, "filename": "weekly_calendar-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "70525e3e2379a50a529326e60f16a324", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4985, "upload_time": "2018-10-12T08:16:00", "url": "https://files.pythonhosted.org/packages/5a/29/cb5484f45ac2a65e410abc6fba920853fc37d3a52cc843ed8d5efe6d9cc0/weekly_calendar-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94cdce53ff5fdfa3cc26fd85932d30d3", "sha256": "828c0d5b73b467550cb36e357af61ca05d6c53315c290a7f4253b29a40918e9f" }, "downloads": -1, "filename": "weekly-calendar-0.1.2.tar.gz", "has_sig": false, "md5_digest": "94cdce53ff5fdfa3cc26fd85932d30d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3830, "upload_time": "2018-10-12T08:16:02", "url": "https://files.pythonhosted.org/packages/ed/b7/57ccf71984e1045c9bc80d2a49b1fa4c9b3f34b706ebdc8cca09a9547408/weekly-calendar-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70525e3e2379a50a529326e60f16a324", "sha256": "1c55c99949b2af5559c5cd0573635182977efef89fa6fd479b979adcd914304e" }, "downloads": -1, "filename": "weekly_calendar-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "70525e3e2379a50a529326e60f16a324", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4985, "upload_time": "2018-10-12T08:16:00", "url": "https://files.pythonhosted.org/packages/5a/29/cb5484f45ac2a65e410abc6fba920853fc37d3a52cc843ed8d5efe6d9cc0/weekly_calendar-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94cdce53ff5fdfa3cc26fd85932d30d3", "sha256": "828c0d5b73b467550cb36e357af61ca05d6c53315c290a7f4253b29a40918e9f" }, "downloads": -1, "filename": "weekly-calendar-0.1.2.tar.gz", "has_sig": false, "md5_digest": "94cdce53ff5fdfa3cc26fd85932d30d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3830, "upload_time": "2018-10-12T08:16:02", "url": "https://files.pythonhosted.org/packages/ed/b7/57ccf71984e1045c9bc80d2a49b1fa4c9b3f34b706ebdc8cca09a9547408/weekly-calendar-0.1.2.tar.gz" } ] }