A professional and well-documented data structures package for Python.
Project description
dscollections
dscollections is a professional, educational, and production-friendly Python package that provides commonly used Data Structures and Algorithms (DSA) building blocks.
Author: Sanjay Saravanan M.Tech (IIT Madras)
Why dscollections?
- Clean and consistent APIs.
- Strong type hints for better IDE support.
- Thorough inline documentation.
- Easy to install and publish on PyPI.
- Tested with
pytest.
Included Data Structures
Linear
DynamicArray[T]Stack[T]Queue[T]Deque[T]SinglyLinkedList[T]
Trees
BinarySearchTree[T]
Graphs
Graph[T](adjacency-list based)
Priority Structures
MinHeap[T]
Installation
pip install dscollections
For local development:
pip install -e .[dev]
Quick Start
from dscollections import Stack, Queue, BinarySearchTree
stack = Stack[int]()
stack.push(10)
stack.push(20)
print(stack.pop()) # 20
queue = Queue[str]()
queue.enqueue("a")
queue.enqueue("b")
print(queue.dequeue()) # "a"
bst = BinarySearchTree[int]()
for value in [10, 5, 15, 12]:
bst.insert(value)
print(12 in bst) # True
print(list(bst.in_order())) # [5, 10, 12, 15]
Publishing to PyPI
- Build distributions:
python -m pip install --upgrade build python -m build
- Upload to TestPyPI:
python -m pip install --upgrade twine twine upload --repository testpypi dist/*
- Upload to PyPI:
twine upload dist/*
Project Layout
src/dscollections/
__init__.py
linear.py
tree.py
graph.py
heap.py
tests/
License
MIT License
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
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
File details
Details for the file pydscollections-0.1.0.tar.gz.
File metadata
- Download URL: pydscollections-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0836c21023ca5898a74285bd5ac62a7febedd77012c424627bbc34c9d292ed9
|
|
| MD5 |
d13419e5fda8215e4500191f9e211747
|
|
| BLAKE2b-256 |
034ca4a77b3467affca3e406b0b2a0a25567f5a9f72d4fd220dc7e2974cafe82
|
File details
Details for the file pydscollections-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydscollections-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77133ce1a8e0ac5ed6283b703990d717b01bd6ec8c7a2b3d9fde25bc5dcfc426
|
|
| MD5 |
aab5f36c138e346ed994977079b0d98e
|
|
| BLAKE2b-256 |
4eb36d9be4e2aa6a17d8efd2df14f7f0d7fb2307d97a414182e518c6ec842741
|