Skip to main content

Lightweight DSA utilities for Python

Project description

AlgoNest

AlgoNest is a Python toolkit for reusable algorithms, data structures, and small utility helpers. It gives developers a consistent, iterable-first API for common problems without rebuilding the same primitives each time.

Problem Statement

Many algorithm libraries are either classroom examples or narrow problem-specific snippets. AlgoNest is built as a practical toolkit instead: a collection of reusable building blocks for search, sorting, trees, graphs, dynamic programming, strings, math, and supporting utilities. It is useful when you want clean, typed implementations that are easy to import, compose, and reuse in exercises, interview prep, and real code.

Target Audience

AlgoNest is for:

  • Students learning core data structures and algorithm patterns
  • Developers preparing for interviews
  • Engineers who want reliable reference implementations
  • Maintainers who need compact reusable helpers instead of one-off snippets

Key Features

  • arrays/: interval helpers, prefix sums, two pointers, Kadane, rotations, and matrix utilities
  • search/: linear, binary, rotated, exponential, interpolation, jump, ternary, and 2D matrix search
  • sort/: classic and advanced sorting implementations
  • linked_list/: singly, doubly, and circular list structures plus linked-list algorithms
  • stack_queue/: stacks, queues, deques, monotonic stack utilities, and expression helpers
  • heap/: min/max heaps, priority queue, top-k helpers, merge helpers, and median tracking
  • trees/: binary trees, BSTs, AVL trees, segment trees, Fenwick trees, traversals, views, and path helpers
  • graphs/: traversal, shortest path, MST, SCC, bipartite, DSU, and representation helpers
  • dynamic_programming/: Fibonacci, knapsack, coin change, LCS, LIS, edit distance, subset DP, and grid DP
  • strings/: trie, anagram helpers, KMP, Rabin-Karp, Z algorithm, rolling hash, and palindrome helpers
  • math/: number theory, modular arithmetic, combinatorics, matrix math, statistics, and bit manipulation
  • backtracking/: combinations, permutations, subsets, and combination sum helpers
  • greedy/: activity selection, fractional knapsack, jump-game helpers, and reachability logic
  • nodes/ and utils/: shared node types, validation, testing helpers, I/O helpers, and debug utilities

Installation

pip install algonest

For local development:

pip install -e .

Quick Usage Examples

Search

from algonest import binary_search, search_2d_matrix

index = binary_search([1, 3, 5, 7, 9], 7)
location = search_2d_matrix([[1, 4, 7], [10, 13, 16]], 13)

Arrays

from algonest import max_subarray_sum, prefix_sum, range_sum

best = max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4])
prefix_values = prefix_sum([1, 2, 3, 4])
window_total = range_sum(prefix_values, 1, 3)

Trees

from algonest import BinaryTree

tree = BinaryTree()
for value in [5, 3, 8, 1, 4]:
	tree.insert(value)

height = tree.height()
balanced = tree.is_balanced()

Strings

from algonest import Trie, kmp_search

trie = Trie()
trie.insert("algo")
matches = kmp_search("ababcabcab", "abc")

Project Structure

AlgoNest/
|-- algonest/
|   |-- arrays/
|   |-- backtracking/
|   |-- dynamic_programming/
|   |-- graphs/
|   |-- greedy/
|   |-- heap/
|   |-- linked_list/
|   |-- math/
|   |-- nodes/
|   |-- search/
|   |-- sort/
|   |-- stack_queue/
|   |-- strings/
|   |-- trees/
|   `-- utils/
|-- benchmarks/
|-- docs/
|   `-- Project Structure.md
|-- tests/
|-- ALGONEST_API.md
|-- CONTRIBUTING.md
|-- CODE_OF_CONDUCT.md
|-- README.md
`-- pyproject.toml

Design Philosophy

AlgoNest is a toolkit, not a problem bank. The goal is to provide small, reusable implementations with consistent naming, clear signatures, and predictable behavior so the package is useful as a reference and as a foundation for real code.

Development Notes

  • Tests are organized with pytest under tests/.
  • Public API signatures are documented in ALGONEST_API.md.
  • Contribution guidance is in CONTRIBUTING.md.

License

AlgoNest is released under the MIT License. See LICENSE for details.

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

algonest-0.1.2.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

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

algonest-0.1.2-py3-none-any.whl (87.5 kB view details)

Uploaded Python 3

File details

Details for the file algonest-0.1.2.tar.gz.

File metadata

  • Download URL: algonest-0.1.2.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for algonest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1aa9da31b99775ef11b98ad2a6455a029f4299ba26d8b6b71af3c77412b34da2
MD5 e3ba2278569125efe51c85a81cc4f729
BLAKE2b-256 1c9e646a616bfdfada52bc10f7941679ec0f1d7a3e76a7fd2a501896b30e1642

See more details on using hashes here.

File details

Details for the file algonest-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: algonest-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 87.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for algonest-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aec4b179ebfbf4f41a4393bb7dd2c46dd3d84fb74599c66d5d0e2fba8e7ff45d
MD5 c2428aa58e41607db224eaeaa2a95c64
BLAKE2b-256 4efac1c27bc94c33795bdd5be5fbcafcae6ede10fd390e20b96c85a084e2c81f

See more details on using hashes here.

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