Skip to main content

aqueue is an async task queue with live progress display.

You put items (tasks) in, and they get processed, possibly creating more items which get processed, and so on, until all items are completed. A typical use case would be to scrape a website.

Meanwhile, a nice visualization of the queue’s goings-on is displayed in the terminal.

Demonstration of aqueue

Installation

aqueue is a Python package hosted on PyPI. The recommended installation method is pip-installing into a virtual environment:

pip install aqueue

Getting Started

There’s two things you need to do to use aqueue:

  1. Implement your Item subclasses.

  2. Start your queue with one of those items.

Example

If you had a hierarchy of items like this…

Simple item hierarchy with one root item and many children items stemming from it.

Then, you might process it with aqueue like this…

import aqueue


class RootItem(aqueue.Item):
   async def process(self) -> aqueue.ProcessRetVal:
      # display what we're doing in the worker status panel
      self.set_worker_desc("Processing RootItem")

      # make an HTTP request, parse it, etc
      ...

      # when you discover more items you want to process, enqueue them by yield-ing
      # them:
      for _ in range(3):
            yield ChildItem()

   async def after_children_processed(self) -> None:
      # run this method when this Item and all other Items it enqueued are done
      print("All done!")


class ChildItem(aqueue.Item):

   # track the enqueueing and completion of these items in the overall panel
   track_overall: bool = True

   async def process(self) -> aqueue.ProcessRetVal:
      self.set_worker_desc("Processing ChildItem")
      # this child item has no further children to enqueue, so it doesn't yield
      # anything


if __name__ == "__main__":
   aqueue.run_queue(
      initial_items=[RootItem()],
      num_workers=2,
   )

Project Information

Metadata

Release files for aqueue 0.9.3

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

Source distribution (sdist)

Source distribution for aqueue 0.9.3
File Size Uploaded Provenance Actions
aqueue-0.9.3.tar.gz 11.3 kB Without provenance Details for aqueue-0.9.3.tar.gz

Built distribution (wheel)

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

Total release size: 23.1 kB

Release files / aqueue-0.9.3.tar.gz

Download URL aqueue-0.9.3.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b9c2bc82d81ff0bbcb859c1b81a63a4ef3ef5e2e3d148efc9f1f273b58d22d63
BLAKE2b-256 checksum
How to use checksums
775d24a636c6327f79d2a95cfe9e945e03481b2f287107af2063a32708c0ab57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.12.3 Linux/6.8.0-1017-azure

Release files / aqueue-0.9.3-py3-none-any.whl

Download URL aqueue-0.9.3-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6bde6e3cf1ce766c81697d26adbc0ea472918aed126cd91798d9ffd0a47fe44
BLAKE2b-256 checksum
How to use checksums
5bccc62b8bcc337e09a3c4bfbced9c045c91f74305209dfc788158fea7ec4110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.12.3 Linux/6.8.0-1017-azure

Security for aqueue 0.9.3

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.

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