• Stars
    star
    117
  • Rank 300,025 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PostgreSQL-based Task Queue for Python

Procrastinate: PostgreSQL-based Task Queue for Python

Deployed to PyPI Deployed to PyPI GitHub Repository Continuous Integration Documentation Coverage MIT License Contributor Covenant

Procrastinate is looking for additional maintainers!

Procrastinate is an open-source Python 3.7+ distributed task processing library, leveraging PostgreSQL to store task definitions, manage locks and dispatch tasks. It can be used within both sync and async code and integrated to Django.

In other words, from your main code, you call specific functions (tasks) in a special way and instead of being run on the spot, they're scheduled to be run elsewhere, now or in the future.

Here's an example (if you want to run the code yourself, head to Quickstart):

# mycode.py
import procrastinate

# Make an app in your code
app = procrastinate.App(connector=procrastinate.AiopgConnector())

# Then define tasks
@app.task(queue="sums")
def sum(a, b):
    with open("myfile", "w") as f:
        f.write(str(a + b))

with app.open():
    # Launch a job
    sum.defer(a=3, b=5)

    # Somewhere in your program, run a worker (actually, it's often a
    # different program than the one deferring jobs for execution)
    app.run_worker(queues=["sums"])

The worker will run the job, which will create a text file named myfile with the result of the sum 3 + 5 (that's 8).

Similarly, from the command line:

export PROCRASTINATE_APP="mycode.app"

# Launch a job
procrastinate defer mycode.sum '{"a": 3, "b": 5}'

# Run a worker
procrastinate worker -q sums

Lastly, you can use Procrastinate asynchronously too:

import asyncio

import procrastinate

# Make an app in your code
app = procrastinate.App(connector=procrastinate.AiopgConnector())

# Define tasks using coroutine functions
@app.task(queue="sums")
async def sum(a, b):
    await asyncio.sleep(a + b)

async with app.open_async():
    # Launch a job
    await sum.defer_async(a=3, b=5)

    # Somewhere in your program, run a worker (actually, it's often a
    # different program than the one deferring jobs for execution)
    await app.run_worker_async(queues=["sums"])

There are quite a few interesting features that Procrastinate adds to the mix. You can head to the Quickstart section for a general tour or to the How-To sections for specific features. The Discussion section should hopefully answer your questions. Otherwise, feel free to open an issue.

The project is still quite early-stage and will probably evolve.

Note to my future self: add a quick note here on why this project is named "Procrastinate".

Where to go from here

The complete docs is probably the best place to learn about the project.

If you encounter a bug, or want to get in touch, you're always welcome to open a ticket.

More Repositories

1

django-chartjs

Django Class Based Views to generate Ajax charts js parameters.
JavaScript
405
star
2

django-chunkator

Chunk large QuerySets into small chunks, and iterate over them without killing your RAM.
Python
110
star
3

django-ltree-demo

A demo for storing and querying trees in Django using PostgreSQL
Python
89
star
4

mlvtools-tutorial

Tutorial for a new versioning Machine Learning pipeline
JavaScript
80
star
5

vault-cli

A configurable command-line interface tool (and python library) to interact with Hashicorp Vault
Python
79
star
6

django-mail-factory

Django Mail Manager
Python
72
star
7

django-generic-filters

Easy filters for your Django Generic ListView.
Python
51
star
8

swagman

Convert PostMan Collection Report to Swagger file
Python
49
star
9

mlvtools

Public repository for versioning machine learning data
Python
43
star
10

pylogctx

🐍 Inject extra fields to each log records
Python
25
star
11

django-docusign

Integration of DocuSign's SaaS signature platform with Django
Python
25
star
12

django-anysign

Generic online signature for Django
Python
22
star
13

django-readonly-field

Make Django model fields readonly
Python
21
star
14

django-x509

How to enable x509 authentication with your Django App
Python
21
star
15

django-formidable

On the way to glory! again!
Python
20
star
16

django-agnocomplete

A front-end agnostic toolbox for autocompletion fields
Python
19
star
17

pydocusign

Python client for DocuSign signature API
Python
18
star
18

django-aggtrigg

Automatic aggregation db triggers for django
Python
17
star
19

django-saml2-idp

Authenticate users for your Django web app against a SAML 2.0 Identity Provider.
Python
14
star
20

django-highcharts

**WARNING: UNMAINTAINED SINCE SEPT 2016** Generate charts in you Django application using Highcharts helpers
JavaScript
12
star
21

ember-cli-embedded

Control how your Ember applications boot in non-Ember pages/apps.
TypeScript
11
star
22

septentrion

Python CLI tool for managing and executing hand-written PostgreSQL migrations
Python
9
star
23

django-north

Django library for managing and executing hand-written PostgreSQL migrations
Python
9
star
24

django-sql-log

Django SQL Log
Python
8
star
25

populous

populate your database with god-like powers
Python
8
star
26

dragndoc

UI widget to split and order document pages into sub documents
JavaScript
8
star
27

django-email-change

django-email-change adds support for email address change and confirmation.
Python
8
star
28

layout-linter

lint your HTML based on your own custom rules
JavaScript
8
star
29

jenkins-yml

Define job in project as YML
Python
7
star
30

django-plainpasswordhasher

UNMAINTAINED SINCE SEP 2016 !!!!!! Was: Dummy (plain text) password hashing for Django... for use in tests!
Python
7
star
31

django-compose-settings

Django composable settings loader.
Python
6
star
32

jenkins-epo

🚦 Increase Jenkins features with GitHub integration
Python
6
star
33

ansible-role-jenkins-node

Provision a Jenkins SSH slave
5
star
34

django-pimpmytheme

load specific css or template depending on a model you define
Python
5
star
35

pg-magicplan

Improve planning of EXISTS in PostgreSQL subquery
C
5
star
36

django-adobesign

AdobeSign backend for django-anysign
Python
5
star
37

multipart-reader

Multipart/* reader extracted from awsome `aiohttp` project, cf.: http://aiohttp.readthedocs.org/en/stable/multipart.html.
Python
5
star
38

mock-services

Mock services
Python
5
star
39

lxdapi

Little library for learning http transactions with lxd
Python
4
star
40

crappyspider

Python
4
star
41

django-ticketoffice

One-shot authentication utilities for Django
Python
4
star
42

ember-simple-select

A simple select component for your Ember 2.0+ applications
JavaScript
4
star
43

ansible-role-boot

Ansible role to boot .lxc hosts in an inventory, Vagrantfile provided in novafloss/ansible-setup
4
star
44

slonik

Postgresql driver for python, in rust
Python
3
star
45

ansible-role-jenkins-api

Install jenkins-python + include ansible binding module
Python
3
star
46

OPE

One Page for Equity
HTML
3
star
47

django-json-dbindex

Describe your database index in json files into your apps
Python
3
star
48

ember-auto-import-chunks-json-generator

Ember.js addon to generate chunks.json file, based on ember-auto-import code splitting logic.
JavaScript
3
star
49

ember-feature-controls

Hot plug your features.
JavaScript
3
star
50

django-MacFly

Output sql migrations for ahead of time schema changes.
Python
3
star
51

django-templates-forest

Django commands to help you inspect your templates' structure
Python
3
star
52

bag8

Cli to orchestrate docker images and containers the easy way.
Python
3
star
53

python-pussycache

Cache Backend system for python objects
Python
3
star
54

django-saml2-sp

UNMAINTAINED SINCE SEPT. 30 2016 Authenticate users for your Django web app against a SAML 2.0 Identity Provider.
Python
3
star
55

ember-metrics-pendo

Ember-metrics-pendo allows to configure the Pendo service in your ember project using ember-metrics.
JavaScript
2
star
56

rate-limit-scheduler

Consume APIs with respect to their rate limits
TypeScript
2
star
57

jenkins-formula

Salt formula for jenkins master-slave installation
Python
2
star
58

ansible-ssh-agent

Role to ensure an SSH agent is ready
2
star
59

django-esutils

Django ES Utils
Python
2
star
60

django-i18nurl

Django i18n url lets you manage your multilingual url using Django.
Python
2
star
61

retry-formula

Poutre your netwerk
Python
2
star
62

check_po

Check if the po is fully translated without any fuzzy in it
Python
2
star
63

insight-installer

Chef cookbooks to run the provisionning of your insight-reloaded server.
Ruby
2
star
64

saltpad

A gui and cli to manage saltstack deployments
JavaScript
1
star
65

github-repo-control

Easily configure your Github repositories in command-line
JavaScript
1
star
66

people-slides

BBL slides
CSS
1
star
67

novapost.cookbot

Contextual execution manager
Python
1
star
68

ember-web-component-container

Wraps your Ember Application into a CustomElement for better portability
JavaScript
1
star
69

insight

**DEPRECTATED** API REST to asynchronously generate document thumbnails
Python
1
star
70

perfo

CI Performance analysis tool
JavaScript
1
star
71

django-navigator

Let you navigate between object DetailView from a ListView or a SearchView.
Python
1
star
72

eslint-config-peopledoc

ESLint config for PeopleDoc frontend projects
JavaScript
1
star
73

django-postgres-hot-upgrade

Django app that resets django.contrib.postgres caches that store postgres extensions OIDs
Python
1
star
74

broccoli-styledown

Broccoli plugin for creating styledown html from css markup
JavaScript
1
star
75

connemara

PostgreSQL replication tool to merge multiple database in a single one
Python
1
star
76

ansible-role-oracle-java

Install oracle java
Python
1
star
77

insight-reloaded

**DEPRECTATED** A full async docsplit previewer server based on Tornado and Redis
Python
1
star
78

ansible-boot-lxd

Ansible role to boot LXD containers
1
star
79

novabeacon

PUBSUB interface for beacon plug on ARDUINOS
Python
1
star
80

pg_schema_north

PostgreSQL schema deployΓΉent tool for DDL and DML
PLpgSQL
1
star
81

ember-reading-time

Medium-like reading time estimation for EmberJS.
JavaScript
1
star