huey 3.3.1


pip install huey

  Latest version

Released: Jul 31, 2026


Meta
Author: Charles Leifer

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Programming Language
  • Python :: 3

Topic
  • Software Development :: Libraries :: Python Modules
https://media.charlesleifer.com/blog/photos/huey3-logo.png

a lightweight alternative.

huey is:

  • a task queue

  • written in python

  • clean and simple API

huey has:

  • support for redis (or valkey/redict), postgres, sqlite, file-system, or in-memory storage

  • zero dependencies (redis-py required to use redis-like brokers, psycopg for postgres).

  • example code.

  • django integration (native or via django.tasks) with admin integration for visibility and management.

  • documentation.

huey supports:

  • multi-process, multi-thread or greenlet task execution models

  • schedule tasks to execute at a given time, or after a given delay

  • schedule recurring tasks, like a crontab

  • automatically retry tasks that fail

  • task prioritization

  • task result storage

  • task expiration

  • task locking, rate-limits and timeouts

  • task pipelines and chains

  • groups (fan-out), chords (map / reduce)

https://i.imgur.com/2EpRs.jpg

At a glance

from huey import RedisHuey, crontab

# Or PostgresHuey, SqliteHuey, FileHuey, etc...
huey = RedisHuey('my-app', host='redis.myapp.com')

@huey.task()
def add_numbers(a, b):
    return a + b

@huey.task(retries=2, retry_delay=60)
def flaky_task(url):
    # This task might fail, in which case it will be retried up to 2 times
    # with a delay of 60s between retries.
    return this_might_fail(url)

@huey.periodic_task(crontab(minute='0', hour='3'))
def nightly_backup():
    sync_all_data()

Calling a task-decorated function will enqueue the function call for execution by the consumer. A special result handle is returned immediately, which can be used to fetch the result once the task is finished:

>>> from demo import add_numbers
>>> res = add_numbers(1, 2)
>>> res
<Result: task 6b6f36fc-da0d-4069-b46c-c0d4ccff1df6>

>>> res()
3

Tasks can be scheduled to run in the future:

>>> res = add_numbers.schedule((2, 3), delay=10)  # Will be run in ~10s.
>>> res(blocking=True)  # Will block until task finishes, in ~10s.
5

For much more, check out the guide or take a look at the example code.

Running the consumer

Run the consumer with four worker processes:

$ huey_consumer my_app.huey -k process -w 4

To run the consumer with a single worker thread (default):

$ huey_consumer my_app.huey

If your work-loads are mostly IO-bound, you can run the consumer with threads or greenlets instead. Because greenlets are so lightweight, you can run quite a few of them efficiently:

$ huey_consumer my_app.huey -k greenlet -w 32

Storage

Huey’s design and feature-set were informed by the capabilities of the Redis database. Redis is a fantastic fit for a lightweight task queueing library like Huey: it’s self-contained, versatile, and can be a multi-purpose solution for other web-application tasks like caching, event publishing, analytics, rate-limiting, and more.

Although Huey was designed with Redis in mind, the storage system implements a simple API and many other tools could be used instead of Redis if that’s your preference.

Huey comes with builtin support for Redis, Postgres, Sqlite, File-system, and in-memory storage.

Frameworks

Huey provides Django integration either natively or via django.tasks. Huey also provides an optional admin integration for Django:

https://huey.readthedocs.io/en/latest/_images/django-admin.png

Huey also provides flask-peewee admin integration based on the same underlying stat-tracking system:

https://huey.readthedocs.io/en/latest/_images/flask-admin-panel.png

Other frameworks can use the stats extension to collect and display this information.

Documentation

See Huey documentation.

Project page

See source code and issue tracker on Github.

Huey is named in honor of my cat:

https://m.charlesleifer.com/t/800x-/blog/photos/p1473037658.76.jpg?key=mD9_qMaKBAuGPi95KzXYqg
3.3.1 Jul 31, 2026
3.3.0 Jul 22, 2026
3.2.1 Jul 09, 2026
3.2.0 Jul 09, 2026
3.1.1 Jul 02, 2026
3.1.0 Jul 02, 2026
3.0.3 Jun 12, 2026
3.0.2 Jun 11, 2026
3.0.1 May 14, 2026
3.0.0 Apr 14, 2026
2.6.0 Jan 06, 2026
2.5.5 Dec 05, 2025
2.5.4 Oct 23, 2025
2.5.3 Mar 19, 2025
2.5.2 Sep 25, 2024
2.5.1 Jun 07, 2024
2.5.0 Sep 20, 2023
2.4.5 Feb 09, 2023
2.4.4 Oct 21, 2022
2.4.3 Dec 28, 2021
2.4.2 Nov 28, 2021
2.4.1 Sep 16, 2021
2.4.0 Aug 10, 2021
2.3.2 Apr 20, 2021
2.3.1 Mar 04, 2021
2.3.0 Aug 10, 2020
2.2.0 Feb 23, 2020
2.1.3 Oct 16, 2019
2.1.2 Sep 04, 2019
2.1.1 Aug 07, 2019
2.1.0 Jun 06, 2019
2.0.1 Apr 03, 2019
2.0.0 Apr 01, 2019
1.11.0 Feb 16, 2019
1.10.5 Dec 19, 2018
1.10.4 Nov 14, 2018
1.10.3 Oct 09, 2018
1.10.2 Aug 14, 2018
1.10.1 Jul 24, 2018
1.10.0 May 30, 2018
1.9.1 Apr 04, 2018
1.9.0 Mar 12, 2018
1.8.0 Mar 09, 2018
1.7.0 Feb 07, 2018
1.6.1 Jan 25, 2018
1.6.0 Jan 12, 2018
1.5.6 Dec 10, 2017
1.5.5 Nov 02, 2017
1.5.4 Oct 23, 2017
1.5.3 Oct 22, 2017
1.5.2 Oct 16, 2017
1.5.1 Oct 08, 2017
1.5.0 Oct 05, 2017
1.4.1 Sep 08, 2017
1.4.0 Aug 01, 2017
1.3.1 May 09, 2017
1.3.0 Apr 13, 2017
1.2.3 Feb 17, 2017
1.2.2 Oct 17, 2016
1.2.1 Oct 02, 2016
1.2.0 Jul 21, 2016
1.1.2 May 04, 2016
1.1.1 Mar 10, 2016
1.1.0 Jan 21, 2016
1.0.0 Jan 06, 2016
0.4.9 Sep 26, 2015
0.4.8 May 11, 2015
0.4.7 Feb 05, 2015
0.4.6 Feb 05, 2015
0.4.5 Feb 05, 2015
0.4.3 Sep 04, 2014
0.4.2 Mar 13, 2014
0.4.1 Jun 05, 2013
0.4.0 May 09, 2013
0.3.2 Dec 01, 2012
0.3.1 Nov 28, 2012
0.3.0 Nov 27, 2012
0.2.2 Aug 21, 2012
0.2.1 Apr 06, 2012
0.2.0 Jan 28, 2012
0.1.1 Jan 07, 2012
0.1.0 Jan 04, 2012

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies: