Skip to main content

HHLtools

HHLtools is a small collection of Python utilities for algorithms, data structures, debugging, terminal output, and basic mathematics.

Requirements

HHLtools requires Python 3.10 or later.

Installation

Install the package from PyPI:

python -m pip install hhltools

To install the current checkout for development:

python -m pip install -e .

Quick start

Algorithms

binary_search returns the index of a value in an ascending, sorted sequence, or -1 when the value is absent:

from HHLtools.algorithm import binary_search

index = binary_search([1, 3, 5, 7], 5)
assert index == 2

Data structures

Queues and stacks can be bounded or unbounded:

from HHLtools.data_structure import Queue, Stack

queue = Queue()
queue.push("first")
queue.push("second")
assert queue.pop() == "first"

stack = Stack()
stack.push("first")
stack.push("second")
assert stack.pop() == "second"

Array supports explicit, inclusive bounds and runtime element-type checking:

from HHLtools.data_structure import Array

matrix = Array[1:2, 1:3] @ int
matrix[1, 1] = 42
assert matrix[1, 1] == 42

Debugging

Use print_obj to inspect nested object attributes as a tree:

from HHLtools.debug import print_obj

print_obj({"status": "ready"})

Package modules

algorithm

General-purpose algorithms.

chinese

Chinese aliases for selected Python built-ins and constants.

clstools

Class decorators and runtime class utilities.

data_structure

Queues, stacks, linked lists, and typed multidimensional arrays.

debug

Call-stack and object-inspection helpers.

error

Exception-reporting helpers and package-specific exceptions.

math

Helpers for functions, vectors, and three-dimensional lines.

prettyprint

ANSI terminal formatting and tree-display constants.

utils

Shared type-inspection helpers.

Version history

2.1.1 (2026-09-05)

Refactored parts of the package.

2.1.0 (2026-09-05)

Added Array.

2.0.2 (2026-09-04)

Added recursive-reference detection to print_obj.

2.0.1 (2026-09-04)

Fixed minor bugs.

2.0.0 (2026-09-04)

Expanded the debugging tools and documentation.

Earlier releases

  • 1.2.7 (2026-09-03): Fixed bugs.

  • 1.2.6 (2026-02-12): Fixed bugs in prints.

  • 1.2.2–1.2.4 (2023-12-20): Fixed bugs.

  • 1.2.1 (2023-04-22): Fixed bugs and removed fibonacci.

  • 1.2.0 (2023-04-22): Added Vector and improved error reporting.

  • 1.1.0 (2023-04-21): Added linked lists and updated existing functions.

  • 1.0.7–1.0.8.1 (2022-10-28 to 2022-11-04): Added prints and the Chinese aliases, enabled Python 3.11, and fixed bugs.

  • 1.0.4–1.0.6 (2022-09-17 to 2022-10-02): Added stacks, queues, and mathematical helpers, and fixed bugs.

  • 1.0.0–1.0.3 (2022-08-07): Initial releases.

License

HHLtools is distributed under the MIT License. See LICENSE.txt for details.

Metadata

Release files for hhltools 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hhltools 2.1.2
File Size Uploaded Provenance Actions
hhltools-2.1.2.tar.gz 15.1 kB Without provenance Details for hhltools-2.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hhltools 2.1.2
File Interpreter ABI Platform Actions
hhltools-2.1.2-py3-none-any.whl Python 3 none any Details for hhltools-2.1.2-py3-none-any.whl

Total release size: 34.3 kB

Release files / hhltools-2.1.2.tar.gz

Download URL hhltools-2.1.2.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5604615cee9c07293c6195a2a99d45de73738b66f989f161aba676650aefa9b1
BLAKE2b-256 checksum
How to use checksums
64a5d0587ad490179cddb72a20aa3253bb131fe6edbf03a61d0f3286f83db754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / hhltools-2.1.2-py3-none-any.whl

Download URL hhltools-2.1.2-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8a126e0379b288f299f31d9163fbb1ab0a6023d3ada8e34c47404c25c0f2830
BLAKE2b-256 checksum
How to use checksums
c3fc0531c2a63f345aadcce946c7a7d632321979364964998456cdb217660b21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for hhltools 2.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page