Skip to main content

A collection of utterly useless yet entertaining sorting algorithms

Project description

Big O(No) — Python CLI

CLI-only implementation of intentionally impractical sorting algorithms.

Install

pip install big-oh-no
big-oh-no --help

Run

Quick run (no manual environment activation):

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

Development run:

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
uv run big-oh-no darwin 5 3 1 4 2
uv run big-oh-no darwin --max-generations 200 9 1 8 2 7
uv run big-oh-no darwin --population-size 100 --mutation-rate 0.5 5 3 1 4 2

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

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:

uv run --extra dev pytest -q

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

big_oh_no-1.3.0.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

big_oh_no-1.3.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file big_oh_no-1.3.0.tar.gz.

File metadata

  • Download URL: big_oh_no-1.3.0.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for big_oh_no-1.3.0.tar.gz
Algorithm Hash digest
SHA256 2a013363462a9ff43f23a978cb0cc71b91359c850bb13424c3bf3bdc3dcf84ae
MD5 27d8a7de6cb20ea735545d6ae900208b
BLAKE2b-256 80d97332d0a585fabf16988c4b38edfcc86b308104119bddd0c9e075eabdba79

See more details on using hashes here.

Provenance

The following attestation bundles were made for big_oh_no-1.3.0.tar.gz:

Publisher: release.yml on manifoldlabslimited/big-oh-no

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file big_oh_no-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: big_oh_no-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for big_oh_no-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9804494f552e02f7a8c923c7f5b40ab0719b7979a97b9b571bce2ac53514ed5
MD5 10c7f9e55a08981ce167117e6543c5f7
BLAKE2b-256 35fc685ca007019113885e80816596065f5cd2c8e0411d0dc520332a810c1954

See more details on using hashes here.

Provenance

The following attestation bundles were made for big_oh_no-1.3.0-py3-none-any.whl:

Publisher: release.yml on manifoldlabslimited/big-oh-no

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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