Skip to main content

A Pythonic indexed priority queue.

Project description

A priority queue dictionary maps hashable objects (keys) to priority-determining values. It provides a hybrid dictionary/priority queue API.

CI Documentation Status https://img.shields.io/pypi/v/pqdict.svg

The priority queue itself is implemented as a binary heap of (key, priority value) elements, which supports:

  • O(1) search for the item with highest priority

  • O(log n) removal of the item with highest priority

  • O(log n) insertion of a new item

Additionally, an index maps each key to its element’s location in the heap and is kept up to date as the heap is manipulated. As a result, pqdict also supports:

  • O(1) lookup of any item by key

  • O(log n) removal of any item

  • O(log n) updating of any item’s priority level

Documentation

Documentation is available at http://pqdict.readthedocs.org/.

License

This module is released under the MIT license. The augmented heap implementation was adapted from the heapq module in the Python standard library, which was written by Kevin O’Connor and augmented by Tim Peters and Raymond Hettinger.

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

pqdict-1.4.1.tar.gz (164.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pqdict-1.4.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file pqdict-1.4.1.tar.gz.

File metadata

  • Download URL: pqdict-1.4.1.tar.gz
  • Upload date:
  • Size: 164.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pqdict-1.4.1.tar.gz
Algorithm Hash digest
SHA256 37b2711fea2e33952a664a447e7a9a0a45eb66d29243dfd22480c854d90c586b
MD5 42fdb7498bb75ceec2e30fa2da070d20
BLAKE2b-256 cbe1027807d870884da9296345606c5020e5edf111416a53455346fff695fa01

See more details on using hashes here.

Provenance

The following attestation bundles were made for pqdict-1.4.1.tar.gz:

Publisher: publish.yml on nvictus/pqdict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pqdict-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: pqdict-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pqdict-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 215223e41d3b5a45d8b38e4a43c0be3b641d5193c84576208b46d9e77e8edc75
MD5 6ade39f187ccfeb0cf9c0f62c393f4b8
BLAKE2b-256 059bd9a0ed5bda0552530ec2e0760499b48a413399fa94ce9c209524d7dc4faf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pqdict-1.4.1-py3-none-any.whl:

Publisher: publish.yml on nvictus/pqdict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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