Skip to main content

stapel-calendar

CI codecov PyPI

Calendar, recurrence and scheduling for the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.

A generic calendar core — Event / Participant / RSVP, an RFC 5545 recurrence engine (RRULE via python-dateutil, virtual expansion + on-demand materialization), availability (working windows, free/busy, slots) and ICS export. Two flavors of one domain — meetings and bookings — share this core; everything app-specific lives behind seams.

Install

pip install stapel-calendar
INSTALLED_APPS = [
    # ...
    "stapel_calendar",
]

# urls.py
path("calendar/", include("stapel_calendar.urls"))

Concepts

  • Event — a scheduled thing (meeting/booking/appointment) with tz-aware start/end, an owner and an opaque scope_key. No FK to any host concept (org, room) — scoping and resources are seams.
  • Recurrence — the series master stores a canonical RRULE. Occurrences are virtual until they gain their own state (an RSVP or a resource), at which point they are materialized (persisted) on demand.
  • Availability — recurring working windows minus busy events give open booking slots.
from stapel_calendar import services

series = services.create_event(
    owner=user, title="Standup",
    start=start, end=end,
    recurrence_type="weekdays",            # -> FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR
)
occurrences = services.expand_event(series, range_start, range_end)  # virtual
services.materialize(series, occurrence_start)  # persist one + emit hook
busy = services.free_busy(user, range_start, range_end)
slots = services.compute_slots(user, range_start, range_end, slot_minutes=30)

Settings

All configuration lives in the STAPEL_CALENDAR namespace (dict setting, flat setting, or env var — resolved lazily):

Key Default Meaning
SCOPE_PROVIDER …scope.DefaultScopeProvider Resolve/filter the opaque scope_key
REMINDER_POLICY …reminders.DefaultReminderPolicy When/what to remind
PRESETS {} Custom recurrence presets (merged over built-ins)
REMINDER_OFFSETS [10] Minutes before start to remind
REMINDER_SCAN_WINDOW_SECONDS 60 Reminder cron granularity
DEFAULT_EXPANSION_HORIZON_DAYS 90 Default range end
MAX_EXPANSION_OCCURRENCES 1000 Expansion safety cap
DEFAULT_SLOT_MINUTES 30 Default slot length

comm surface

Kind Name Contract
Emit calendar.occurrence.materialized An occurrence was persisted — subscribe to attach a resource
Emit calendar.event.reminder_due A reminder is due — deliver it
Function calendar.free_busy {user_id, start, end, scope_key?} -> {busy: [...]}

Extension points

See MODULE.md — the agent-facing map of every fork-free seam (the resource hook, reminder policy, scope provider, recurrence presets, serializer seams, settings).

Development

pip install -e . && pip install pytest pytest-django ruff
./setup-hooks.sh
pytest tests/

License

MIT

Download files

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

Source Distribution

stapel_calendar-0.3.8.tar.gz (69.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stapel_calendar-0.3.8-py3-none-any.whl (56.9 kB view details)

Uploaded Python 3

File details

Details for the file stapel_calendar-0.3.8.tar.gz.

File metadata

  • Download URL: stapel_calendar-0.3.8.tar.gz
  • Upload date:
  • Size: 69.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stapel_calendar-0.3.8.tar.gz
Algorithm Hash digest
SHA256 6a4915f0f8b56bb21cf28849a13907cacc2d5b8793fc8d24dec26547bb8298ee
MD5 632d67b99bd5939022ec83e05ad80eb8
BLAKE2b-256 a42dad8112d582053e590a895e978c24dd24856647dd539fa4d053b3d3613c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_calendar-0.3.8.tar.gz:

Publisher: publish.yml on usestapel/stapel-calendar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stapel_calendar-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: stapel_calendar-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 56.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stapel_calendar-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9a7c90fa3c2a215a1f10e12b5f280901344de6fb21f984c674041d9173845597
MD5 f70a5ba235567fed570405b0e96e2d9d
BLAKE2b-256 482663aa05c650ae1c2d8c6e64cb0748dccba52fd9823c2fe468229004b15fc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_calendar-0.3.8-py3-none-any.whl:

Publisher: publish.yml on usestapel/stapel-calendar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.9

2 files

This release

0.3.8 This release

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.2.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page