TheAlgorithms/Python
There is no runnable service or package entrypoint — the repo is a flat namespace of independent algorithm modules, declared as a 'virtual' project (no [build-system] in pyproject.toml) so `uv sync` installs only dependencies. The de-facto runtime is CI: eight GitHub Actions workflows gate PRs (build, ruff, ty, project_euler, sphinx, directory_writer, hacktoberfest_prep, devcontainer_ci). Tooling lives in scripts/ (directory generation, filename validation, Euler answer validation, PR janitor shell scripts). Storage is limited to checked-in artifacts: DIRECTORY.md (generated index), scripts/project_euler_answers.json (hashed answers), uv.lock, and docs/hacktober_2026_prep.md (bot-maintained tracker). External integrations are GitHub's API (gh CLI, GITHUB_TOKEN), GitHub Pages for Sphinx docs, and incidental web scraping inside web_programming/ modules.
- pyproject.toml declares project 'thealgorithms-python' v0.0.1 with requires-python >=3.14 and no [build-system] table, so uv treats the repo as a virtual project and installs only dependencies — it is never built as a wheel.
- The interpreter target is free-threaded CPython 3.14t, pinned via .python-version (contents '3.14t'); classifiers advertise Python 3.14/3.15 and 'Free Threading :: 2 - Beta'.
- Dependencies (numpy, scipy, pandas, scikit-learn, keras, matplotlib, pillow, sympy, httpx2, etc.) are managed by uv with a checked-in uv.lock; there is intentionally no requirements.txt.
- opencv-python and qiskit are quarantined into optional dependency groups 'cv' and 'quantum' because they lack free-threaded 3.14t wheels, and the corresponding test trees are --ignore'd in CI.
- Eight workflows in .github/workflows/ form the entire build/deploy pipeline: build.yml (pytest+coverage), ruff.yml (lint gate), ty.yml (informational type check), project_euler.yml (Euler doctests + answer validation), sphinx.yml (docs→GitHub Pages), directory_writer.yml (regenerate DIRECTORY.md on push), hacktoberfest_prep.yml (daily tracker bot), devcontainer_ci.yml.
- scripts/ is the only 'application code' layer: build_directory_md.py generates DIRECTORY.md, validate_filenames.py enforces naming, validate_solutions.py is the Euler oracle, hacktoberfest_prep_update.py and pr_file_map.py are maintainer bots, and close_pull_requests_with_*.sh are janitor scripts.
- scripts/project_euler_answers.json is the persistent store of expected Project Euler answers as SHA-256 hex digests, loaded at module import time by validate_solutions.py.
- DIRECTORY.md is a fully generated artifact — build_directory_md.py walks the tree and prints a nested Markdown index, and directory_writer.yml regenerates and force-pushes it on every push; CONTRIBUTING.md forbids editing it by hand.
- Documentation deployment is Sphinx + sphinx-autoapi + myst-parser: docs/conf.py enumerates 43 algorithm dirs in autoapi_dirs and sphinx.yml builds docs/_build/html and deploys to GitHub Pages on non-PR events.
- Local dev tooling is uv + pre-commit: .pre-commit-config.yaml wires ruff-check, ruff-format, codespell, pyproject-fmt, rumdl, auto-walrus, uv-lock, validate-pyproject, and a local validate-filenames hook.
- A devcontainer (.devcontainer/devcontainer.json, Dockerfile, post_install) and .gitpod.yml provide reproducible contributor environments; devcontainer_ci.yml builds it on changes.
- Each algorithm directory is a self-contained namespace (typically <topic>/<file>.py plus __init__.py); modules do not import each other across directories in general, so there is no internal package graph to map. (inferred)