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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pqdict-1.5.0.tar.gz
  • Upload date:
  • Size: 186.8 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.0.tar.gz
Algorithm Hash digest
SHA256 f6cf70388d86ac98fbbb1b70814e1ca44347adc9dc880c818201753edce0c018
MD5 f9b0b2320fc008a795853fb56044d1f2
BLAKE2b-256 5715712b0f17d1713bf9d7552fd1421c259586e4c3d5bf549729c636ed9cdf7c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pqdict-1.5.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7146b39a490e4b641bd66f92f7d78e66e549c0a3b76f6825d6aa3ec5a39bae8
MD5 a1bcd98fe90daf52e549d3cde7068706
BLAKE2b-256 fd25fcd623941f797f252eb743fbf9ed85f8980bd2a004314ae7b72f38b50272

See more details on using hashes here.

Provenance

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