Read and write the original Schichtplaner5 FoxPro .DBF database files, plus the SQLite/PostgreSQL ORM and sync layer used by OpenSchichtplaner5.
Project description
libopenschichtplaner5
The core library behind OpenSchichtplaner5 —
a pip-installable package that reads and writes the original Schichtplaner5
FoxPro/dBASE .DBF database files, so an open replacement can run on the exact same
data as the proprietary Windows tool, with no migration.
Import name: the distribution is
libopenschichtplaner5, but the importable package keeps its historical namesp5lib(likepip install PyYAML→import yaml). This keeps OpenSchichtplaner5's imports unchanged after the extraction.
What's inside
| Module | Purpose |
|---|---|
sp5lib.dbf_reader |
Pure-Python DBF reader (UTF-16-LE detection, date parsing, field decode) |
sp5lib.dbf_writer |
Safe DBF writer — exclusive flock, TOCTOU-safe record count, rollback, EOF marker preservation |
sp5lib.database |
High-level SP5Database facade over the DBF tables (employees, shifts, schedule, absences, auth, 2FA …) |
sp5lib.db_factory / sqlite_adapter / pg_database |
Optional SQLite / PostgreSQL backends |
sp5lib.orm |
SQLAlchemy models (models.py SQLite, models_pg.py Postgres), repository, sync |
sp5lib.auto_migrate |
Alembic-based automatic migrations |
sp5lib.email_service |
SMTP notification emails (HTML-escaped templates) |
sp5lib.color_utils |
FoxPro BGR ↔ hex/RGB color helpers |
Installation
pip install "libopenschichtplaner5 @ git+https://github.com/mschabhuettl/libopenschichtplaner5.git"
# with the optional PostgreSQL backend:
pip install "libopenschichtplaner5[postgres] @ git+https://github.com/mschabhuettl/libopenschichtplaner5.git"
Usage
from sp5lib.database import SP5Database
db = SP5Database("/path/to/SP5/Daten") # directory of .DBF files
for emp in db.get_employees():
print(emp["ID"], emp["NAME"], emp["FIRSTNAME"])
Low-level DBF access:
from sp5lib.dbf_reader import read_dbf
from sp5lib.dbf_writer import append_record, get_table_fields
rows = read_dbf("/path/to/SP5/Daten/5EMPL.DBF")
fields = get_table_fields("/path/to/SP5/Daten/5EMPL.DBF")
append_record("/path/to/SP5/Daten/5NOTE.DBF", fields, {"ID": 1, "TEXT": "hello"})
Dependencies
Runtime: SQLAlchemy, alembic, bcrypt, pyotp, packaging.
Optional: psycopg2-binary (via the postgres extra) for the PostgreSQL backend.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev,postgres]"
pytest
ruff check .
License
MIT — see LICENSE. Extracted (with full git history) from
OpenSchichtplaner5's backend/sp5lib/.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libopenschichtplaner5-1.2.0.tar.gz.
File metadata
- Download URL: libopenschichtplaner5-1.2.0.tar.gz
- Upload date:
- Size: 86.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f124b081df24d84798ac0d79a8255fac0f69e3c35f8fd7990e70920aa375b454
|
|
| MD5 |
b0fcf6a68ac4ad2e442adf58e11dfbcf
|
|
| BLAKE2b-256 |
9cb33c10d0115693cecef90c38e020114c75f831035ac7d6196635a361ba0d00
|
Provenance
The following attestation bundles were made for libopenschichtplaner5-1.2.0.tar.gz:
Publisher:
release.yml on mschabhuettl/libopenschichtplaner5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libopenschichtplaner5-1.2.0.tar.gz -
Subject digest:
f124b081df24d84798ac0d79a8255fac0f69e3c35f8fd7990e70920aa375b454 - Sigstore transparency entry: 1638322340
- Sigstore integration time:
-
Permalink:
mschabhuettl/libopenschichtplaner5@b56feffbb316714d33849f87596d59244cf10391 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/mschabhuettl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b56feffbb316714d33849f87596d59244cf10391 -
Trigger Event:
push
-
Statement type:
File details
Details for the file libopenschichtplaner5-1.2.0-py3-none-any.whl.
File metadata
- Download URL: libopenschichtplaner5-1.2.0-py3-none-any.whl
- Upload date:
- Size: 90.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
227df46bc6223c4ce73fe788f696aaf845dc4ef23f7011b848c941c31ce64847
|
|
| MD5 |
c6dd996c6e8678361fa073ee20696c59
|
|
| BLAKE2b-256 |
f5c77a55da3e45eb49e7408882e1e2f7de87856d1403722d31bf7e25c8f7c6fb
|
Provenance
The following attestation bundles were made for libopenschichtplaner5-1.2.0-py3-none-any.whl:
Publisher:
release.yml on mschabhuettl/libopenschichtplaner5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libopenschichtplaner5-1.2.0-py3-none-any.whl -
Subject digest:
227df46bc6223c4ce73fe788f696aaf845dc4ef23f7011b848c941c31ce64847 - Sigstore transparency entry: 1638322455
- Sigstore integration time:
-
Permalink:
mschabhuettl/libopenschichtplaner5@b56feffbb316714d33849f87596d59244cf10391 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/mschabhuettl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b56feffbb316714d33849f87596d59244cf10391 -
Trigger Event:
push
-
Statement type: