beatdrop


Namebeatdrop JSON
Version 0.1.0a9 PyPI version JSON
download
home_pagehttps://github.com/btemplep/beatdrop
SummarySimplified, scalable task scheduling with typechecking.
upload_time2024-02-20 01:49:32
maintainer
docs_urlNone
authorBrandon Temple Paul
requires_python
licenseMIT
keywords celery beat beatdrop queue redis rq schedule scheduler sql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # `beatdrop`

![](https://github.com/btemplep/beatdrop/raw/main/docs/_static/beatdrop_logo.svg)

See the full [Documentation](https://docs.pythonbeatdrop.com/).

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](https://pypi.org/project/beatdrop/).

```text
$ pip install beatdrop
```

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

```text
$ 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.

```text
$ 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:

```python
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:

```python
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](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- 
## [Unreleased] - YYYY-MM-DD

### Added

### Changed

### Deprecated

### Removed

### Fixed

### Security 
-->

## [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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/btemplep/beatdrop",
    "name": "beatdrop",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "celery,beat,beatdrop,queue,redis,rq,schedule,scheduler,sql",
    "author": "Brandon Temple Paul",
    "author_email": "btemplepgit@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/08/be/063652bf36bfe4761eb101393714f1456c000408810e73ac843f846340af/beatdrop-0.1.0a9.tar.gz",
    "platform": null,
    "description": "# `beatdrop`\n\n![](https://github.com/btemplep/beatdrop/raw/main/docs/_static/beatdrop_logo.svg)\n\nSee the full [Documentation](https://docs.pythonbeatdrop.com/).\n\nThe goal of `beatdrop` is to provide schedulers and schedule entries that are easy to use, extensible, scalable, and backend agnostic. \n\nIt **does not** run tasks or python functions on a schedule. It will simply interface with task backends to send tasks when they are due.\n\n\n## Installation\n\nInstall the base package with pip from [PyPi](https://pypi.org/project/beatdrop/).\n\n```text\n$ pip install beatdrop\n```\n\nFor particular schedulers and backends you will also need to install their extra dependencies.\n\n```text\n$ pip install beatdrop[redis]\n```\n\nExtra dependencies for task backends:\n\n- `celery` \n\nExtra dependencies for scheduler storage:\n\n- `redis`\n\n- `sql`\n\nThe `all` extra dependency will install all extra dependencies for task backends and scheduler storage.\n\n```text\n$ pip install beatdrop[all]\n```\n\n## Usage\n\nThere are 2 main pieces to using ``beatdrop``.\n\n- Schedule Entry - holds the task definitions and scheduling info.\n\n- Schedulers - have 2 main roles \n    - They can be run as a scheduler to monitor and send tasks to the task backend.\n    - Act as clients for reading and writing schedule entries.\n\nTo run the scheduler simply make a python file, create the scheduler and call the run method:\n\n```python\nfrom beatdrop import CeleryRedisScheduler\n\nfrom my_app import celery_app\n\n\nsched = CeleryRedisScheduler(\n    max_interval=60,\n    celery_app=celery_app,\n    lock_timeout=180,\n    redis_py_kwargs={\n        \"host\": \"my.redis.host\",\n        \"port\": 6379,\n        \"db\": 0,\n        \"password\": \"mys3cr3t\"\n    }\n)\nsched.run()\n```\n\n\nTo use the scheduler as a client, you create the scheduler the same as you would to run it:\n\n```python\nfrom beatdrop import CeleryRedisScheduler, IntervalEntry\n\nfrom my_app import celery_app\n\n\n# Create a scheduler\nsched = CeleryRedisScheduler(\n    max_interval=60,\n    celery_app=celery_app,\n    lock_timeout=180,\n    redis_py_kwargs={\n        \"host\": \"my.redis.host\",\n        \"port\": 6379,\n        \"db\": 0,\n        \"password\": \"mys3cr3t\"\n    }\n)\n# create a schedule entry\ninter = IntervalEntry(\n    key=\"my-interval-entry\",\n    enabled=True,\n    task=\"test_task\",\n    args=(\"my_args\", 123),\n    kwargs={\n        \"my_kwargs\": 12.4\n    },\n    period=10\n)\n\n# save or update an entry \nsched.save(inter)\n# list all entries, this will automatically paginate\nschedule_entries = sched.list()\n# retrieve a specific entry\nmy_inter_entry = sched.get(inter.key)\n# equivalent to the line above\nmy_inter_entry = sched.get(\"my-interval-entry\")\n# Delete an entry from the scheduler\nsched.delete(inter)\n```\n\n# Changelog\n\nChangelog for `beatdrop`.\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n<!-- \n## [Unreleased] - YYYY-MM-DD\n\n### Added\n\n### Changed\n\n### Deprecated\n\n### Removed\n\n### Fixed\n\n### Security \n-->\n\n## [0.1.0a9] - 2024-02-19\n\nFix README\n\n## [0.1.0a8] - 2024-02-19\n\n### Fixed\n- pydantic less than 2\n- deprecations for use of `datetime.datetime.utcnow()`\n\n### Removed\n- support for python 3.7\n\n\n## [0.1.0a7] - 2023-02-25\n\n### Fixed\n- tests \n- docs\n\n\n## [0.1.0a6] - 2023-02-22\n\n### Added\n\n- `RQScheduler` - Building block scheduler for the RQ (Redis Queue) task backend.\n- `RQRedisScheduler` - Complete scheduler with RQ task backend and redis entry storage.\n- `RQSQLScheduler` - Complete scheduler with RQ task backend and SQL DB entry storage.\n\n### Fixed\n\n- PYPI logo\n\n## [0.1.0a5] - 2023-02-06\n\n### Fixed\n\n- packaging files\n- README Links\n\n\n## [0.1.0a4] - 2023-02-05\n\n### Fixed\n\nDocstrings updated and documentation added.\n\n\n## [0.1.0a3] - 2023-01-18\n\nUpdate for pypi formatting.\n\n\n## [0.1.0a2] - 2023-01-17\n\nUpdate for pypi formatting.\n\n\n## [0.1.0a1] - 2023-01-17\n\nInitial release\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simplified, scalable task scheduling with typechecking.",
    "version": "0.1.0a9",
    "project_urls": {
        "Homepage": "https://github.com/btemplep/beatdrop"
    },
    "split_keywords": [
        "celery",
        "beat",
        "beatdrop",
        "queue",
        "redis",
        "rq",
        "schedule",
        "scheduler",
        "sql"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5da4af814775f00ba9bf1e4893f5632132c38fd89984316f0d3f6ca375ae8d98",
                "md5": "f5c4e2790fd08282f9e1c70cf572023e",
                "sha256": "ab7211e251990ffd9aa9976b9acb38f7b30881091c1f2b075299bcd5f2589fee"
            },
            "downloads": -1,
            "filename": "beatdrop-0.1.0a9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5c4e2790fd08282f9e1c70cf572023e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 35700,
            "upload_time": "2024-02-20T01:49:31",
            "upload_time_iso_8601": "2024-02-20T01:49:31.273391Z",
            "url": "https://files.pythonhosted.org/packages/5d/a4/af814775f00ba9bf1e4893f5632132c38fd89984316f0d3f6ca375ae8d98/beatdrop-0.1.0a9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08be063652bf36bfe4761eb101393714f1456c000408810e73ac843f846340af",
                "md5": "efb4b1d1e8a2a45b82600bbf2dda0dba",
                "sha256": "7df41fb419b4ef973af7121656a887bc8dfde45f909c85acda7f6a290406fecc"
            },
            "downloads": -1,
            "filename": "beatdrop-0.1.0a9.tar.gz",
            "has_sig": false,
            "md5_digest": "efb4b1d1e8a2a45b82600bbf2dda0dba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36405,
            "upload_time": "2024-02-20T01:49:32",
            "upload_time_iso_8601": "2024-02-20T01:49:32.642667Z",
            "url": "https://files.pythonhosted.org/packages/08/be/063652bf36bfe4761eb101393714f1456c000408810e73ac843f846340af/beatdrop-0.1.0a9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 01:49:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "btemplep",
    "github_project": "beatdrop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "beatdrop"
}
        
Elapsed time: 0.18313s