Skip to main content

Priority queue with a sane API

Project description


test badge

A priority queue from the textbooks. Python implementation is surprinsigly not modern.


pip3 install prioheap


The API is dead simple:

import prioheap

prio = prioheap.PrioHeap()
prio.add(0) # add element
prio.peak()  # return highest element, e.g. 3
prio.pop()  # remove and return highest element, 3.

len(prio), bool(prio)  # those are supported
iter(prio), list(prio)  # iterate elements in decreasing order


To run the unit tests from the root of this repository:

python3 -m tests


License is Unlincense, so public domain.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prioheap-0.0.2.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page