Skip to main content

GigQ

Lightweight SQLite Job Queue

PyPI Python Versions License Build Status

GigQ is a Python job queue backed by SQLite. It fits teams and projects that have outgrown a raw for loop with try/except, but don't want to run Redis or any other broker. Define functions, enqueue them, and run one or more workers on any machine that can reach the database file.

from gigq import task, JobQueue, Worker

@task()
def greet(name="world"):
    return f"Hello, {name}!"

queue = JobQueue("jobs.db")
greet.submit(queue, name="Alice")
Worker("jobs.db").start()

You get retries with backoff, crash recovery (stuck work is reclaimed), and queryable status and results from the same DB the workers use.

When to use GigQ

Good fit

  • Local or single-server automation, ETL, scraping batches, ML prep, or any scriptable work you want off the request path
  • A few concurrent worker threads or processes against one SQLite file
  • You are fine storing queue state in a file next to your app

Not the right tool

  • Multi-datacenter orchestration, strict global ordering, or millions of jobs per second
  • When you already run Redis/Kafka/SQS and need their ecosystem

Workflows and parent_results

Wire @task functions into a Workflow, declare dependencies, and submit once. Dependent tasks can declare a parent_results argument; GigQ injects a dict of parent job id → deserialized result so fan-out and fan-in steps can pass data without going through job parameters.

from gigq import task, JobQueue, Workflow, Worker

@task()
def source():
    return {"items": [1, 2, 3]}

@task()
def branch_a(parent_results):
    n = next(iter(parent_results.values()))["items"]
    return {"branch": "a", "len": len(n)}

@task()
def branch_b(parent_results):
    n = next(iter(parent_results.values()))["items"]
    return {"branch": "b", "len": len(n)}

@task()
def merge(parent_results):
    return {"combined": list(parent_results.values())}

queue = JobQueue("jobs.db")
wf = Workflow("fan")
s = wf.add_task(source)
a = wf.add_task(branch_a, depends_on=[s])
b = wf.add_task(branch_b, depends_on=[s])
wf.add_task(merge, depends_on=[a, b])
wf.submit_all(queue)
Worker("jobs.db").start()

Installation

pip install gigq

CLI

The gigq command uses --db (default gigq.db) and a subcommand:

Command Purpose
gigq worker Run a worker; add --concurrency N for threaded workers
gigq list List jobs; optional --status pending (etc.)
gigq status <id> --show-result Inspect a job and its result
gigq stats Aggregate counts by status
gigq submit Enqueue by import path module.function

How it works

Jobs, dependencies, and results live in SQLite tables (jobs, job_executions). Workers claim work in transactions so only one worker runs a given job at a time; multiple threads or processes coordinate through the database file (WAL mode is enabled for less contention). Retries and timeouts are enforced in the worker loop.

Examples

Example Description
examples/parallel_tasks.py Fan-out workers plus a fan-in task using parent_results
examples/data_pipeline.py Linear pipeline: generate → transform → format via parent_results
examples/hyperparameter_tuning.py scikit-learn search with sequential vs parallel workers and crash recovery

Integrations

Documentation

Full guides and API reference: https://kpouianou.github.io/GigQ/

License

This project is licensed under the MIT License — see LICENSE.

Metadata

Release files for gigq 0.5.1

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

Source distribution (sdist)

Source distribution for gigq 0.5.1
File Size Uploaded Provenance
gigq-0.5.1.tar.gz 23.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 48.7 kB

Release files / gigq-0.5.1.tar.gz

Download URL gigq-0.5.1.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e589293d4174d8b80fe14e8fa63c83da1659cc9838a5998ce5b1a0c095f89e2
BLAKE2b-256 checksum
How to use checksums
258bed64c638f5d767940e3b17e0a32d66dd2efac300b28c9fbe7a4e00f76c4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / gigq-0.5.1-py3-none-any.whl

Download URL gigq-0.5.1-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9908e96090c153cfba64a8b48d29a8ffaf452939518fe822e4f0ff13e105cca
BLAKE2b-256 checksum
How to use checksums
f619284b9ec2690e6807733b73e9062112e4b1ac612379be94f1d6d14cad70e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for gigq 0.5.1

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.

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