Skip to main content

REST API of OpenSchichtplaner5 — the FastAPI service layer over libopenschichtplaner5 (sp5lib): auth/2FA, employees, schedule, absences, reports, notifications and more.

Project description

openschichtplaner5-api

CI License: MIT

The REST API behind OpenSchichtplaner5 — a pip-installable FastAPI service over libopenschichtplaner5 (sp5lib), serving shift-planning data from the original Schichtplaner5 FoxPro .DBF files or the SQLite/PostgreSQL mirror: auth/2FA with JWT sessions, employees, schedule, absences, reports/exports, notifications (SSE), webhooks, iCal feeds and more.

Import name: the distribution is openschichtplaner5-api, but the importable package is sp5api (mirroring libopenschichtplaner5sp5lib). It was extracted from the main app's backend/api/ with full git history.

What's inside

Module Purpose
sp5api.main The FastAPI application (sp5api.main:app) — middlewares, health/metrics, SPA serving
sp5api.routers.* One router per domain: auth, employees, schedule, absences, reports, notifications, availability, overtime, qualification_matrix, recurring_shifts, ical, webhooks, admin, …
sp5api.dependencies Session store, JWT, rate limiting, logging, DB wiring
sp5api.schemas / sp5api.types Pydantic models / type aliases
sp5api.cache / sp5api.rate_limit_store Response caching, rate-limit event log

Installation

pip install "openschichtplaner5-api @ git+https://github.com/mschabhuettl/openschichtplaner5-api.git@main"

(PyPI release pending — once published: pip install openschichtplaner5-api.)

Running

SP5_DB_PATH=/path/to/SP5/Daten python -m uvicorn sp5api.main:app --host 0.0.0.0 --port 8000

Key environment variables

Variable Default Purpose
SP5_DB_PATH (set it!) Directory with the Schichtplaner5 .DBF files
SP5_BACKEND_DIR package parent dir Host-app resource root: <dir>/data, <dir>/api/data, <dir>/api/uploads, alembic config. Shared contract with sp5lib — set it in installed deployments
SP5_FRONTEND_DIST <SP5_BACKEND_DIR>/../frontend/dist Built SPA to serve at / (skipped if absent → API-only mode)
SP5_JWT_SECRET / SECRET_KEY random per process JWT signing secret
SP5_DEV_MODE off Dev bypass token — never in production
ALLOWED_ORIGINS localhost:5173/8000 CORS origins (comma-separated)
DB_BACKEND / DATABASE_URL dbf Switch to the PostgreSQL mirror (via sp5lib)

The full list (rate limits, brute-force lockout, SMTP, logging, password policy …) is documented in the main app's .env.example.

Development

python3 -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
ruff check .
pytest

To develop against a local clone of the library instead of the PyPI release:

pip install -e "../libopenschichtplaner5[postgres]"

data/ and api/data/ at the repo root are runtime-state seeds (skills, wishes, notification settings) used by the test suite — the same layout the main app keeps under backend/, resolved via SP5_BACKEND_DIR. tests/fixtures/ holds the DBF fixture database.

Releasing

Tag vX.Y.Z and push — the release workflow builds sdist+wheel and publishes to PyPI via Trusted Publishing (OIDC).

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

openschichtplaner5_api-1.1.0.tar.gz (373.4 kB view details)

Uploaded Source

Built Distribution

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

openschichtplaner5_api-1.1.0-py3-none-any.whl (181.1 kB view details)

Uploaded Python 3

File details

Details for the file openschichtplaner5_api-1.1.0.tar.gz.

File metadata

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

File hashes

Hashes for openschichtplaner5_api-1.1.0.tar.gz
Algorithm Hash digest
SHA256 31cdec9b6b4973e55cee5094846aab1133771131196d7cd3463a1e52c60872e5
MD5 bee7e84ce0ff1f9d1c9dcba59325f54c
BLAKE2b-256 af8090f3af081ef87ea841725af290db13f42960f7a9a86cd0e62acd70e731ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for openschichtplaner5_api-1.1.0.tar.gz:

Publisher: release.yml on mschabhuettl/openschichtplaner5-api

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

File details

Details for the file openschichtplaner5_api-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openschichtplaner5_api-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 597779f6dc9d2165d8e43633859be7401adbd4bd29872ad841aaa34e1b23b95f
MD5 01e587fea6a78c249fba196445b1ecc1
BLAKE2b-256 2e338d50b3d660e91b4e1f7be24cfbc738b1c4c95b982ecda92adcd66f73bbbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for openschichtplaner5_api-1.1.0-py3-none-any.whl:

Publisher: release.yml on mschabhuettl/openschichtplaner5-api

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

Supported by

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