Addressable priority queue data structures
Project description
apq
apq
provides different kinds of addressable priority queue data structures
usable in any Python 3 project.
All priority queues provided by apq
are backed by a C++ binary heap
implementation. The priority queue types exposed to Python are implemented in
Cython. Type stubs are installed along with the package so that mypy can fully
check dependent code.
Priority Queue Types
KeyedPQ
- This priority queue allows lookup of entries through a string key. That means it combines an addressable priority queue with a dictionary creating astr
to item mapping (almost implementingtyping.Mapping[str, Item]
).KeyedPQ
is recommended whenever individual entries are looked up using a key.
Quickstart
Installation:
$ pip install apq
Usage:
>>> from apq import KeyedPQ
>>> pq: KeyedPQ[None] = KeyedPQ()
>>> pq.add('my_first_key', 34.0, None)
<apq.Item object at 0x7f506884bd70>
>>> pq.add('my_second_key', 36.0, None)
<apq.Item object at 0x7f506884bcb0>
>>> pq.change_value('my_second_key', 12.0)
<apq.Item object at 0x7f50663604f0>
>>> print(pq.pop())
('my_second_key', 12.0, None)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apq-0.6.2.tar.gz
(71.5 kB
view hashes)
Built Distributions
Close
Hashes for apq-0.6.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6ee6d6697d138ad43630c6d0180b00fb7eaea124173479a887ee557080aadcb |
|
MD5 | 8973836ec505df5d224252947a6f9197 |
|
BLAKE2b-256 | 3184acc9ce3ba1132fa38b6d9fcf9b05d25c91b1eaeb947963c7e54bfaaca44c |
Close
Hashes for apq-0.6.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c89b4c913ee1f2232ecc5c0be8ced35cb5033f3be54a705484293dc140ab8c7 |
|
MD5 | 7448f8b7ba1379d231eb8c410fe816f0 |
|
BLAKE2b-256 | da83b61fc80c56fa74863d94e85d6aceb6df17247eae6e78841b5e66e7ed91c6 |
Close
Hashes for apq-0.6.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ede06aa08f33c89a3f0a95aa620a4d2096efd924dca856a468aa1aff61de2e4 |
|
MD5 | d4cb45379f6dc4b25cd0ba08f2138574 |
|
BLAKE2b-256 | 0f065e7258107012177ab9256fae20f1ceac4d7d9afe55ebfe2289fa32fcdb8e |
Close
Hashes for apq-0.6.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc43ec912b87cca76ea9512c085cd2e717e817b11ab8b78881294aea5919e2a1 |
|
MD5 | e46b0c47c4ac1223b9c477a447087d07 |
|
BLAKE2b-256 | 3431ab508823772938d49131afafaa23295df9e473e7b8737e2d5eeaa2d01c2f |
Close
Hashes for apq-0.6.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31045f009f27efa4bfef307c23111346f756ccbc62f555df1daaf3f21512ea72 |
|
MD5 | 3eb91f8655bb6a08cb0333e724409d86 |
|
BLAKE2b-256 | ff5b5851f58de1852bd052315fb096fb183db4a5e9b81d6653c53e5f85913c2f |
Close
Hashes for apq-0.6.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b871e39d559a86337ef3320c98c2e40a0e9f458490f3745c5a1497a2c3eaba8 |
|
MD5 | 6007da8b872263522cce6753da6c0f0e |
|
BLAKE2b-256 | 4877072703ee8db02469a7a08f54fc25736683bea9fffbf1280d8caf37375fac |
Close
Hashes for apq-0.6.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ffd1ffc93a80a1c211a02401733f4167e0261227472a8044446dd295cde61fd |
|
MD5 | 372605ec57ec5865511ed764963dd1ef |
|
BLAKE2b-256 | be3ebd52ad7a78564ea175f1477c30acaed9fa19310ab66e400fd351d991dffd |
Close
Hashes for apq-0.6.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faf91de296e59a8fea2883de42543806f80a6a281599079ddce3551d3767596b |
|
MD5 | 5eb61caf030ac75c5bea8972c6894a59 |
|
BLAKE2b-256 | 13470fffdd7e0bd6ba0a00e755680fb75319ce0c562ab5f78ed6030dcc5d2489 |
Close
Hashes for apq-0.6.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12265096f507e8b018619452a0a6f9d24164c2261348fd653bb6beb52256291a |
|
MD5 | 7f5cd1b464de1016c3a738bf8a214ed2 |
|
BLAKE2b-256 | 3cc5af62e966dd429c1e6a478b9df528f7e710608d57dbc647390c7d58cda766 |