Metadata-Version: 2.1
Name: pdfschedule
Version: 0.3.0
Summary: Weekly schedule typesetter
Home-page: https://github.com/jwodder/schedule
Author: John Thorvald Wodder II
Author-email: pdfschedule@varonathe.org
License: MIT
Project-URL: Source Code, https://github.com/jwodder/schedule
Project-URL: Bug Tracker, https://github.com/jwodder/schedule/issues
Project-URL: Say Thanks!, https://saythanks.io/to/jwodder
Keywords: pdf,schedule,week
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: License :: OSI Approved :: MIT License
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Office/Business :: Scheduling
Classifier: Topic :: Printing
Requires-Python: ~=3.4
Description-Content-Type: text/x-rst
Requires-Dist: attrs (>=18.2)
Requires-Dist: click (~=7.0)
Requires-Dist: PyYAML (==5.*)
Requires-Dist: reportlab (~=3.4)

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

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

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

.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg
    :target: https://saythanks.io/to/jwodder

`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.4 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 <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.

- ``-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.

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

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


.. _input_format:

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::

    - 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.3.0/examples/example01.png


