A very simple Celery Beat Scheduler that stores status information in a MongoDB database.
# Install
```
pip install celerybeatmongo
```
# Details
This project provides a Celery Beat Scheduler that uses MongoDB to store the schedule stats (last run, run count, etc.). This is safer than using a file on your server which could be cleared or corrupted (on Heroku for example). This scheduler aims to replace the default Beat Scheduler provided with Celery. There are a few caveats though:
* Only supports interval scheduling (currently, easy to add support for Crontab and Solar)
* Can only pass native JSON types (dict, list, str, number) to `kwargs`, `args`, and `options` for tasks
## Motivation
I started this project because I run Celerybeat on Heroku and I started noticing that tasks were being dropped. This was because the default Celerybeat Scheduler (`[celery.beat.PersistentScheduler](http://docs.celeryproject.org/en/latest/reference/celery.beat.html#celery.beat.PersistentScheduler)`) uses a shelve database file that it adds the current directory. In Heroku this file was cleared and so the schedule data was not saved reliably. With the `celerybeatmongo.MongoPersistentScheduler` this is not an issue anymore.
# Example
Please see `examples/celery_worker.py` for a simple example to just try it out.
Running the example requires MongoDB and Redis (you can edit it to use another Broker instead if Redis if you want).
* [Install Redis](https://redis.io/topics/quickstart)
* [Install MongoDB](https://docs.mongodb.com/manual/installation/)
You can run the following to start the example:
1. In a seperate terminal window, start Redis:
```shell
$ redis-server # start redis
```
2. In a seperate terminal window, start MongoDB:
```shell
$ mongod
```
3. Then start the example worker:
```shell
$ pip install redis
$ python examples/celery_worker.py
```
# Contribute
Please add issues or put up pull requests if you need more functionality or have suggestions. Its a new project and should be easy to contribute to!
Metadata
Release files for celerybeatmongo 0.1.2
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 |
|---|---|---|---|---|
| celerybeatmongo-0.1.2.tar.gz | 5.3 kB | Without provenance | Details for celerybeatmongo-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| celerybeatmongo-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for celerybeatmongo-0.1.2-py3-none-any.whl |
Total release size: 12.4 kB
Release files / celerybeatmongo-0.1.2.tar.gz
| Download URL | celerybeatmongo-0.1.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb8bd09c208d9cff4a27f09a79fdeecdf09d4fc0cdd885155137715d9b22e765
|
|
BLAKE2b-256 checksum How to use checksums |
a51775160346bbbd08639bd84df997a5f32c1f48a453cefa6191fdef15e42642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / celerybeatmongo-0.1.2-py3-none-any.whl
| Download URL | celerybeatmongo-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b93ff8ca0560c350ba9e0355ca7f76108edad6f1db3c00079f6b6c1e01f17d4f
|
|
BLAKE2b-256 checksum How to use checksums |
e47a7b1952942b345b23f293d18b72df8619fb87373cfda1532227de0424596e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for celerybeatmongo 0.1.2
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.