For Python, glom is a great package for this sort of nested data access. The happy path from the intro docs looks like this:
from glom import glom target = {'a': {'b': {'c': 'd'}}} glom(target, 'a.b.c') # returns 'd'
That 'a.b.c' bit is a simple glom specifier, but it can get much wilder! Glom provides more advanced specifiers for features like:
'a.b.c'
And you can always plug in your own code or extend glom even further. Simple to get started, but a long fun road to travel from there!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For Python, glom is a great package for this sort of nested data access. The happy path from the intro docs looks like this:
That
'a.b.c'
bit is a simple glom specifier, but it can get much wilder! Glom provides more advanced specifiers for features like:And you can always plug in your own code or extend glom even further. Simple to get started, but a long fun road to travel from there!