Production-grade data structures and algorithms — zero dependencies
Project description
resq-dsa
Production-grade data structures and algorithms for Python 3.11+ with zero dependencies.
Data Structures
- BloomFilter -- Space-efficient probabilistic set membership testing
- CountMinSketch -- Probabilistic frequency estimation for data streams
- Graph -- Directed weighted graph with BFS, Dijkstra, and A* pathfinding
- BoundedHeap -- Bounded min-heap for top-k queries
- Trie -- Prefix tree for efficient string storage and retrieval
Algorithms
- rabin_karp -- Rabin-Karp rolling hash string pattern matching
Installation
pip install resq-dsa
Usage
from resq_dsa import BloomFilter, Graph, Trie, BoundedHeap, rabin_karp
# Bloom filter for deduplication
bf = BloomFilter(capacity=10_000)
bf.add("seen-id-1")
assert bf.has("seen-id-1")
# Graph pathfinding
g = Graph()
g.add_edge("A", "B", 1.0)
g.add_edge("B", "C", 2.0)
result = g.dijkstra("A", "C") # {'path': ['A', 'B', 'C'], 'cost': 3.0}
# Trie prefix search
trie = Trie()
trie.insert("alert")
trie.insert("alarm")
trie.starts_with("al") # ['alert', 'alarm']
# Pattern matching
rabin_karp("ababab", "ab") # [0, 2, 4]
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
resq_dsa-0.1.0.tar.gz
(31.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
resq_dsa-0.1.0-py3-none-any.whl
(11.8 kB
view details)
File details
Details for the file resq_dsa-0.1.0.tar.gz.
File metadata
- Download URL: resq_dsa-0.1.0.tar.gz
- Upload date:
- Size: 31.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47c40e02015c50194c0426f7f138134c70837f11bcfdfd409786c54635aa6eff
|
|
| MD5 |
47f69660311d5702ee4b103e42dd993f
|
|
| BLAKE2b-256 |
daa01061821d74720d0a3c4ceecb3acfaccce47130a4db083ea54fbc5044dc68
|
File details
Details for the file resq_dsa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: resq_dsa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20338885c60538d7de78559c82c8f0a1d345ba4dbfc2ced90e54167d094c500b
|
|
| MD5 |
673463fff74f9265658d478c41df8e58
|
|
| BLAKE2b-256 |
f760403d2a7cbf5d6a6cd8106f1f96e24071518708fd9bdbcc9fc4db62e96bb3
|