How To Install python-bunch on CentOS 7

In this tutorial we learn how to install python-bunch on CentOS 7. python-bunch is Python dictionary with attribute-style access

Introduction

In this tutorial we learn how to install python-bunch on CentOS 7.

What is python-bunch

python-bunch provides a python class which can perform as a dict whose keys are also accessible as attributes, similar to JavaScript objects. For instance »> import bunch »> people = bunch.Bunch({‘alice’ »> print people[‘alice’], people.alice here here The piece of python-bunch that sets it apart from similar modules found inside other projects is the bunchify() function which recursively converts from a dict to a Bunch »> multi_level = {‘array’ recursion’} ]} »> bunch.bunchify(multi_level) Bunch(array=[‘scalar’, Bunch(mapping=‘to show recursion’)])

We can use yum or dnf to install python-bunch on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python-bunch.

Install python-bunch on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python-bunch

Install python-bunch on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install python-bunch using dnf by running the following command:

sudo dnf -y install python-bunch

How To Uninstall python-bunch on CentOS 7

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

sudo dnf remove python-bunch

References

Summary

In this tutorial we learn how to install python-bunch on CentOS 7 using yum and dnf.