How to Install and Uninstall python-naturalsort Package on Ubuntu 16.04 LTS (Xenial Xerus)

Last updated: May 13,2024

1. Install "python-naturalsort" package

Here is a brief guide to show you how to install python-naturalsort on Ubuntu 16.04 LTS (Xenial Xerus)

$ sudo apt update $ sudo apt install python-naturalsort

2. Uninstall "python-naturalsort" package

This is a short guide on how to uninstall python-naturalsort on Ubuntu 16.04 LTS (Xenial Xerus):

$ sudo apt remove python-naturalsort $ sudo apt autoclean && sudo apt autoremove

3. Information about the python-naturalsort package on Ubuntu 16.04 LTS (Xenial Xerus)

Package: python-naturalsort
Priority: optional
Section: universe/python
Installed-Size: 50
Maintainer: Ubuntu Developers
Original-Maintainer: Cyril Bouthors
Architecture: all
Version: 1.0.3-1.1
Depends: python (>= 2.7), python (<< 2.8), python:any (>= 2.7.1-0ubuntu2)
Filename: pool/universe/p/python-naturalsort/python-naturalsort_1.0.3-1.1_all.deb
Size: 5688
MD5sum: 0e037b55238df067dd5f0bd996b1e13d
SHA1: 9fc542d840ed031476db0e69d5be39295e852d48
SHA256: 10e8817dd6e62f76aa0a951a1e5e29c60810f8f44c1424c8d63e18781536c2f6
Description-en: Simple natural order sorting API for Python that just works
The ``natsort.natsort()`` function in the ``naturalsort`` package is a very
simple alternative to Python's ``sorted()`` function that implements `natural
order sorting`_ in Python. The package is available on PyPI, so getting started
is very simple:
.
$ pip install naturalsort
$ python
> from natsort import natsort
> versions = ['1.8.1-r26', '1.8.1-r30', '2.0-r2', '2.0-r7', '2.0-r11']
> natsort(['my-package-%s' % v for v in versions])
['my-package-1.8.1-r26',
'my-package-1.8.1-r30',
'my-package-2.0-r2',
'my-package-2.0-r7',
'my-package-2.0-r11']
.
The main use case that this package was originally created for is sorting of
pathnames with versions numbers embedded in them. This is why the sorting key
defined by the ``naturalsort`` package ignores filename extensions (not doing
so can give unexpected results).
Description-md5: a0b256bde8f42b84f8a4a96265e62587
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu