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/r4k6cs4w86gngsr1h1avgxxkkvlk2g05-python-natsort-5.4.1.drv | ||
mips64el-linux | /gnu/store/kid37xpa0c88yky4cn4q5jr0jv5wgw7l-python-natsort-5.4.1.drv | ||
i686-linux | /gnu/store/9cla62w1kb741drzvmjvxqxap43vfg08-python-natsort-5.4.1.drv | ||
armhf-linux | /gnu/store/9fs7cbrxmwkp7mdmbxwghasjisi2lhsy-python-natsort-5.4.1.drv | ||
aarch64-linux | /gnu/store/xpp66b5wz7mqc30j42hdflz7c05zhb93-python-natsort-5.4.1.drv |
Linter | Message | Location |
---|---|---|
No lint warnings ✓ |