Skip to main content

This project/library contains commons data structures...

Project description

core-data-structures

A Python library providing common data structures including graphs, trees, and lists, with built-in traversal, path-finding, and search algorithms.


PyPI Downloads Python Versions License Pipeline Status Docs Status Security

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

  1. Install required libraries:

pip install --upgrade pip
pip install virtualenv
  1. Create Python virtual environment:

virtualenv --python=python3.12 .venv
  1. Activate the virtual environment:

source .venv/bin/activate
  1. 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:

  1. Fork the repository

  2. Create a feature branch

  3. Write tests for new functionality

  4. Ensure all tests pass: python manager.py run-tests

  5. Run linting: pylint data_structures

  6. Run security checks: bandit -r data_structures

  7. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For questions or support, please open an issue on GitLab or contact the maintainers.

Authors

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

core_data_structures-1.3.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

core_data_structures-1.3.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file core_data_structures-1.3.0.tar.gz.

File metadata

  • Download URL: core_data_structures-1.3.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for core_data_structures-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1c285c1e41196af763ec29141bdd839cba34b43f58b179b8dc47c51b2e45ac6b
MD5 8d30d4397111196548b3f322ccf2332f
BLAKE2b-256 8178e0e671ec5b06d934af4483ff70728f382326888ffcfb380e0df33dd7ccc5

See more details on using hashes here.

File details

Details for the file core_data_structures-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for core_data_structures-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afaa9ea7649e93cfe4ee0032242515480cdb277014b5f69990482b359cdc88f5
MD5 783aa0ca54a480338e63e86bd27c2f8c
BLAKE2b-256 ae85a3bad3022c9bbae80728f5bc2632a83775160883442ca00be3425337c74f

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