Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

beatdrop

See the full Documentation.

The goal of beatdrop is to provide schedulers and schedule entries that are easy to use, extensible, scalable, and backend agnostic.

It does not run tasks or python functions on a schedule. It will simply interface with task backends to send tasks when they are due.

Installation

Install the base package with pip from PyPi.

$ pip install beatdrop

For particular schedulers and backends you will also need to install their extra dependencies.

$ pip install beatdrop[redis]

Extra dependencies for task backends:

  • celery

Extra dependencies for scheduler storage:

  • redis

  • sql

The all extra dependency will install all extra dependencies for task backends and scheduler storage.

$ pip install beatdrop[all]

Usage

There are 2 main pieces to using beatdrop.

  • Schedule Entry - holds the task definitions and scheduling info.

  • Schedulers - have 2 main roles

    • They can be run as a scheduler to monitor and send tasks to the task backend.
    • Act as clients for reading and writing schedule entries.

To run the scheduler simply make a python file, create the scheduler and call the run method:

from beatdrop import CeleryRedisScheduler

from my_app import celery_app


sched = CeleryRedisScheduler(
    max_interval=60,
    celery_app=celery_app,
    lock_timeout=180,
    redis_py_kwargs={
        "host": "my.redis.host",
        "port": 6379,
        "db": 0,
        "password": "mys3cr3t"
    }
)
sched.run()

To use the scheduler as a client, you create the scheduler the same as you would to run it:

from beatdrop import CeleryRedisScheduler, IntervalEntry

from my_app import celery_app


# Create a scheduler
sched = CeleryRedisScheduler(
    max_interval=60,
    celery_app=celery_app,
    lock_timeout=180,
    redis_py_kwargs={
        "host": "my.redis.host",
        "port": 6379,
        "db": 0,
        "password": "mys3cr3t"
    }
)
# create a schedule entry
inter = IntervalEntry(
    key="my-interval-entry",
    enabled=True,
    task="test_task",
    args=("my_args", 123),
    kwargs={
        "my_kwargs": 12.4
    },
    period=10
)

# save or update an entry 
sched.save(inter)
# list all entries, this will automatically paginate
schedule_entries = sched.list()
# retrieve a specific entry
my_inter_entry = sched.get(inter.key)
# equivalent to the line above
my_inter_entry = sched.get("my-interval-entry")
# Delete an entry from the scheduler
sched.delete(inter)

Changelog

Changelog for beatdrop. All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.1.0a9] - 2024-02-19

Fix README

[0.1.0a8] - 2024-02-19

Fixed

  • pydantic less than 2
  • deprecations for use of datetime.datetime.utcnow()

Removed

  • support for python 3.7

[0.1.0a7] - 2023-02-25

Fixed

  • tests
  • docs

[0.1.0a6] - 2023-02-22

Added

  • RQScheduler - Building block scheduler for the RQ (Redis Queue) task backend.
  • RQRedisScheduler - Complete scheduler with RQ task backend and redis entry storage.
  • RQSQLScheduler - Complete scheduler with RQ task backend and SQL DB entry storage.

Fixed

  • PYPI logo

[0.1.0a5] - 2023-02-06

Fixed

  • packaging files
  • README Links

[0.1.0a4] - 2023-02-05

Fixed

Docstrings updated and documentation added.

[0.1.0a3] - 2023-01-18

Update for pypi formatting.

[0.1.0a2] - 2023-01-17

Update for pypi formatting.

[0.1.0a1] - 2023-01-17

Initial release

Release files for beatdrop 0.1.0a9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beatdrop 0.1.0a9
File Size Uploaded
beatdrop-0.1.0a9.tar.gz 36.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beatdrop 0.1.0a9
File Interpreter ABI Platform
beatdrop-0.1.0a9-py3-none-any.whl Python 3 none any Details

Total release size: 72.1 kB

Release files / beatdrop-0.1.0a9.tar.gz

Download URL beatdrop-0.1.0a9.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7df41fb419b4ef973af7121656a887bc8dfde45f909c85acda7f6a290406fecc
BLAKE2b-256 checksum
How to use checksums
08be063652bf36bfe4761eb101393714f1456c000408810e73ac843f846340af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / beatdrop-0.1.0a9-py3-none-any.whl

Download URL beatdrop-0.1.0a9-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab7211e251990ffd9aa9976b9acb38f7b30881091c1f2b075299bcd5f2589fee
BLAKE2b-256 checksum
How to use checksums
5da4af814775f00ba9bf1e4893f5632132c38fd89984316f0d3f6ca375ae8d98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page