Skip to main content

schedz

Read training sessions from a Google Calendar, read-only. Shared by invoicez, which bills them, and deckz, which tells which deck is taught next.

Installation

pip install "schedz[google]"

Without the google extra, schedz still parses events read from a JSON file (read_events_file), e.g. an anonymised test fixture.

Setup

In Google Cloud, enable the Google Calendar API and create an OAuth client of type Desktop app. Save its JSON as client-secrets.json in schedz's user config directory (~/.config/schedz/ on Linux). The first call opens a browser for consent; the token is cached next to it (token.json), readable by you only, and serves every tool using schedz.

Settings

A tool reads its calendar settings into CalendarSettings, or a subclass adding its own keys (invoicez's gcal section is one):

calendar_id: someone@example.com
# Verbose regex: groups continuation, company, training, place, and optionally
# extra and tentative. Titles are matched whole.
title_pattern: |
  \s*
  (?P<tentative> \? \s+ )?
  (?P<continuation> -> \s+ )?
  (?P<company> .*? ) \s+ - \s+
  (?P<training> .*? ) \s+ - \s+
  (?P<place> .*? )
  (?: \s+ - \s+ (?P<extra> .*? ) )?
  \s*
# Optional: what a timed event counts as, in hours.
durations: {half_day_hours: [2.5, 4], day_hours: [6, 9]}

Calendar conventions

  • A title such as Orsys - BDA - CV - Intra Acme is a session: company, training, place and extra, kept in their case.
  • -> Orsys - BDA - CV - Intra Acme continues the latest earlier session with the same title (ignoring case): together they make one engagement.
  • ? Orsys - BDA - CV is an unconfirmed booking (tentative).
  • All-day events count their days; timed events of 2.5 to 4 hours are half-days, of 6 to 9 hours days; others are reported, not kept.
  • The description may hold YAML: ref (the client's reference), preparation_days, trainees (the number of people trained) and invoice (a number billed by hand). HTML and free text are reported and ignored.

Problems are reported as Diagnostics (info, warning, error), never raised.

Use

from schedz.loading import fetch_calendar, read_engagements
from schedz.settings import CalendarSettings

settings = CalendarSettings.model_validate(mapping)
engagements, diagnostics = read_engagements(
    fetch_calendar(settings.calendar_id), settings
)

schedz.google lists the calendars (list_calendars) and fetches events (fetch_events); schedz.parsing and schedz.grouping turn them into Sessions and Engagements.

Development

  • uv sync, then uv run doit install_hooks: every commit runs doit check test (ruff, pyrefly, pytest) through prek. There is no CI.
  • tests/assets/events.json is invoicez's anonymised fixture (its scripts/dump_gcal_fixture.py).

Releasing

  1. uv run bumpver update --minor (or --patch): bumps, commits, tags and pushes.
  2. uv run doit publish: builds and uploads to PyPI with the token of creds.env, a gitignored file at the repository's root holding one line, export UV_PUBLISH_TOKEN=pypi-..., readable by you only (chmod 400).

Metadata

Release files for schedz 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schedz 0.1.0
File Size Uploaded Provenance Actions
schedz-0.1.0.tar.gz 15.0 kB Without provenance Details for schedz-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schedz 0.1.0
File Interpreter ABI Platform Actions
schedz-0.1.0-py3-none-any.whl Python 3 none any Details for schedz-0.1.0-py3-none-any.whl

Total release size: 31.9 kB

Release files / schedz-0.1.0.tar.gz

Download URL schedz-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
03fda65b47c1f5deceafe3931b2e05d86e1792a70b07330a120e46b7a486892c
BLAKE2b-256 checksum
How to use checksums
22a6a2bc15b4c4df0e2aafbe80ec3d59bd0a5bcb724fbce0c0b4db58ab7eb821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / schedz-0.1.0-py3-none-any.whl

Download URL schedz-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15581c5fc3c99b83db61114dcbb25628ff04648085d4d1933283a8e3d98746f0
BLAKE2b-256 checksum
How to use checksums
0c8ec3eb5236e3e3e22ecdcfb933cf87073421398a65af58c58cca0d74994491
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for schedz 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page