PrioHeap
A priority queue from the textbooks. Python implementation is surprinsigly not modern.
Installation
pip3 install prioheap
Usage
The API is dead simple:
import prioheap
prio = prioheap.PrioHeap()
prio.add(0) # add element
prio.add(3)
prio.peak() # return highest element, e.g. 3
prio.add(1)
prio.pop() # remove and return highest element, 3.
len(prio), bool(prio) # those are supported
iter(prio), list(prio) # iterate elements in decreasing order
Test
To run the unit tests from the root of this repository:
python3 -m tests
License
License is Unlincense, so public domain.
Metadata
Release files for prioheap 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prioheap-0.0.2.tar.gz | 2.5 kB | Without provenance | Details for prioheap-0.0.2.tar.gz |
Release files / prioheap-0.0.2.tar.gz
| Download URL | prioheap-0.0.2.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01a18fdc0e8c578d0e8fa2317ab20df080d9325822d9596a843eaca56295904c
|
|
BLAKE2b-256 checksum How to use checksums |
0e11914a350c8db6380c8d44073870f834a599df3742316c68ecc0964864a9bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Security for prioheap 0.0.2
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.