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.4.0.tar.gz (11.9 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.4.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: core_data_structures-1.4.0.tar.gz
  • Upload date:
  • Size: 11.9 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.4.0.tar.gz
Algorithm Hash digest
SHA256 e88f6bcd2476bb83f9dca4d23897662e84ee8e8bf99b79f70b37b21f0eda3faf
MD5 cf987cb81b815308d1dcd20fc5351ae3
BLAKE2b-256 f0826537b2707eafaa004712e6eff6971cd77a02821eaee9328cfed097848316

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for core_data_structures-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32d2c7e3e95488209c8df0262e3a93116b2dbc8215c0a34c1d0d54c9d6b19d10
MD5 83f7d99d1bce1726866aa78b9dde18dd
BLAKE2b-256 ac142e9e808aae19fec17e05fb5ad64d74dc6b1f2318d2928f1ad46775aed4d8

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