How To Install python-peak.rules on Ubuntu 18.04

In this tutorial we learn how to install python-peak.rules on Ubuntu 18.04. python-peak.rules is generic functions support for Python

Introduction

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

What is python-peak.rules

python-peak.rules is:

PEAK-Rules is a highly-extensible framework for creating and using generic functions in Python.

PEAK-Rules supports out of the box: multiple-dispatch on positional arguments using tuples of types, full predicate dispatch using strings containing Python expressions, and CLOS-like method combining. Additionally, PEAK-Rules allows one to mix and match dispatch engines and custom method combinations.

This package also provides some third party contribution over PEAK-Rules, in particular:

  • prioritized_methods - prioritize methods to resolve dispatch ambiguities

There are three methods to install python-peak.rules 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-peak.rules 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-peak.rules using apt-get by running the following command:

sudo apt-get -y install python-peak.rules

Install python-peak.rules Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-peak.rules

Install python-peak.rules 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-peak.rules using aptitude by running the following command:

sudo aptitude -y install python-peak.rules

How To Uninstall python-peak.rules on Ubuntu 18.04

To uninstall only the python-peak.rules package we can use the following command:

sudo apt-get remove python-peak.rules

Uninstall python-peak.rules And Its Dependencies

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

sudo apt-get -y autoremove python-peak.rules

Remove python-peak.rules Configurations and Data

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

sudo apt-get -y purge python-peak.rules

Remove python-peak.rules configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-peak.rules

References

Summary

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