How To Install python-routes on Ubuntu 18.04

In this tutorial we learn how to install python-routes on Ubuntu 18.04. python-routes is Routing Recognition and Generation Tools

Introduction

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

What is python-routes

python-routes is:

Routes is a Python re-implementation of the Rails routes system for mapping URLs to Controllers/Actions and generating URLs. Routes makes it easy to create pretty and concise URLs that are RESTful with little effort.

Speedy and dynamic URL generation means you get a URL with minimal cruft (no big dangling query args). Shortcut features like Named Routes cut down on repetitive typing.

Current features:

  • Named Routes
  • Sophisticated Route lookup and URL generation
  • Wildcard path’s before and after static parts
  • Groupings syntax to allow flexible URLs to accommodate almost any need
  • Sub-domain support built-in
  • Conditional matching based on domain, cookies, HTTP method (RESTful), and more
  • Easily extensible utilizing custom condition functions and route generation functions
  • Extensive unit tests

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

sudo apt-get -y install python-routes

Install python-routes Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-routes

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

sudo aptitude -y install python-routes

How To Uninstall python-routes on Ubuntu 18.04

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

sudo apt-get remove python-routes

Uninstall python-routes And Its Dependencies

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

sudo apt-get -y autoremove python-routes

Remove python-routes Configurations and Data

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

sudo apt-get -y purge python-routes

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

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

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

References

Summary

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