simple_module_events
Owned calendars with private, internal or public visibility, calendar sharing,
multilingual categories, and events for SimpleModule hosts. Events have texts in
each content language, one-off, all-day and recurring schedules, overrides for
single occurrences, a review and publishing workflow, and a bounded occurrences
read, a console calendar, a public site (pages, ICS feeds, JSON-LD and a sitemap), private feed
links and .ics import, pagebuilder blocks, reminders, registration through records and read-only
subscriptions to external calendars. The module is complete (ten parts). See the
guide, public pages, feeds,
import, blocks and cards, reminders,
registration, subscriptions,
operating and the
approved design.
Install
Add simple_module_events to the consuming host's dependencies:
pip install simple_module_events
The framework's settings, sharing and background_tasks modules must also be
installed (background_tasks runs scheduled publishing). The
module is discovered through its simple_module entry point. In this repo,
the workspace dependency and host wiring are already present:
make install
make migrate
For a different host, autogenerate and inspect its own migration:
make migration msg="add events"
Set branch_labels = ("events",) on its first events revision, inspect that
it creates the seven events_* tables without dropping existing data, then
run make migrate. Migrations belong to the host, never to this wheel. The
label is a named target in the host's shared history; downgrading
events@base does not remove only events' tables.
Pagebuilder blocks
With the pagebuilder extra, events adds an "Upcoming events" list and a read-only "Events
calendar" to pagebuilder's palette. They show only published events of public calendars,
fetched when the page is viewed. sm_events.contracts.cards gives newsletter the same public
projection for its Event card. See blocks and cards.
Reminders
A signed-in user follows a published event ("Remind me") with one or more lead times (15 minutes, 1
hour, 1 day, 1 week) and gets one email per occurrence and lead, at most once, from the events.reminders
beat. It needs a worker and beat serving the events queue, a mail transport that delivers and the host's
public_base_url; the control says why in words when reminders cannot be delivered. The worker grants no
more access than a request would, so a user whose only right is the tenant membership role is told no mail
will come (upstream #1005). See Reminders.
Usage
Open /admin/events/calendars to create a calendar, edit its metadata, change
visibility, share it, or move it to Trash and restore it. Calendar slugs may
be renamed in this release. Creation needs events.edit and makes the caller
the owner. Only events.manage holders see Transfer ownership; they pick
an active member of the current tenant. The user picker searches after three
characters and shows the server's masked email; an exact address search may
return that address in full.
Open /admin/events/categories with events.view and events.manage to enter category names in each configured
content language. The first language is required. Categories have an optional
colour and a slug fixed at creation. Deletion leaves events uncategorised.
/admin/events/ (events.view) is the calendar: month, week, day and list
views over every calendar the caller can read, with a filter per calendar and
category, a toggle between the calendar's time zone and the browser's, and
live state in the URL (?view=week&date=2026-03-25&tz=mine&calendar=<id>). A
caller who may write events can click or drag-select a slot to create a draft,
drag an event to another time or day, drag its edge to change the end, or open
it and choose Move…, the keyboard path for both. A drag moves one
occurrence of a series or the whole series (a prompt asks) and never rewrites
the repeat rule. See the guide's The calendar.
Open /admin/events/list (events.view) for the Events list: filter by
calendar, status (draft, in review, published, scheduled), category, date range
and title, page through the results, and move an event to Trash or restore it.
New event opens the editor on a calendar the caller may write in. The editor
(/admin/events/edit/{id}) has the texts per content language with a rich-text
description, times on the event's own clock (timezone and all-day), place,
category, sub-events, the repeat rule with a preview of the next occurrences and
skip, cancel and move for single ones, the workflow bar (submit, withdraw,
approve now or later, reject with a note, cancel a schedule, unpublish) and the
revision history. A save that meets a newer revision shows what changed and asks
whether to load theirs or save yours over it. A published or scheduled event is
read-only for a caller without events.publish, with the reason on screen.
Scheduled publishing needs the Celery beat (see the guide's
Scheduled publishing).
API
All paths below start with /api/events. Writes use the framework's session
CSRF token (X-CSRF-Token); module errors use {"detail","code"}. FastAPI
request-validation errors retain their ordinary 422 shape. Unknown or
inaccessible calendars return the same 404. Calendars use last-write-wins
metadata forms and have no expected_revision; every event write quotes it
(409 stale).
| Method and path | Action / permission |
|---|---|
GET /calendars?trashed=false |
List readable calendars; events.view |
POST /calendars |
Create; events.view and events.edit |
GET /calendars/{id} |
Read through the calendar policy; events.view |
PATCH /calendars/{id} |
Edit metadata; owner, edit share or manager |
PUT /calendars/{id}/visibility |
Set private/internal/public; owner or manager |
PUT /calendars/{id}/owner |
Transfer with {owner_id}; manager, active tenant member only |
DELETE /calendars/{id} |
Move to trash; owner or manager |
POST /calendars/{id}/restore |
Restore; owner or manager |
GET /calendars/{id}/share-candidates?q=… |
Find active members; owner or manager, three characters minimum |
GET /categories |
List; events.view |
POST /categories |
Create; events.view and events.manage |
PATCH /categories/{id} |
Replace names or colour; events.view and events.manage |
DELETE /categories/{id} |
Delete; events.view and events.manage |
GET /events |
List with calendar, status, category, from, to, q, trashed, locale, page, page_size; events.view |
POST /events |
Create with calendar_id, times, texts; write right on the calendar |
GET /events/{id} |
Read with texts, overrides, sub-events and the caller's rights; events.view |
PATCH /events/{id} |
Edit with expected_revision; write right, plus events.publish when the event is published or scheduled |
DELETE /events/{id}?expected_revision= |
Move to trash; same right as PATCH |
POST /events/{id}/restore |
Restore with expected_revision; same right |
POST /events/{id}/{submit,withdraw,approve,reject,unschedule,unpublish} |
Workflow, each with expected_revision (see the guide's table) |
GET /events/{id}/revisions, /revisions/{number} |
History, newest first; write right |
POST /events/{id}/overrides |
Skip, cancel or move one occurrence; DELETE /events/{id}/overrides/{override_id}?expected_revision= restores it |
POST /recurrence/preview |
The next occurrences of a schedule and the overrides it would orphan |
GET /occurrences?start=&end= |
The bounded read for a range (at most 366 days, 2,000 items) |
Calendar responses carry owner_name (a string or null). An owner is named
only when they are an active member of the bound organisation with a display
name; anyone else, including an owner whose only label is an email address, is
null and shown as "Unknown user". No address or part of one is shown outside
the owner/manager-only picker. If the user directory or the membership store fails
(a failed query included), lists, reads and writes still succeed with null
owner names; the share picker and an ownership transfer still fail
rather than guess (no directory at all is a 503).
A calendar name and every category name are single line: control characters,
line and paragraph separators and text-direction controls are rejected with a
422. A description keeps line breaks and tabs and rejects other control
characters and text-direction controls. A name with no slug-able characters
gets the slug calendar-2 (calendar is a public route segment, so no calendar
takes it) or category (then -2, -3, ...).
Every calendar API route also needs events.view. Grants, lists and revokes
use the framework's /api/sharing/shares with
resource_type="events.calendar", the calendar UUID as resource_id, a user
subject_id and role view or edit. The framework additionally requires
sharing.share. The picker requires the owner or a manager; an edit share does
not admit it. Calendar and category lists return at most 500 rows each.
Settings
Configure Events on the Settings screen or with
scripts/set_setting.py. Both fields are SYSTEM-scope and DB-backed; no
SM_EVENTS_* environment variables are read.
| Field | Default | Applies |
|---|---|---|
default_timezone |
UTC |
New calendars; unknown stored names fall back to UTC with a warning |
content_locales |
["en"] |
The languages of category names, event texts and event slugs; restart required |
Permissions and access
events.view admits console readers; owners and share holders also need it.
private calendars are readable by their owner and shares; internal and
public calendars are readable by signed-in members with events.view.
Only owners, edit shares and managers edit calendar metadata. Only owners
and managers change visibility, share, trash or restore a calendar.
events.manage bypasses calendar visibility within the bound tenant and
manages categories and ownership. events.publish, combined with write access to the
calendar, approves, schedules and unpublishes events and is needed to change
an event that is published or scheduled. See the guide's access table.
No anonymous page or API ships yet. A public calendar's visibility prepares it for later public, published-event reads; it exposes no anonymous screen today.
Extensions
A second package can add dates to a calendar (a source such as records' records:dates), add an event type
with its own validated extra, and contribute chips, details, editor and settings sections and toolbar
items. An admin turns a source on per calendar (Calendars, Sources). A plugin call runs on its own
database connection with a time budget and validated, bounded output, and a failing source is reported in the
calendar instead of failing it. See the plugin guide. Events publishes nine bus
events, also durably through the background_tasks outbox. The delivery list is in the guide.
Public pages
Anonymous visitors get a public calendar's published events under public_prefix (default
/events, restart-only), with /{locale} prefixes:
| Route | Serves |
|---|---|
/events/ |
Upcoming list and a read-only calendar tab |
/events/c/{calendar} |
One public calendar |
/events/{slug} (?date=) |
An event, or one occurrence of a series |
/events/{slug}.ics, /events/calendar.ics, /events/c/{calendar}.ics |
Event file and subscription feeds |
/events/sitemap.xml |
Every public, indexable event |
Everything else (drafts, internal and private calendars, trash, other tenants) answers one identical 404. See Public pages.
Private feeds and import
A private subscription link per user and calendar (/events/feed/<token>.ics, shown once,
revocable) and an .ics import screen (/admin/events/import). See
Private feed links and Importing an .ics file.
Subscriptions
A calendar's owner (or an events manager) can subscribe it to an external .ics address in the
Subscriptions dialog on the Calendars screen. The external events show on that calendar, marked
External, read-only and as plain text; they are never re-published in this site's feeds,
reminders or newsletter cards, and reach the public grid only when the subscription is marked
public by someone with events.publish. The address is stored encrypted and shown only as
https://host/…; it is fetched by a worker through a pinned, size- and time-bounded client that
checks every resolved address and every redirect.
Two settings (Settings screen, never the environment): subscription_refresh_minutes (default 60,
kept between 15 and 1,440) and allow_private_subscription_urls (off; it lets a subscription saved
by someone with events.manage use private ranges, plain http and any port, never loopback,
link-local or metadata addresses: trusted networks only). Refreshing needs beat and a worker on
the events queue (events.refresh_subscriptions). See the guide.
Metadata
Release files for simple-module-events 0.0.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple_module_events-0.0.16.tar.gz | 1.2 MB | With provenance | Details for simple_module_events-0.0.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_module_events-0.0.16-py3-none-any.whl | Python 3 | none | any | Details for simple_module_events-0.0.16-py3-none-any.whl |
Total release size: 2.0 MB
Release files / simple_module_events-0.0.16.tar.gz
| Download URL | simple_module_events-0.0.16.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e9a7d16d9a1be119995bbdd710ec164337f8cddb4353866955472f58fbcd387
|
|
BLAKE2b-256 checksum How to use checksums |
06cd5346b1ccd0368ac956b3bf354f169fbe39beedb821a8592378ce6dab4bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / simple_module_events-0.0.16-py3-none-any.whl
| Download URL | simple_module_events-0.0.16-py3-none-any.whl |
|---|---|
| Size | 827.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d18a5d2122122bae39a82fed28bc5dc3358f98ca7b1f502bf42d0a24b93c5320
|
|
BLAKE2b-256 checksum How to use checksums |
e08ca3b717b2f031a8b61d6d966cf5e6836feb3db701ac0ab42ffff1165e8be2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for simple-module-events 0.0.16
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for simple_module_events-0.0.16.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA 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.