How To Install python-unidecode on Ubuntu 18.04

In this tutorial we learn how to install python-unidecode on Ubuntu 18.04. python-unidecode is ASCII transliterations of Unicode text (Python module)

Introduction

In this tutorial we learn how to install python-unidecode on Ubuntu 18.04.

What is python-unidecode

python-unidecode is:

It often happens that you have text data in Unicode, but you need to represent it in ASCII for display. One could represent non-roman Unicode characters as “???” or “\15BA\15A0\1610”, but neither is useful to the user reading the text.

Unidecode tries to represent it in ASCII characters (i.e., the universally displayable characters between 0x00 and 0x7F), where the compromises taken when mapping between two character sets are chosen to be near what a human with a US keyboard would choose.

This module generally produces better results than simply stripping accents from characters (which can be done in Python with built-in functions). It is based on hand-tuned character mappings that for example also contain ASCII approximations for symbols and non-Latin alphabets.

unidecode is a Python port of the Text::Unidecode Perl module.

There are three methods to install python-unidecode on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-unidecode Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-unidecode using apt-get by running the following command:

sudo apt-get -y install python-unidecode

Install python-unidecode Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-unidecode using apt by running the following command:

sudo apt -y install python-unidecode

Install python-unidecode Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-unidecode using aptitude by running the following command:

sudo aptitude -y install python-unidecode

How To Uninstall python-unidecode on Ubuntu 18.04

To uninstall only the python-unidecode package we can use the following command:

sudo apt-get remove python-unidecode

Uninstall python-unidecode And Its Dependencies

To uninstall python-unidecode and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-unidecode

Remove python-unidecode Configurations and Data

To remove python-unidecode configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-unidecode

Remove python-unidecode configuration, data, and all of its dependencies

We can use the following command to remove python-unidecode configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-unidecode

References

Summary

In this tutorial we learn how to install python-unidecode package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.