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.5.1.tar.gz (187.0 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.5.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pqdict-1.5.1.tar.gz
Algorithm Hash digest
SHA256 320958d5762c5b46cfd3e59ea5f063aa2a05e72d1d8b56ea71c66112f4706aeb
MD5 e52df2de29518f10a08e91e9dec2a263
BLAKE2b-256 4cd29927bdffa2f1f65875703ea5fc178929c96fbd83064ed0c816af11cd4759

See more details on using hashes here.

Provenance

The following attestation bundles were made for pqdict-1.5.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.5.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pqdict-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d0fa0b2819801722d5356b88ceee1793d3333a9e15552285951b143ea546a31
MD5 c3680c78a3537eb292e6bdc6d2dac127
BLAKE2b-256 65e671e6fb672d4bee6d4658bed7268803d54ab6f815233720dfe0ce4296399b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pqdict-1.5.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