Repository navigation
FAQ
Is workclock affiliated with businesstimedelta?
No. It is an independent project that ports businesstimedelta's tests (MIT, © Sebastiaan Boer) and mirrors its API in workclock.compat.
Do I need a Rust toolchain to install the Python or npm package? Not for npm, which ships WebAssembly, and not for Python on Linux x86_64 and aarch64, macOS x86_64 and arm64 or Windows x64, where PyPI has prebuilt abi3 wheels for CPython 3.9 and later. Other platforms, and free-threaded CPython (which cannot load abi3 wheels), build from the sdist, which needs a Rust toolchain.
Which versions are supported?
Rust 1.85 and later, CPython 3.9 and later, and Node.js 22 and later. In browsers, use a bundler (Vite, webpack, Rollup, esbuild) or import workclock/web and await init().
Where does the time zone data come from?
The Python wheels and the npm package bundle the IANA database. The npm package always uses its copy; the Python wheels use the system database when there is one. The Rust crate reads the system database on Linux and macOS and a copy bundled with jiff on Windows; on a Linux image without tzdata, install the tzdata package, set TZDIR, or enable jiff's tzdb-bundle-always feature. Results can differ between machines only when their databases disagree about a zone's history or future.
Why does the typed Python API reject naive datetimes?
A naive datetime does not say which instant it means, and guessing is how off-by-an-hour bugs start. workclock.compat keeps businesstimedelta's behaviour of treating them as UTC.
Can a call hang? No. A schedule without working time fails when it is built, and every search gives up after 366 days, plus seven days per holiday date, without working time.
How fast is it? See Benchmarks.
workclock is MIT licensed. The repository documentation is authoritative; this wiki summarises it.