|
|
4 ヶ月 前 | |
|---|---|---|
| .githooks | 4 ヶ月 前 | |
| docker | 4 ヶ月 前 | |
| room_cal | 4 ヶ月 前 | |
| scripts | 4 ヶ月 前 | |
| tests | 4 ヶ月 前 | |
| .dockerignore | 4 ヶ月 前 | |
| .gitignore | 4 ヶ月 前 | |
| README.md | 4 ヶ月 前 | |
| pyproject.toml | 4 ヶ月 前 | |
| uv.lock | 4 ヶ月 前 |
A self-hosted calendar management tool for short-term rental hosts. It syncs pricing, availability, reservations, and discounts between a local CalDAV calendar and external booking platforms (Airbnb, Booking.com). A FastAPI HTTP server exposes the data to a Vue-based web calendar, and a FastMCP server exposes health checks to AI assistants.
See docker/README.md for container-based deployment (recommended for production).
For local development:
# Install dependencies (requires uv)
uv sync --group dev
# Activate git hooks
git config core.hooksPath .githooks
Start from room_cal/config.json (the bundled defaults) and place an override at ~/.local/room_cal/config.json (or $ROOM_CAL_DATA_HOME/config.json). Keys are deep-merged — you only need to include what you want to change.
room_cal/config-all.json is a generated file that shows every available config key with its default value. It is kept up to date automatically by the pre-commit hook and is the canonical reference for what can be configured.
# Sync reservations, prices, and availability for a date range
uv run room-cal fetch-reservations 2026-07-01 2026-07-31
uv run room-cal fetch-prices 2026-07-01 2026-07-31
uv run room-cal push-prices 2026-07-01 2026-07-31
uv run room-cal fetch-closed 2026-07-01 2026-07-31
uv run room-cal push-closed 2026-07-01 2026-07-31
# Apply discount rules and show a diff
uv run room-cal apply-rules 2026-07-01 2026-07-31
uv run room-cal apply-discounts 2026-07-01 2026-07-31
uv run room-cal diff 2026-07-01 2026-07-31
# Create default prices for dates with no local price set
uv run room-cal fill-prices 2026-07-01 2026-07-31 [--weekday 150] [--weekend 200]
# Fetch an external iCal feed
uv run room-cal fetch-feed 2026-07-01 2026-07-31 --feed-name Fire
# Sync from user calendar; push busy export calendar
uv run room-cal fetch-user-cal 2026-07-01 2026-07-31
uv run room-cal push-busy 2026-07-01 2026-07-31
# Local-only workflows (no service API calls)
uv run room-cal local-sync 2026-07-01 2026-07-31 # feeds + rules + fill + busy
uv run room-cal local-refresh 2026-07-01 2026-07-31 # rewrite all local Room calendar events
uv run room-api
Serves the web calendar at http://localhost:8000 and exposes REST endpoints for all sync operations.
refresh-creds)Session cookies for Airbnb and Booking.com are obtained via a Playwright browser session and must be periodically refreshed.
uv run refresh-creds [--output=file|stdout|api]
Three output modes are available:
| Mode | Behaviour |
|---|---|
file (default) |
Writes credentials to airbnb.env and booking.env in $ROOM_CAL_DATA_HOME |
stdout |
Prints credentials to stdout — useful for piping or inspection |
api |
POSTs credentials directly to a running room-api instance |
The api mode requires api_url to be set in your config.json:
{
"api_url": "https://your-room-cal-instance.example.com"
}
calendar.html)The web calendar provides a month view of all pricing and availability data. Key features:
GET /health and shows green/amber/red based on CalDAV connectivity and service credential statusThe repo includes a pre-commit hook that regenerates room_cal/config-all.json automatically on every commit. After cloning, activate it with:
git config core.hooksPath .githooks
To regenerate the file manually:
uv run python scripts/gen_example_config.py > room_cal/config-all.json
Store tests run without any live server. Service API and CalDAV tests require live credentials:
uv run python -m pytest tests/