Metadata-Version: 2.4
Name: core-data-structures
Version: 1.3.0
Summary: This project/library contains commons data structures...
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
Maintainer: Alejandro Cora González
License-Expression: MIT
Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-data-structures
Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-data-structures
Project-URL: Documentation, https://core-data-structures.readthedocs.io/en/latest/
Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-data-structures/-/issues
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-data-structures/-/blob/master/CHANGELOG.md
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: core-mixins>=3.2.0
Requires-Dist: typing-extensions>=4.8.0
Provides-Extra: dev
Requires-Dist: core-dev-tools>=2.1.0; extra == "dev"
Requires-Dist: core-tests>=2.1.0; extra == "dev"
Dynamic: license-file

core-data-structures
===============================================================================

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

===============================================================================

.. image:: https://static.pepy.tech/personalized-badge/core-data-structures?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
    :target: https://pepy.tech/projects/core-data-structures
    :alt: PyPI Downloads

.. image:: https://img.shields.io/pypi/pyversions/core-data-structures.svg
    :target: https://pypi.org/project/core-data-structures/
    :alt: Python Versions

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://gitlab.com/bytecode-solutions/core/core-data-structures/-/blob/main/LICENSE
    :alt: License

.. image:: https://gitlab.com/bytecode-solutions/core/core-data-structures/badges/release/pipeline.svg
    :target: https://gitlab.com/bytecode-solutions/core/core-data-structures/-/pipelines
    :alt: Pipeline Status

.. image:: https://readthedocs.org/projects/core-data-structures/badge/?version=latest
    :target: https://readthedocs.org/projects/core-data-structures/
    :alt: Docs Status

.. image:: https://img.shields.io/badge/security-bandit-yellow.svg
    :target: https://github.com/PyCQA/bandit
    :alt: 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:

.. code-block:: bash

    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:

.. code-block:: bash

    pip install --upgrade pip
    pip install virtualenv

2. Create Python virtual environment:

.. code-block:: bash

    virtualenv --python=python3.12 .venv

3. Activate the virtual environment:

.. code-block:: bash

    source .venv/bin/activate

4. Install packages:

.. code-block:: bash

    pip install .
    pip install -e ".[dev]"

Check tests and coverage
-------------------------------------------------------------------------------

.. code-block:: bash

    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.


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
* **PyPI:** https://pypi.org/project/core-data-structures/


Support
===============================================================================

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


Authors
===============================================================================

* **Alejandro Cora González** - *Initial work* - alek.cora.glez@gmail.com
