.. core-algorithms documentation master file, created by sphinx-quickstart on Sat Apr 4 10:50:27 2026. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. core-algorithms =============================================================================== A Python library containing common algorithm implementations — currently focused on sorting — designed for reuse across projects. =============================================================================== .. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg :target: https://pypi.org/project/core-algorithms/ :alt: Python Versions .. image:: https://img.shields.io/badge/license-MIT-blue.svg :target: https://gitlab.com/bytecode-solutions/core/core-algorithms/-/blob/main/LICENSE :alt: License .. image:: https://gitlab.com/bytecode-solutions/core/core-algorithms/badges/release/pipeline.svg :target: https://gitlab.com/bytecode-solutions/core/core-algorithms/-/pipelines :alt: Pipeline Status .. image:: https://readthedocs.org/projects/core-algorithms/badge/?version=latest :target: https://readthedocs.org/projects/core-algorithms/ :alt: Docs Status .. image:: https://img.shields.io/badge/security-bandit-yellow.svg :target: https://github.com/PyCQA/bandit :alt: Security Documentation Contents ------------------------------------------------------------------------------- .. toctree:: :maxdepth: 1 :caption: Index: sorting Features ------------------------------------------------------------------------------- * **Sorting algorithms**: bubble sort, insertion sort, merge sort, quick sort, and selection sort * **Fully typed**: complete type annotations with ``py.typed`` marker for PEP 561 compliance * **Broad Python support**: compatible with Python 3.9 through 3.14 and PyPy Installation ------------------------------------------------------------------------------- .. code-block:: bash pip install core-algorithms uv pip install core-algorithms # Or using UV... pip install -e ".[dev]" # For development... Quick Start ------------------------------------------------------------------------------- **Sorting**: import and use any of the available sorting algorithms directly: .. code-block:: python from core_algorithms.sorting import bubble_sort, insertion_sort from core_algorithms.sorting import merge_sort, quick_sort, selection_sort data = [5, 3, 8, 1, 9, 2] print(bubble_sort(data)) # [1, 2, 3, 5, 8, 9] print(quick_sort(data)) # [1, 2, 3, 5, 8, 9] print(merge_sort(data)) # [1, 2, 3, 5, 8, 9] Development ------------------------------------------------------------------------------- .. code-block:: bash # Create and activate virtual environment virtualenv --python=python3.12 .venv source .venv/bin/activate # Install with dev dependencies pip install -e ".[dev]" # Run tests python manager.py run-tests python manager.py run-coverage # Lint and security scan pylint core_algorithms bandit -r core_algorithms # Run across all supported Python versions tox 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 core_algorithms`` 6. Run security checks: ``bandit -r core_algorithms`` 7. Submit a pull request License =============================================================================== This project is licensed under the MIT License. See the LICENSE file for details. Links =============================================================================== * **Documentation:** https://core-algorithms.readthedocs.io/en/latest/ * **Repository:** https://gitlab.com/bytecode-solutions/core/core-algorithms * **Issues:** https://gitlab.com/bytecode-solutions/core/core-algorithms/-/issues * **Changelog:** https://gitlab.com/bytecode-solutions/core/core-algorithms/-/blob/master/CHANGELOG.md * **PyPI:** https://pypi.org/project/core-algorithms/ 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