Skip to main content

Weekly schedule typesetter

Project description

Project Status: Active — The project has reached a stable, usable state and is being actively developed. https://img.shields.io/pypi/pyversions/pdfschedule.svg MIT License

GitHub | PyPI | Issues | Changelog

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

Installation

pdfschedule requires Python 3.6 or higher. Just use pip 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.

-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 is a YAML 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:

https://github.com/jwodder/schedule/raw/master/examples/example01.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdfschedule-0.3.2.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

pdfschedule-0.3.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pdfschedule-0.3.2.tar.gz.

File metadata

  • Download URL: pdfschedule-0.3.2.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for pdfschedule-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c5a6832fb2db27e7246f0e84da9a50c139b22db4841671e2941830a755d38dc9
MD5 d9a53ee6d628b73abc65a146c90d8a65
BLAKE2b-256 f9383386c23b982f3dec986e3bc6ee66c49d7d76d77b3069a7b489d482e9a85d

See more details on using hashes here.

File details

Details for the file pdfschedule-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pdfschedule-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for pdfschedule-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 357d01dad02fd5cc5687c459415df4fa00217630b476cadfefe8d270ec792e29
MD5 dd2548fb19a23d6e0c6869cf6c9a35cc
BLAKE2b-256 c6fb8aef5755b7339d42d59cb64a3257a9a168d66c65ecf36a50abf53e90d508

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page