semvec/pypi-packages huggingface dataset:
bhpq 2.0.1
Binary Heap Priority Queue
License: MIT

[![HitCount](http://hits.dwyl.io/aayushuppal/bhpq.svg)](https://github.com/aayushuppal/bhpq)
[![GitHub contributors](https://img.shields.io/github/contributors/aayushuppal/bhpq.svg)](https://github.com/aayushuppal/bhpq/graphs/contributors)
[![Version](https://img.shields.io/pypi/v/bhpq.svg)](https://pypi.python.org/pypi/bhpq)
[![License](https://img.shields.io/pypi/l/bhpq.svg)](https://pypi.python.org/pypi/bhpq)
[![Build Status](https://travis-ci.org/aayushuppal/bhpq.svg?branch=master)](https://travis-ci.org/aayushuppal/bhpq)
[![Downloads](https://img.shields.io/pypi/dm/bhpq.svg)](https://pypi.python.org/pypi/bhpq)


# BHPQ - Binary Heap Priority Queue

A binary heap priority queue implementation, thread safe

## Installation

You can install bhpq from [PyPI](https://pypi.org/project/bhpq):

    pip install bhpq

bhpq is supported on Python 3.7

## Usage

    from bhpq import BinaryHeapPriorityQueue

    # The BinaryHeapPriorityQueue constructor takes two input params:

    # - prefer (required param)
    #    the preferred object is pushed to the top of the queue
    # the prefer input is a lambda function eg:
    # prefer=(lambda lhs, rhs: lhs if lhs.val >= rhs.val else rhs)

    # - size
    #    The initial size allocation of the queue, default value is 10

## Example

    class Node(object):
    def __init__(self, val):
        self.val = val

    A = BinaryHeapPriorityQueue(
            prefer=(lambda lhs, rhs: lhs if lhs.val >= rhs.val else rhs), size=5
        )

    A.add(Node(1))
    A.add(Node(4))
    A.add(Node(3))
    A.add(Node(5))
    A.add(Node(2))

    assert 5 == A.pop().val
    assert 4 == A.pop().val
    assert 3 == A.pop().val
    assert 2 == A.pop().val
    assert 1 == A.pop().val
    assert None == A.pop()

## Methods

- `size()`

returns the current size of the priority queue

- `peek()`

returns the object at the topof the priority queue if it exists else returns None

- `pop()`

removes and returns the object at the top of the priority queue if it exists else returns None

- `add(val)`

adds an element to the priority queue

## Maintainer

ⓘ [Aayush Uppal](https://aayushuppal.github.io)
count-money 0.7.1
A tkinter based GUI application that helps you count money.
License: MIT
Requires Python: >=3.6
Keywords: money count sum coins bills gui accounting commerce

**[English](https://github.com/victordomingos/count-money/blob/master/README.md)** | [Portugu&ecirc;s](https://github.com/victordomingos/count-money/blob/master/README_PT.md)

# Count Money [![Github commits (since latest release)](https://img.shields.io/github/commits-since/victordomingos/count-money/latest.svg)](https://github.com/victordomingos/count-money) ![PyPI](https://img.shields.io/pypi/v/count-money) ![PyPI - Downloads](https://img.shields.io/pypi/dm/count-money)

![img](https://github.com/victordomingos/count-money/raw/master/screenshots/screenshot_en.png)
A little utility app to help you count coins and bills, which calculates in real-time the total amount of money.
Additionally, it can save a report in a text file containing both the totals and the individual amounts.

## Installation and dependencies:

To install and run this application, you just need to have a working
Python 3.6+ installation, with support for tkinter/ttk. The easiest way to install it in a single step is
by using this command:

```
pip3 install count-money
```

## How to use:

The current version of this aplication can be run from the command line shell using the following command:

```
count-money
```