A read-only Deltion timetable to ICS calendar bridge with background caching and Docker support.
  • Python 98.8%
  • Dockerfile 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-24 16:12:26 +02:00
app removed date from description and added location 2026-08-24 16:08:41 +02:00
tests removed date from description and added location 2026-08-24 16:08:41 +02:00
.env.example removed date from description and added location 2026-08-24 16:08:41 +02:00
compose.yaml removed date from description and added location 2026-08-24 16:08:41 +02:00
Dockerfile first commit 2026-08-23 12:34:28 +02:00
pytest.ini first commit 2026-08-23 12:34:28 +02:00
README.md cleanend up readme and removed claude bs 2026-08-24 16:12:26 +02:00
requirements-dev.txt first commit 2026-08-23 12:34:28 +02:00
requirements.txt first commit 2026-08-23 12:34:28 +02:00

Deltion → Nextcloud ICS Calendar Bridge

A small read-only service that converts the Deltion timetable into a standard .ics calendar feed for Nextcloud and other calendar apps.

Deltion API → Python service → cached .ics → Nextcloud Calendar

Designed for LAN use with Docker Compose/Dockge.

Features

  • Deltion timetable → .ics
  • Nextcloud calendar subscriptions
  • Per-group and per-week caching
  • Background refresh without blocking calendar requests
  • Automatic week rollover
  • Stable event UIDs
  • Optional group allow-list
  • Fast /health endpoint

Installation

Docker Compose / Dockge

  1. Copy the project to your Docker/Dockge stacks directory.
  2. Copy .env.example to .env and configure it.
  3. Start the stack.

The service runs on port 8000.

Check:

http://<host>:8000/health

Calendar URL

The group is specified in the URL:

http://<host>:8000/calendar/GT41B.ics

Example groups:

/calendar/GT41B.ics
/calendar/GT42A.ics

Add the URL to Nextcloud using Calendar → New calendar → Subscribe from URL.

Configuration

Variable Default Description
DELTION_GROUP GT41B Group preloaded at startup
WEEKS_AHEAD 8 Weeks cached into the future
WEEKS_BEHIND 1 Weeks cached into the past
CURRENT_WEEK_REFRESH_MINUTES 5 Current week refresh interval
NEXT_WEEK_REFRESH_MINUTES 15 Next week refresh interval
FUTURE_WEEK_REFRESH_MINUTES 30 Future week refresh interval
PREVIOUS_WEEK_REFRESH_MINUTES 30 Previous week refresh interval
MAX_CONCURRENT_REFRESHES 3 Maximum simultaneous Deltion requests
ALLOWED_GROUPS unset Optional comma-separated group allow-list
DELTION_BASE_URL https://roosters.deltion.nl Deltion base URL
HTTP_TIMEOUT 10 HTTP timeout in seconds
DELTION_COOKIE unset Optional Deltion session cookie
LOG_LEVEL INFO Logging level

Caching

Calendar requests never contact Deltion directly. Cached weeks are refreshed in the background.

Default refresh intervals:

  • Previous week: 30 min
  • Current week: 5 min
  • Next week: 15 min
  • Further future: 30 min

Cache is stored in memory and is rebuilt after a restart.

If a refresh fails, the previous cached data is kept.

Health

GET /health

Shows cache status and refresh information.

GET /health?check_upstream=true

Also checks whether Deltion is reachable.

Security

The service has no authentication by default and is intended for LAN use.

If exposed outside your LAN, set ALLOWED_GROUPS to prevent arbitrary group codes from being tracked and requested.

DELTION_COOKIE, if used, should be treated as a secret and never committed to Git.

Development

Install dependencies:

pip install -r requirements.txt

Run:

uvicorn app.main:app --host 0.0.0.0 --port 8000

Run tests:

pip install -r requirements-dev.txt
pytest -q