core-data-structures
A Python library providing common data structures including graphs, trees, and lists, with built-in traversal, path-finding, and search algorithms.
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
Lists — singly and doubly linked lists sharing a common IList/ILinkedList interface.
Value-based CRUD: append, prepend, insert, get/__getitem__, index, pop/pop_front/pop_back, remove (single or all occurrences)
reverse, extend, clear, to_list/from_list
__iter__/__contains__ support, plus O(1) head/end node access
DoubleLinkedList additionally maintains .prev links for backward traversal and locates positions from whichever end (head/end) is closer
Quick Start
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-tests
Run linting: pylint data_structures
Run security checks: bandit -r data_structures
Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
Documentation: https://core-data-structures.readthedocs.io/en/latest/
Repository: https://gitlab.com/bytecode-solutions/core/core-data-structures
Issues: https://gitlab.com/bytecode-solutions/core/core-data-structures/-/issues
Changelog: https://gitlab.com/bytecode-solutions/core/core-data-structures/-/blob/master/CHANGELOG.md
Support
For questions or support, please open an issue on GitLab or contact the maintainers.
Metadata
Release files for core-data-structures 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| core_data_structures-1.4.1.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| core_data_structures-1.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.9 kB
Release files / core_data_structures-1.4.1.tar.gz
| Download URL | core_data_structures-1.4.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adc5b8e7a687bb76fbbf6b9f7d795aa37d2a1984f105ca8681bf3d867901a328
|
|
BLAKE2b-256 checksum How to use checksums |
d38bc09bcc95dffadf0b4f413355c9b41e0767c6b7829c6e1ca52fac41d90dd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / core_data_structures-1.4.1-py3-none-any.whl
| Download URL | core_data_structures-1.4.1-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0abacab3c04b3578375d1647927b0ddb13091fa74bf6757a14c4ddc9164fe3ff
|
|
BLAKE2b-256 checksum How to use checksums |
a9b46d183fe3be2a944011ad53637b4c980c681ed2835e84fa3abf34c22d2e2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|