Python Forum
How to use Bunch data structure - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to use Bunch data structure (/thread-31637.html)



How to use Bunch data structure - moish - Dec-24-2020

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


RE: How to use Bunch data structure - ndc85430 - Dec-24-2020

What is a bunch? Where does it come from?


RE: How to use Bunch data structure - deanhystad - Dec-24-2020

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.