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

Last updated: November 26,2024

1. Install "python-natsort" package

This tutorial shows how to install python-natsort on Ubuntu 16.04 LTS (Xenial Xerus)

$ sudo apt update $ sudo apt install python-natsort

2. Uninstall "python-natsort" package

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

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

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

Package: python-natsort
Priority: optional
Section: universe/python
Installed-Size: 114
Maintainer: Ubuntu Developers
Original-Maintainer: Agustin Henze
Architecture: all
Source: natsort
Version: 4.0.3-2
Replaces: python-naturalsort
Depends: python:any (<< 2.8), python:any (>= 2.7.5-5~)
Recommends: python-natsort-doc
Conflicts: python-naturalsort
Breaks: python-naturalsort
Filename: pool/universe/n/natsort/python-natsort_4.0.3-2_all.deb
Size: 22906
MD5sum: 1e9fdc64bc4cad7fa61afdcb237520e3
SHA1: 7b718eba660572d6eba1e04f617a0d0e870cbae7
SHA256: 71127c164b9b84581cc144970cf2a66453ae2512142a554b4ed3a1d6325853a4
Description-en: Natural sorting for python
natsort lets you apply natural sorting to your sequences easily, for example:
.
>>> from natsort import natsorted
>>> a = ['a2', 'a9', 'a1', 'a4', 'a10']
>>> data = [['a1', 'a5'], ['a1', 'a40'], ['a10', 'a1'], ['a2', 'a5']]
>>> natsorted(a)
['a1', 'a2', 'a4', 'a9', 'a10'
>>> natsorted(data)
[['a1', 'a5'], ['a1', 'a40'], ['a2', 'a5'], ['a10', 'a1']]
.
natsort identifies the numbers and sorts them separately from strings.
.
natsort comes with a shell script to use natural sorting in shell scripts. You
can also execute natsort from the command line with python -m natsort.
.
There exists another natural sorting package for Python called
python-naturalsort. You may prefer that package if you wish to only sort
version numbers.
Description-md5: ae66c4b15095c0bc6eff2e91ddeae00a
Homepage: https://github.com/SethMMorton/natsort
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu