"Struggling to python cast json as object – any tips?"
Hey folks!
So I’ve been messing around with some APIs and keep running into this issue—trying to python cast json as object in Python. I know `json.loads()` gets me a dict, but sometimes I wanna work with it like an actual object (dot notation, ya know?).
I’ve seen stuff like `namedtuple` or `SimpleNamespace`, but not sure what’s the cleanest way.
Any of you got a favorite method? Or is there a slick lib for this?
(Also, pls no "just use dicts" replies—I’m stubborn and wanna do it this way lol.)
Thanks in advance! 🚀
Hey folks!
So I’ve been messing around with some APIs and keep running into this issue—trying to python cast json as object in Python. I know `json.loads()` gets me a dict, but sometimes I wanna work with it like an actual object (dot notation, ya know?).
I’ve seen stuff like `namedtuple` or `SimpleNamespace`, but not sure what’s the cleanest way.
Any of you got a favorite method? Or is there a slick lib for this?
(Also, pls no "just use dicts" replies—I’m stubborn and wanna do it this way lol.)
Thanks in advance! 🚀
