z4j-apscheduler
The native APScheduler adapter for z4j, with dashboard management
of native jobs. Dashboard management needs the z4j server, z4j-core, z4j-bare
and this adapter from the same release, plus the producer setup below.
Compatibility
APScheduler 3.10.2+; Python 3.11+. APScheduler 4 uses a different API; pin apscheduler<4 in the host application.
Installation and producer setup
Install z4j-apscheduler and z4j-bare from the same release wave, plus the native
scheduler and broker/store dependencies used by your application. The example
assumes your task code, writable application-state directory and agent credentials
already exist. Use the project UUID from agent registration.
import os
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from z4j_apscheduler import APSchedulerAdapter
from z4j_bare import install_agent
from myapp.jobs import cleanup
scheduler = BackgroundScheduler(
timezone="UTC",
jobstores={"default": SQLAlchemyJobStore(url="sqlite:////var/lib/myapp/jobs.sqlite3")},
)
scheduler.start()
adapter = APSchedulerAdapter(scheduler=scheduler, tasks={"myapp.cleanup": cleanup})
agent = install_agent(
engines=[], schedulers=[adapter],
brain_url=os.environ["Z4J_BRAIN_URL"], token=os.environ["Z4J_TOKEN"],
hmac_secret=os.environ["Z4J_HMAC_SECRET"], project_id=os.environ["Z4J_PROJECT_ID"],
)
# Keep the application alive; on shutdown call agent.stop() and scheduler.shutdown().
Install SQLAlchemy separately for this example. Bind the adapter to the running
scheduler in the process that actually dispatches jobs. AsyncIOScheduler
operations are marshalled onto its owning event loop. The default jobstore is
managed; select another using jobstore="name". Configure one adapter/producer
for the selected project and owner. Do not share an APScheduler 3 jobstore
between scheduler processes.
Definitions and pause state live in the selected native jobstore. An in-memory jobstore is deliberately not restart-persistent; use a persistent store when that is required. The live qualification uses SQLAlchemy with SQLite. Other APScheduler 3 jobstores use the same APIs but are not all deployment-qualified.
Dashboard controls
The connected producer supports inventory, create, edit, pause, resume, delete and Run now. A write is complete only after z4j accepts a snapshot confirming the native source. The dashboard uses the current connection's advertised capabilities; an unavailable producer cannot accept new edits. Repeating an operation ID does not submit it twice. A timeout or uncertain outcome requires inspection before submitting a new request.
A pause prevents future scheduling. Work already queued or running can finish. Run now submits an additional execution without resuming a paused schedule. Native scheduling keeps the upstream scheduler's timing and delivery semantics; it does not acquire z4j-scheduler's catch-up, overlap or exactly-once guarantees. Queue task history requires the corresponding engine adapter in the workers.
Supported definitions and limits
- Create/edit supports five-field cron, positive intervals in seconds, and offset-aware one-shot datetimes.
- Numeric cron weekdays use Monday=0 through Sunday=6, following APScheduler.
- Existing advanced CronTrigger settings are preserved when editing other fields.
- Existing jobs supply their callable;
tasks={name: callable}registers additional safe dashboard choices. Job IDs cannot be renamed through an edit. - Run now submits through the native executor and preserves the original next run and pause state.
- Queue overrides are unavailable; the selected native executor runs the callable.
Links
- Documentation
- Changelog
- Security policy; report vulnerabilities to security@z4j.com
- Apache-2.0 license
Metadata
Release files for z4j-apscheduler 1.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| z4j_apscheduler-1.13.0.tar.gz | 29.5 kB | Without provenance | Details for z4j_apscheduler-1.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| z4j_apscheduler-1.13.0-py3-none-any.whl | Python 3 | none | any | Details for z4j_apscheduler-1.13.0-py3-none-any.whl |
Total release size: 52.4 kB
Release files / z4j_apscheduler-1.13.0.tar.gz
| Download URL | z4j_apscheduler-1.13.0.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ab95850b801a40dd3f0d0fe3785022a9afd3dbf0cadc27972b597141a4e9dff
|
|
BLAKE2b-256 checksum How to use checksums |
49238a9e6a4da5d41f41ba9e91991207fbdefd6140a3b063003496233d561aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / z4j_apscheduler-1.13.0-py3-none-any.whl
| Download URL | z4j_apscheduler-1.13.0-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5dc8176696d5be646d02cff8f6106d989cec2ee64da5ef877c7c1dc7f358956
|
|
BLAKE2b-256 checksum How to use checksums |
f84ba30e0d3b3e703f8c9ba966d9270cb425bd793fd9bab8aa2a34e8d3b6e46a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for z4j-apscheduler 1.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.