I’m trying load a yaml file and access elements from it by a /
delimited string.
Sample yaml file:
foo:
bar:
baz: qux
corge: waldo
I’m loading that file with:
import yaml
data = yaml.load(open(yamlfile), Loader=yaml.FullLoader)
I can then access quz
with
data['foo']['bar']['baz']
But is there a way to access it by a delimited string, something like this?
data.get_by_full_path('/foo/bar/baz')