# SethMMorton/natsort

Simple yet flexible natural sorting in Python.

Repository: https://github.com/SethMMorton/natsort
Canonical: https://ross.abutalabs.com/products/natsort
Homepage: https://pypi.org/project/natsort/
Language: Python
License: MIT
License Family: permissive
Topics: python, natural-sort, sorting-interface, sorting, natsort
Last push: 2026-08-05T04:18:34+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 35, longevity 100
- inputs: {"age_days": 5235, "days_push": 28, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1012, forks 63 (observed 2026-08-28T04:03:13.318583+00:00)

## What it is
natsort is a Python library providing natural (human-friendly) sorting of strings containing numbers, as a drop-in replacement for the built-in sorted() function. It is flexible, with options for locale-aware sorting, paths, and other number formats.

## Use cases
- sort filenames with numbers naturally
- sort version-like strings in human order
- replace python sorted() for alphanumeric lists
- sort lists like 'file1, file2, file10' correctly
- natural sorting of mixed number and text strings
- sort paths naturally in python

## When to choose
- you need strings with embedded numbers sorted by numeric value instead of lexicographically
- you want a drop-in, well-tested replacement for sorted()
- you need locale-aware or path-aware natural sorting options

## When to avoid
- you only sort plain numeric or plain alphabetic data with no mixed content
- you need sorting in a non-Python language
- you need in-place sorting of very large datasets with minimal overhead

## Facets
- artifact type: library
- maturity: stable
- function: parser, developer-tools
- domain: developer-tools, files
- platform: python, cross-platform
- tags: natural-sorting, sorting, string-processing, human-friendly-sorting, algorithms

## Member repositories
- SethMMorton/natsort (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:13.318583+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:11:43.675566+00:00, confidence not recorded.
  - readme: https://github.com/SethMMorton/natsort (fetched 2026-08-28T04:03:13.318583+00:00, sha 1fb822b92783)
  - homepage: https://pypi.org/project/natsort/ (fetched 2026-08-29T13:11:27.813938+00:00, sha 4b4e8fead74a)
  - registry_pypi: https://pypi.org/pypi/natsort/json (fetched 2026-08-29T13:11:27.817588+00:00, sha 8b2e7249480e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
