Skip to main content

Spinach

https://github.com/NicolasLM/spinach/workflows/Run%20tests/badge.svg?branch=master https://coveralls.io/repos/github/NicolasLM/spinach/badge.svg?branch=master https://readthedocs.org/projects/spinach/badge/?version=latest https://img.shields.io/badge/IRC-irc.libera.chat-1e72ff.svg?style=flat

Redis task queue for Python 3 heavily inspired by Celery and RQ.

Distinctive features:

  • Threaded and asyncio workers

  • At-least-once or at-most-once delivery per task

  • Periodic tasks without an additional process

  • Concurrency limits on queued jobs

  • Scheduling of tasks in batch

  • Integrations with Flask, Django, Logging, Sentry and Datadog

  • Embeddable workers for easier testing

  • See design choices for more details

Quickstart

Install Spinach with pip:

pip install spinach

Create a task and schedule a job to be executed now:

from spinach import Engine, MemoryBroker

spin = Engine(MemoryBroker())


@spin.task(name='compute')
def compute(a, b):
    print('Computed {} + {} = {}'.format(a, b, a + b))


# Schedule a job to be executed ASAP
spin.schedule(compute, 5, 3)

print('Starting workers, ^C to quit')
spin.start_workers()

Documentation

The documentation is at https://spinach.readthedocs.io.

IRC channel for online discussions #spinach on irc.libera.chat.

License

BSD 2-clause

Copyright (c) 2017-2021, Nicolas Le Manchet All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Metadata

Release files for spinach 0.0.25

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

Source distribution (sdist)

Source distribution for spinach 0.0.25
File Size Uploaded
spinach-0.0.25.tar.gz 42.1 kB Details

Built distribution (wheel)

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

Total release size: 86.0 kB

Release files / spinach-0.0.25.tar.gz

Download URL spinach-0.0.25.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
727fa4b4fbd22e34aae79d60a86d82cf48106dd7e8df64e4e74fa98d2d45585e
BLAKE2b-256 checksum
How to use checksums
8ed869d766db9890be8adc71793e8d840b02c3bc7bdd30bf5a11d5a2bd7569f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / spinach-0.0.25-py3-none-any.whl

Download URL spinach-0.0.25-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13e0730a535f16dbded708bf67e543a9ea0de948205931c4f849a6e8e3704b1c
BLAKE2b-256 checksum
How to use checksums
4e381af9d7bcd50688ccb513c056117dcc6e7c825c70c5437cd52cf283be2deb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.0.25 This release

2 release files

0.0.24

2 release files

0.0.20

2 release files

0.0.17

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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