{ "info": { "author": "Oleksandr Sakhnevych", "author_email": "o.sakhnevych@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": ".. image:: https://img.shields.io/pypi/v/calendar-view.svg\n :target: https://pypi.org/project/calendar-view/\n :alt: PyPi Package Version\n\n.. image:: https://img.shields.io/pypi/pyversions/calendar-view.svg\n :target: https://pypi.org/project/calendar-view/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/dm/calendar-view\n :target: https://pypi.org/project/calendar-view/\n :alt: PyPi Package Monthly Download\n\n.. image:: https://img.shields.io/pypi/l/calendar-view.svg\n :target: https://opensource.org/licenses/MIT\n :alt: MIT License\n\n\n=============\nCalendar View\n=============\n\nLibrary provides a graphical view of the calendar. View, title and events can be easily configured.\n\nThe output in ``*.png`` file.\n\n\nInput parameters\n================\n\nConfiguration\n-------------\n\nConfiguration for the all view can be done using ``CalendarConfig`` class.\n\n.. csv-table::\n :header: \"Parameter\", \"Type\", \"Description\"\n :widths: 17, 10, 73\n\n ``lang``, str, \"Language, which is used for name of the weekday. Supported values: en, ru, ua. Default value: **en**\"\n ``title``, str, \"Title of the view. Can be empty\"\n ``dates``, str, \"The range of the days to show. Default value: **'Mo - Su'**\"\n ``days``, int, \"If ``dates`` does not exist, the number of days to display can be configured starting from Monday. For example, '4' means ``dates='Mo - Th'``\"\n ``hours``, str, \"Hour range to display\"\n ``mode``, str, \"Mode will override some parameters. Available modes:\n - 'week' - show current week\n - 'day_hours' - show hours range '8:00 - 22:00'\n - 'working_hours' - show hours range '8:00 - 19:00'\n - 'auto' - modes 'week' + 'day_hours'\"\n ``show_date``, bool, \"Defines is the date has to be shown. Format: ``'dd.mm'`` or ``'dd.mm.YYYY'`` if ``show_year=True``. Default value: **True**\"\n ``show_year``, bool, \"Defines is the year has to be added to the date format. Omitted if ``show_date=False``. Default value: **False**\"\n ``legend``, bool, \"If ``False`` - draw the name of the event inside the block. If ``True`` - draw the name in the legend. If not defined, will be chosen automatically.\"\n\nExample:\n\n.. code-block:: python\n\n config = CalendarConfig(\n lang='en',\n title='Yoga Class Schedule',\n dates='Mo - Fr',\n hours='8 - 22',\n mode=None,\n show_date=True,\n show_year=False,\n legend=True,\n )\n\n # you can validate your config\n validate_config(config)\n\n\nEvent\n-----\n\n.. csv-table::\n :header: \"Parameter\", \"Type\", \"Description\"\n :widths: 20, 10, 70\n\n ``name``, str, \"Language, which is used for name of the weekday. Supported values: en, ru, ua\"\n ``day``, str / date / datetime, \"The day of the event. Can be set using any of 3 different types. Can't be defined together with ``day_of_week``\"\n ``day_of_week``, int, \"The range of the days to show. Can't be defined together with ``day``\"\n ``start``, str / time / datetime, \"Start of the event. Can be set using any of 3 different types. String has format **HH:mm** or **HH**.\"\n ``end``, str / time / datetime, \"End of the event. Can be set using any of 3 different types. String has format **HH:mm** or **HH**.\"\n\n\nDates\n-----\n\nThe date can be defines using next rules.\n\n1. Allowed year range: [1900, 2100]\n\n2. Any delimiter from the list can be used:\n\n * ``-``\n\n * ``.``\n\n * ``/``\n\n3. Allowed formats:\n\n * ``YYYY.mm.dd``\n\n * ``dd.mm.YYYY``\n\n * ``dd.mm.YY`` - will use 20th century\n\n * ``dd.mm`` - for the current year\n\n\nAs an example, let's look for example at the same data in all formats (assume, that current year is 2019):\n\n* 2019-06-21\n* 21.06.2019\n* 21/06/19\n* 21/06\n\n\nExamples\n========\n\n1. Basic usage\n--------------\n\nMost basic and simplest usage. Doesn't have configuration.\n\nCode:\n\n.. code-block:: python\n\n from calendar_view.calendar import Calendar\n from calendar_view.core.event import EventStyles\n\n calendar = Calendar.build()\n calendar.add_event(day_of_week=0, start='08:00', end='17:00', style=EventStyles.GRAY)\n calendar.add_event(day_of_week=5, start='10:00', end='13:00', style=EventStyles.BLUE)\n calendar.add_event(day_of_week=6, start='15:00', end='18:00')\n calendar.save(\"simple_view.png\")\n\nOutput:\n\n.. image:: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/simple_view.png\n :target: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/simple_view.png\n :width: 600 px\n :align: center\n\n2. Configuration and specific dates\n-----------------------------------\n\nView for one script. Configuration object and events with specific dates are used.\n\nCode:\n\n.. code-block:: python\n\n from calendar_view.calendar import Calendar\n from calendar_view.core import data\n from calendar_view.core.event import Event\n\n config = data.CalendarConfig(\n lang='en',\n title='Sprint 23',\n dates='2019-09-23 - 2019-09-27',\n show_year=True,\n mode='working_hours',\n legend=False,\n )\n events = [\n Event('Planning', day='2019-09-23', start='11:00', end='13:00'),\n Event('Demo', day='2019-09-27', start='15:00', end='16:00'),\n Event('Retrospective', day='2019-09-27', start='17:00', end='18:00'),\n ]\n\n data.validate_config(config)\n data.validate_events(events, config)\n\n calendar = Calendar.build(config)\n calendar.add_events(events)\n calendar.save(\"sprint_23.png\")\n\n\nOutput:\n\n.. image:: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/sprint_23.png\n :target: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/sprint_23.png\n :width: 600 px\n :align: center\n\n\n3. Legend view\n--------------\n\nIf the name of event is too long, it can ee printed in the legend.\n\nCode:\n\n.. code-block:: python\n\n from calendar_view.core import data\n from calendar_view.core.config import CalendarConfig\n from calendar_view.calendar import Calendar\n from calendar_view.core.event import Event\n\n config = CalendarConfig(\n lang='en',\n title='Yoga Class Schedule',\n dates='Mo - Su',\n hours='8 - 22',\n show_date=False,\n legend=True,\n )\n events = [\n Event(day_of_week=0, start='11:00', end='12:30', name='Ashtanga, 90 mins, with Gina', style=EventStyles.GRAY),\n Event(day_of_week=1, start='18:00', end='19:15', name='HOT Core Yoga, 75 mins, with David', style=EventStyles.RED),\n Event(day_of_week=2, start='09:00', end='10:00', name='Meditation - Yoga Nidra, 60 mins, with Heena', style=EventStyles.BLUE),\n Event(day_of_week=2, start='19:00', end='20:15', name='Hatha Yoga, 75 mins, with Jo', style=EventStyles.GREEN),\n Event(day_of_week=3, start='19:00', end='20:00', name='Pilates, 60 mins, with Erika', style=EventStyles.GRAY),\n Event(day_of_week=4, start='18:30', end='20:00', name='Kundalini Yoga, 90 mins, with Dan', style=EventStyles.RED),\n Event(day_of_week=5, start='10:00', end='11:15', name='Hatha Yoga, 75 mins, with Amelia', style=EventStyles.GREEN),\n Event(day_of_week=6, start='10:00', end='11:15', name='Yoga Open, 75 mins, with Klaudia', style=EventStyles.BLUE),\n Event(day_of_week=6, start='14:00', end='15:15', name='Hatha Yoga, 75 mins, with Vick', style=EventStyles.GREEN)\n ]\n\n data.validate_config(config)\n data.validate_events(events, config)\n\n calendar = Calendar.build(config)\n calendar.add_events(events)\n calendar.save(\"yoga_class.png\")\n\n\nOutput:\n\n.. image:: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/yoga_class.png\n :target: https://raw.githubusercontent.com/sakhnevych/CalendarView/master/docs/yoga_class.png\n :width: 600 px\n :align: center\n\n\nLicense\n=======\n\nCalendarView is licensed under a MIT license. Please see the `LICENSE `_ file for details.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sakhnevych/CalendarView", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "calendar-view", "package_url": "https://pypi.org/project/calendar-view/", "platform": "", "project_url": "https://pypi.org/project/calendar-view/", "project_urls": { "Homepage": "https://github.com/sakhnevych/CalendarView" }, "release_url": "https://pypi.org/project/calendar-view/1.2.0/", "requires_dist": [ "Pillow" ], "requires_python": ">=3.6", "summary": "Library provides a graphical view of the calendar.", "version": "1.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 10458508, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "18422371c6f68d4b9ce9cb9b7347d9fc", "sha256": "b8c94e5e94fc5076d2ef10f9e5ea8d5acb0290cd0440c2678f4299112ccc1327" }, "downloads": -1, "filename": "calendar_view-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "18422371c6f68d4b9ce9cb9b7347d9fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 13795, "upload_time": "2019-10-24T04:19:46", "upload_time_iso_8601": "2019-10-24T04:19:46.990306Z", "url": "https://files.pythonhosted.org/packages/92/4a/762b5a8ccea7c8c7843a2870285b8f17f319df2a945e8c72807fe721cba5/calendar_view-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9c362b0afc202cbfba5e392712191aea", "sha256": "89e0bf1f00986b9774e53133279bd8320f78e1ef6d7b4933654eb0a6ca57e247" }, "downloads": -1, "filename": "calendar-view-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9c362b0afc202cbfba5e392712191aea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 170521, "upload_time": "2019-10-24T04:19:49", "upload_time_iso_8601": "2019-10-24T04:19:49.553292Z", "url": "https://files.pythonhosted.org/packages/af/ac/359b21e2e2b10f4fa36c936cf99a38cebc084e97c778c392efa751be3a62/calendar-view-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "cfb085de2820ff9dfafcaf612f8813c5", "sha256": "365566537cb2449c8f2d776b30c569b758107d1352f8fcf83bbfa6df66d7b894" }, "downloads": -1, "filename": "calendar_view-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cfb085de2820ff9dfafcaf612f8813c5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 16925, "upload_time": "2020-05-15T17:52:52", "upload_time_iso_8601": "2020-05-15T17:52:52.944261Z", "url": "https://files.pythonhosted.org/packages/07/14/5ffc53c32e842e0a34d119cfa89ff1cca277660159cba3b64ba2af78e9b8/calendar_view-1.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5be2608b2c3d53d83c8b9c139ef0c836", "sha256": "e4c9732bbe2fccc63d8703af6937a997a4ca722aa1270256bd40cfc8b10bdd97" }, "downloads": -1, "filename": "calendar-view-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5be2608b2c3d53d83c8b9c139ef0c836", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 174249, "upload_time": "2020-05-15T17:52:54", "upload_time_iso_8601": "2020-05-15T17:52:54.772157Z", "url": "https://files.pythonhosted.org/packages/88/06/62349ab299077489303cbd82c933703b0fa3337b2bcbc7d60ef499769111/calendar-view-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "3cea4d158cf8b5e39a4711c8b27bb846", "sha256": "c159d8b534f919d4769536f41e91c6af7ead7ac9928c1bec5be2170884661df3" }, "downloads": -1, "filename": "calendar_view-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3cea4d158cf8b5e39a4711c8b27bb846", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 218038, "upload_time": "2021-05-24T23:12:56", "upload_time_iso_8601": "2021-05-24T23:12:56.427626Z", "url": "https://files.pythonhosted.org/packages/82/8c/746557d9b20f11becdfe173403eaae169a6c37f5879fed9509a600b1f85c/calendar_view-1.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4728dfe8947ef244e0b15d0425399036", "sha256": "28d4adc9d494274ad7804a25dbf32dc40794c1b914c3a80c8fb13a20aae5c36a" }, "downloads": -1, "filename": "calendar-view-1.2.0.tar.gz", "has_sig": false, "md5_digest": "4728dfe8947ef244e0b15d0425399036", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 358187, "upload_time": "2021-05-24T23:12:58", "upload_time_iso_8601": "2021-05-24T23:12:58.778786Z", "url": "https://files.pythonhosted.org/packages/52/6f/df7ad097cc24143b1c610699eae24005e3798a700bd4499798d16988ac28/calendar-view-1.2.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3cea4d158cf8b5e39a4711c8b27bb846", "sha256": "c159d8b534f919d4769536f41e91c6af7ead7ac9928c1bec5be2170884661df3" }, "downloads": -1, "filename": "calendar_view-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3cea4d158cf8b5e39a4711c8b27bb846", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 218038, "upload_time": "2021-05-24T23:12:56", "upload_time_iso_8601": "2021-05-24T23:12:56.427626Z", "url": "https://files.pythonhosted.org/packages/82/8c/746557d9b20f11becdfe173403eaae169a6c37f5879fed9509a600b1f85c/calendar_view-1.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4728dfe8947ef244e0b15d0425399036", "sha256": "28d4adc9d494274ad7804a25dbf32dc40794c1b914c3a80c8fb13a20aae5c36a" }, "downloads": -1, "filename": "calendar-view-1.2.0.tar.gz", "has_sig": false, "md5_digest": "4728dfe8947ef244e0b15d0425399036", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 358187, "upload_time": "2021-05-24T23:12:58", "upload_time_iso_8601": "2021-05-24T23:12:58.778786Z", "url": "https://files.pythonhosted.org/packages/52/6f/df7ad097cc24143b1c610699eae24005e3798a700bd4499798d16988ac28/calendar-view-1.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }