pdfschedule


Namepdfschedule JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryWeekly schedule typesetter
upload_time2024-12-01 12:56:34
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords pdf schedule week
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |repostatus| |pyversions| |license|

.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg
    :target: https://www.repostatus.org/#active
    :alt: Project Status: Active — The project has reached a stable, usable
          state and is being actively developed.

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/pdfschedule.svg
    :target: https://pypi.org/project/pdfschedule/

.. |license| image:: https://img.shields.io/github/license/jwodder/schedule.svg
    :target: https://opensource.org/licenses/MIT
    :alt: MIT License

`GitHub <https://github.com/jwodder/schedule>`_
| `PyPI <https://pypi.org/project/pdfschedule/>`_
| `Issues <https://github.com/jwodder/schedule/issues>`_
| `Changelog <https://github.com/jwodder/schedule/blob/master/CHANGELOG.md>`_

``pdfschedule`` is a Python 3 script for creating PDF documents showing
one's weekly schedule of events.


Installation
============
``pdfschedule`` requires Python 3.8 or higher.  Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``pdfschedule`` and its dependencies::

    python3 -m pip install pdfschedule


Usage
=====

::

    pdfschedule [<OPTIONS>] [<infile> [<outfile>]]

Input — formatted as described below under "`Input Format`_" — is read from
``<infile>`` (defaulting to standard input), and the resulting PDF is written
to ``<outfile>`` (defaulting to ``<infile>`` with its file extension changed to
``.pdf``, or to standard output if ``<infile>`` is standard input).


Options
-------

-C, --color             Color the event boxes various colors instead of just
                        grey.

-E TIME, --end-time TIME
                        Specify the time of day at which each day should start.
                        Times are specified in the format ``HH:MM`` using
                        24-hour time, the minutes being optional (and
                        optionally separated from the hour by a colon or
                        period).  Defaults to half an hour before the earliest
                        event start time or 00:00, whichever is later.

-F FONT, --font FONT    Typeset text in the given font.  ``FONT`` must be
                        either the name of a builtin PostScript font or the
                        path to a ``.ttf`` file.  By default, text is typeset
                        in Helvetica.

-f SIZE, --font-size SIZE
                        Set the size of the font used for event information to
                        ``SIZE`` (default 10).  The names of the days of the
                        week are typeset at ``SIZE * 1.2``; the times of day
                        are typeset at ``SIZE / 1.2``.

-M, --start-monday      Use Monday as the first day of the week instead of
                        Sunday.

-p, --portrait          Typeset the table in "portrait mode," i.e., with the
                        shorter side of the paper as the width.  The default is
                        to typeset it in "landscape mode."

-s FACTOR, --scale FACTOR
                        Divide the length of each side of the table by
                        ``FACTOR``.  Without this option, the table fills the
                        whole page, except for a one-inch margin on each side.

-S TIME, --start-time TIME
                        Specify the time of day at which each day should end.
                        Times are specified in the format ``HH:MM`` using
                        24-hour time, the minutes being optional (and
                        optionally separated from the hour by a colon or
                        period).  Defaults to half an hour after the latest
                        event end time or 24:00, whichever is earlier.

-T, --no-times          Do not show the times for each hour line.

--no-weekends           Do not show Sunday and Saturday.


Input Format
============

Input is a `YAML <http://yaml.org>`_ list of dictionaries.  Each dictionary
represents a single weekly event and must contain the following keys:

``name``
   *(optional)* The (possibly multiline) text to display in the event's box on
   the schedule

``days``
   The days of the week on which the event occurs, specified as a string of one
   or more of the following abbreviations in any order (optionally with
   intervening whitespace and/or commas):

   ===================================  =========
   Abbreviation                         Day
   ===================================  =========
   ``Su`` or ``Sun``                    Sunday
   ``M`` or ``Mo`` or ``Mon``           Monday
   ``T`` or ``Tu`` or ``Tue``           Tuesday
   ``W`` or ``We`` or ``Wed``           Wednesday
   ``H`` or ``R`` or ``Th`` or ``Thu``  Thursday
   ``F`` or ``Fr`` or ``Fri``           Friday
   ``Sa`` or ``Sat``                    Saturday
   ===================================  =========

   Case is significant.  Unknown abbreviations are ignored.

``time``
   The start & end times of the event in the format ``HH:MM - HH:MM``.  Times
   are specified in 24-hour format, the minutes being optional (and optionally
   separated from the hour by a colon or period).

``color``
   *(optional)* The background color of the event's box, given as six
   hexadecimal digits.  The default background color is either grey or, if
   ``--color`` is in effect, taken from a small palette of basic colors based
   on the event's index.


Example
=======

The following input file:

.. code:: yaml

    - name: Garfield impersonation
      days: M
      time: 7-9
      color: "FFB04E"

    - name: Work to live
      days: MTWRF
      time: 9-17

    - name: |
        Exercise class
        (The one on Main Street)
      days: M, W, F
      time: 17:00 - 18:00
      color: "29FF65"

    - name: Have they brought back my favorite show yet?
      days: R
      time: 19-19.30
      color: "FF84DF"

    - name: Poor decisions
      days: F
      time: 22-23.59
      color: "000000"

    - name: Sleep in
      days: SatSun
      time: 7-12
      color: "4226C4"

produces (using the default options) an output file that looks like this:

.. image:: https://github.com/jwodder/schedule/raw/v0.4.1/examples/example01.png

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pdfschedule",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pdf, schedule, week",
    "author": null,
    "author_email": "John Thorvald Wodder II <pdfschedule@varonathe.org>",
    "download_url": "https://files.pythonhosted.org/packages/27/e1/b1b73c54160a30a3bec4457ce5bcc59954fb8f044a2b97cc97a441ba1896/pdfschedule-0.4.1.tar.gz",
    "platform": null,
    "description": "|repostatus| |pyversions| |license|\n\n.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg\n    :target: https://www.repostatus.org/#active\n    :alt: Project Status: Active \u2014 The project has reached a stable, usable\n          state and is being actively developed.\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/pdfschedule.svg\n    :target: https://pypi.org/project/pdfschedule/\n\n.. |license| image:: https://img.shields.io/github/license/jwodder/schedule.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub <https://github.com/jwodder/schedule>`_\n| `PyPI <https://pypi.org/project/pdfschedule/>`_\n| `Issues <https://github.com/jwodder/schedule/issues>`_\n| `Changelog <https://github.com/jwodder/schedule/blob/master/CHANGELOG.md>`_\n\n``pdfschedule`` is a Python 3 script for creating PDF documents showing\none's weekly schedule of events.\n\n\nInstallation\n============\n``pdfschedule`` requires Python 3.8 or higher.  Just use `pip\n<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install\n``pdfschedule`` and its dependencies::\n\n    python3 -m pip install pdfschedule\n\n\nUsage\n=====\n\n::\n\n    pdfschedule [<OPTIONS>] [<infile> [<outfile>]]\n\nInput \u2014 formatted as described below under \"`Input Format`_\" \u2014 is read from\n``<infile>`` (defaulting to standard input), and the resulting PDF is written\nto ``<outfile>`` (defaulting to ``<infile>`` with its file extension changed to\n``.pdf``, or to standard output if ``<infile>`` is standard input).\n\n\nOptions\n-------\n\n-C, --color             Color the event boxes various colors instead of just\n                        grey.\n\n-E TIME, --end-time TIME\n                        Specify the time of day at which each day should start.\n                        Times are specified in the format ``HH:MM`` using\n                        24-hour time, the minutes being optional (and\n                        optionally separated from the hour by a colon or\n                        period).  Defaults to half an hour before the earliest\n                        event start time or 00:00, whichever is later.\n\n-F FONT, --font FONT    Typeset text in the given font.  ``FONT`` must be\n                        either the name of a builtin PostScript font or the\n                        path to a ``.ttf`` file.  By default, text is typeset\n                        in Helvetica.\n\n-f SIZE, --font-size SIZE\n                        Set the size of the font used for event information to\n                        ``SIZE`` (default 10).  The names of the days of the\n                        week are typeset at ``SIZE * 1.2``; the times of day\n                        are typeset at ``SIZE / 1.2``.\n\n-M, --start-monday      Use Monday as the first day of the week instead of\n                        Sunday.\n\n-p, --portrait          Typeset the table in \"portrait mode,\" i.e., with the\n                        shorter side of the paper as the width.  The default is\n                        to typeset it in \"landscape mode.\"\n\n-s FACTOR, --scale FACTOR\n                        Divide the length of each side of the table by\n                        ``FACTOR``.  Without this option, the table fills the\n                        whole page, except for a one-inch margin on each side.\n\n-S TIME, --start-time TIME\n                        Specify the time of day at which each day should end.\n                        Times are specified in the format ``HH:MM`` using\n                        24-hour time, the minutes being optional (and\n                        optionally separated from the hour by a colon or\n                        period).  Defaults to half an hour after the latest\n                        event end time or 24:00, whichever is earlier.\n\n-T, --no-times          Do not show the times for each hour line.\n\n--no-weekends           Do not show Sunday and Saturday.\n\n\nInput Format\n============\n\nInput is a `YAML <http://yaml.org>`_ list of dictionaries.  Each dictionary\nrepresents a single weekly event and must contain the following keys:\n\n``name``\n   *(optional)* The (possibly multiline) text to display in the event's box on\n   the schedule\n\n``days``\n   The days of the week on which the event occurs, specified as a string of one\n   or more of the following abbreviations in any order (optionally with\n   intervening whitespace and/or commas):\n\n   ===================================  =========\n   Abbreviation                         Day\n   ===================================  =========\n   ``Su`` or ``Sun``                    Sunday\n   ``M`` or ``Mo`` or ``Mon``           Monday\n   ``T`` or ``Tu`` or ``Tue``           Tuesday\n   ``W`` or ``We`` or ``Wed``           Wednesday\n   ``H`` or ``R`` or ``Th`` or ``Thu``  Thursday\n   ``F`` or ``Fr`` or ``Fri``           Friday\n   ``Sa`` or ``Sat``                    Saturday\n   ===================================  =========\n\n   Case is significant.  Unknown abbreviations are ignored.\n\n``time``\n   The start & end times of the event in the format ``HH:MM - HH:MM``.  Times\n   are specified in 24-hour format, the minutes being optional (and optionally\n   separated from the hour by a colon or period).\n\n``color``\n   *(optional)* The background color of the event's box, given as six\n   hexadecimal digits.  The default background color is either grey or, if\n   ``--color`` is in effect, taken from a small palette of basic colors based\n   on the event's index.\n\n\nExample\n=======\n\nThe following input file:\n\n.. code:: yaml\n\n    - name: Garfield impersonation\n      days: M\n      time: 7-9\n      color: \"FFB04E\"\n\n    - name: Work to live\n      days: MTWRF\n      time: 9-17\n\n    - name: |\n        Exercise class\n        (The one on Main Street)\n      days: M, W, F\n      time: 17:00 - 18:00\n      color: \"29FF65\"\n\n    - name: Have they brought back my favorite show yet?\n      days: R\n      time: 19-19.30\n      color: \"FF84DF\"\n\n    - name: Poor decisions\n      days: F\n      time: 22-23.59\n      color: \"000000\"\n\n    - name: Sleep in\n      days: SatSun\n      time: 7-12\n      color: \"4226C4\"\n\nproduces (using the default options) an output file that looks like this:\n\n.. image:: https://github.com/jwodder/schedule/raw/v0.4.1/examples/example01.png\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Weekly schedule typesetter",
    "version": "0.4.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/jwodder/schedule/issues",
        "Source Code": "https://github.com/jwodder/schedule"
    },
    "split_keywords": [
        "pdf",
        " schedule",
        " week"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fcb6d72d4c8b7b7d8bcfd159afe088bc85afacce24563d030a6329aca4bf83b",
                "md5": "f20be8c8a5965f616073b505b598cc5f",
                "sha256": "0de06bebcf44db8818e30862001f39e0e14e2a139f77cdfaad5a2728778ed67c"
            },
            "downloads": -1,
            "filename": "pdfschedule-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f20be8c8a5965f616073b505b598cc5f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9028,
            "upload_time": "2024-12-01T12:56:23",
            "upload_time_iso_8601": "2024-12-01T12:56:23.667426Z",
            "url": "https://files.pythonhosted.org/packages/6f/cb/6d72d4c8b7b7d8bcfd159afe088bc85afacce24563d030a6329aca4bf83b/pdfschedule-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "27e1b1b73c54160a30a3bec4457ce5bcc59954fb8f044a2b97cc97a441ba1896",
                "md5": "2f530c14f6c085e2eeda76c99957fcd1",
                "sha256": "b072fcb7f630bbf9c6d70186208928b8059b6fa5bd2f5e4c338ff41c9bc4ee00"
            },
            "downloads": -1,
            "filename": "pdfschedule-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2f530c14f6c085e2eeda76c99957fcd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 37133,
            "upload_time": "2024-12-01T12:56:34",
            "upload_time_iso_8601": "2024-12-01T12:56:34.506187Z",
            "url": "https://files.pythonhosted.org/packages/27/e1/b1b73c54160a30a3bec4457ce5bcc59954fb8f044a2b97cc97a441ba1896/pdfschedule-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-01 12:56:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jwodder",
    "github_project": "schedule",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "pdfschedule"
}
        
Elapsed time: 0.40562s