Skip to main content

APScheduler job store backed by ZeroDB. Persistent scheduling with auto-provisioning — no Redis, no database setup.

Project description

zerodb-apscheduler

APScheduler job store backed by ZeroDB. Persistent job scheduling with auto-provisioning -- no Redis, no database setup.

PyPI License: MIT

Why zerodb-apscheduler?

SQLAlchemyJobStore RedisJobStore ZeroDBJobStore
Setup Requires a database Requires Redis Zero setup
Persistence Yes Yes Yes (cloud)
Auto-provisioning No No Yes (free, no signup)
Infrastructure Self-managed Self-managed Managed

Installation

pip install zerodb-apscheduler

Quick Start

from apscheduler.schedulers.background import BackgroundScheduler
from zerodb_apscheduler import ZeroDBJobStore

def daily_report():
    print("Generating daily report...")

scheduler = BackgroundScheduler()
scheduler.add_jobstore(ZeroDBJobStore())  # auto-provisions ZeroDB
scheduler.add_job(daily_report, 'cron', hour=6)
scheduler.start()

That's it. Jobs persist across restarts with zero infrastructure.

How It Works

  1. On first use, ZeroDBJobStore auto-provisions a free ZeroDB project
  2. Jobs are serialized and stored in a ZeroDB NoSQL table (apscheduler_jobs)
  3. get_due_jobs() queries by next_run_time for efficient scheduling
  4. Credentials are saved to ~/.zerodb/config.json for future runs

Configuration

Explicit Credentials

store = ZeroDBJobStore(
    api_key="your-api-key",
    project_id="your-project-id",
)

Environment Variables

export ZERODB_API_KEY="your-api-key"
export ZERODB_PROJECT_ID="your-project-id"

Custom Table Name

store = ZeroDBJobStore(table_name="my_scheduler_jobs")

Credential Resolution Order

  1. Constructor arguments (api_key, project_id)
  2. Environment variables (ZERODB_API_KEY, ZERODB_PROJECT_ID)
  3. Config file (~/.zerodb/config.json)
  4. Auto-provision (free, no signup required)

APScheduler Compatibility

ZeroDBJobStore implements APScheduler's BaseJobStore interface:

Method Description
add_job(job) Store a job
update_job(job) Update an existing job
remove_job(job_id) Remove a job
lookup_job(job_id) Find a specific job
get_due_jobs(now) Get jobs ready to run
get_next_run_time() Next scheduled time
get_all_jobs() List all jobs
remove_all_jobs() Clear all jobs

Examples

Interval Scheduling

scheduler.add_job(check_health, 'interval', minutes=5)

Cron Scheduling

scheduler.add_job(weekly_cleanup, 'cron', day_of_week='sun', hour=3)

Multiple Job Stores

from apscheduler.jobstores.memory import MemoryJobStore

scheduler.add_jobstore(MemoryJobStore(), 'volatile')
scheduler.add_jobstore(ZeroDBJobStore(), 'persistent')

scheduler.add_job(temp_task, 'interval', seconds=10, jobstore='volatile')
scheduler.add_job(important_task, 'cron', hour=6, jobstore='persistent')

License

MIT


Powered by ZeroDB + AINative

ZeroDB is a serverless database with auto-provisioning, vector search, and NoSQL tables. Build AI-native apps without managing infrastructure.

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

zerodb_apscheduler-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

zerodb_apscheduler-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file zerodb_apscheduler-0.1.0.tar.gz.

File metadata

  • Download URL: zerodb_apscheduler-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zerodb_apscheduler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7124c5a639c2a83759b76b41706dae9f677deae37f198f91f2349b88dd0c62b9
MD5 7e96be1449bba6a1bd3c4a6688f3db38
BLAKE2b-256 5c064da9fdf25e5ad6b0a5cc24464e04723295188e77ac3e8f08819a018a4145

See more details on using hashes here.

File details

Details for the file zerodb_apscheduler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zerodb_apscheduler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f0041a8e018cfcd38d54c471c042b87756989a16fab837f4d42fa33f1e60d2f
MD5 0da8f03c44383b985e643193343bf23e
BLAKE2b-256 6b8d34f78905c8473bcc8529d74c05c7bcfb1f76c62aecf0b489116cc5f7e0bc

See more details on using hashes here.

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