core-data-structures#
A Python library providing common data structures including graphs and trees, with built-in traversal and path-finding algorithms.
Documentation Contents#
Features#
Graphs — undirected weighted graph with adjacency dictionary representation.
Breadth-first search (BFS)
Depth-first search (DFS)
Path finding (single path, all paths, shortest path)
Trees — binary tree and simple nested-dictionary tree.
Pre-order, in-order, post-order, and level-order traversal
Recursive and iterative variants
Tree depth calculation
Installation#
Install from PyPI using pip:
pip install core-data-structures
uv pip install core-data-structures # Or using UV...
pip install -e ".[dev]" # For development...
Setting Up Environment#
Install required libraries:
pip install --upgrade pip
pip install virtualenv
Create Python virtual environment:
virtualenv --python=python3.12 .venv
Activate the virtual environment:
source .venv/bin/activate
Install packages#
pip install .
pip install -e ".[dev]"
Check tests and coverage#
python manager.py run-tests
python manager.py run-coverage
Contributing#
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Write tests for new functionality
Ensure all tests pass:
python manager.py run-testsRun linting:
pylint data_structuresRun security checks:
bandit -r data_structuresSubmit a pull request
License#
This project is licensed under the MIT License. See the LICENSE file for details.
Links#
Support#
For questions or support, please open an issue on GitLab or contact the maintainers.