Natural sorting for python and shell
Natsort lets you apply natural sorting on lists instead of lexicographical. If you use the built-in sorted
method in python on a list such as [
, it would be returned as a20
, a9
, a1
, a4
, a10
][
. Natsort provides a function a1
, a10
, a20
, a4
, a9
]natsorted
that identifies numbers and sorts them separately from strings. It can also sort version numbers, real numbers, mixed types and more, and comes with a shell command natsort
that exposes this functionality in the command line.
System | Target | Derivation | Build status |
---|---|---|---|
x86_64-linux | /gnu/store/pirs1hmxkaxm2md0q06k2vjxfzh5z02h-python-natsort-7.0.1.drv | ||
powerpc64le-linux | /gnu/store/6nacknh0bk8vi4jg5n52lhjb7ncfl1jp-python-natsort-7.0.1.drv | ||
mips64el-linux | /gnu/store/xknivydyw5w2irxx6qpmzk6x5ghlv3hw-python-natsort-7.0.1.drv | ||
i686-linux | /gnu/store/rja5mffj5wyw6frcvphs0fzgpczwaacf-python-natsort-7.0.1.drv | ||
i586-gnu | /gnu/store/0lhrhw6igwh3g4v3sgh25am0cdmrs4hf-python-natsort-7.0.1.drv | ||
armhf-linux | /gnu/store/v5n3b8nxwzb3d60xn1d0kcx7ghmnz5aa-python-natsort-7.0.1.drv | ||
aarch64-linux | /gnu/store/m1gfd46nlwm0x8qpwycrp120aikhq4i0-python-natsort-7.0.1.drv |
Linter | Message | Location |
---|---|---|
No lint warnings ✓ |