Python Forum

Full Version: How to use Bunch data structure
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
I'm trying to use Bunch data structure, and fail to find what import is needed in order to use it
I'm using Python 3.8
A complete working example will be greatly appreciated
any
Regards,
Moish
What is a bunch? Where does it come from?
It is not one of the standard libraries. You can install from PyPi.

https://pypi.org/project/bunch/

Description says bunch is a "A dot-accessible dictionary (a la JavaScript objects)". In other words you get a dictionary where you can add and access attributes using object.attribute instead of object['attribute'] if you want.