Metadata-Version: 2.4
Name: big-oh-no
Version: 1.2.0
Summary: A collection of utterly useless yet entertaining sorting algorithms
Author-email: Manifold Labs <neel@manifoldlabs.co.nz>
License-Expression: MIT
Project-URL: Homepage, https://github.com/manifoldlabslimited/big-oh-no
Project-URL: Repository, https://github.com/manifoldlabslimited/big-oh-no
Project-URL: Issues, https://github.com/manifoldlabslimited/big-oh-no/issues
Keywords: sorting,algorithms,cli,fun,bogosort,humor
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0
Requires-Dist: numpy>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: rich>=13.0
Requires-Dist: scipy>=1.13
Provides-Extra: dev
Requires-Dist: pre-commit>=3.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"

# Big O(No) — Python CLI

CLI-only implementation of intentionally impractical sorting algorithms.

## Install

```bash
pip install big-oh-no
big-oh-no --help
```

## Run

Quick run (no manual environment activation):

```bash
cd python
uvx --from . big-oh-no --help
uvx --from . big-oh-no wait 5 2 8 1 3
```

Development run:

```bash
cd python
uv sync
uv run big-oh-no --help
uv run big-oh-no wait 5 2 8 1 3
uv run big-oh-no stalin 5 1 9 2 8 3 10
uv run big-oh-no linus 3 1 7 2 9 5 12
uv run big-oh-no bogo 3 2 1
uv run big-oh-no bogo --max-attempts 5000 3 2 1
uv run big-oh-no schrodinger 5 3 1 4
uv run big-oh-no schrodinger --meanness 0.8 5 3 1 4
uv run big-oh-no urinal 8 3 6 1 9 2
uv run big-oh-no urinal --awkwardness 1.0 8 3 6 1 9 2
uv run big-oh-no digit 170 45 75 90 2 802 66
uv run big-oh-no digit 3 1 4 1 5 9 2 6
```

If you see a `VIRTUAL_ENV ... does not match the project environment path` warning, another virtualenv is active in your shell. It is safe to ignore, or run `deactivate` before `uv` commands.

## Validation

Input is validated at the CLI boundary using Pydantic v2. `numbers` must be a non-empty list of integers. Invalid input exits with a clear error message — no sorting happens.

## Tests

```bash
cd python
uv run --extra dev pytest -q
```

Three test modules:
- `tests/test_validation.py` — Pydantic input validation
- `tests/test_algorithms.py` — sort function unit tests
- `tests/test_cli.py` — E2E CLI tests via Click's `CliRunner`

---

## Contributing

### Adding a new algorithm

- Create `big_oh_no/<name>_sort.py` with a single public sort function. The first return value must always be the sorted list — after that, return whatever the algorithm's persona demands (eliminated elements, total time, hurt feelings, etc.)
- Add a command in `big_oh_no/cli.py` using Click, following the pattern of the existing commands
- Add at least one test in `tests/test_algorithms.py`
- Update the algorithm list in the root `README.md`
- Add a run example in `python/README.md`

### Making an existing one better

- Richer Rich output, more flavourful commentary, better edge-case handling — all welcome
- Do not change the return contract of the sort function without updating `big_oh_no/cli.py` and the tests

All tests must pass before opening a PR:

```bash
uv run --extra dev pytest -q
```
