import json
from types import SimpleNamespace
data = '{"$123": "456", "name": "John Smith", "hometown": {"name": "New York", "id": 123}}'
# Parse JSON into an object with attributes corresponding to dict keys.
x = json.loads(data, object_hook=lambda d: SimpleNamespace(**d))
print(x.name, x.hometown.name, x.hometown.id)
print(x.$123) # Errors can occur here
print(getattr(x.asdf[0], "$sdf")) # get variables.
from jsonpath import JSONPath
data = { "$aa": [{"$bb": "123"}] } # dict
field_data = "$.'$aa'[0].'$bb'"
a = JSONPath(field_data).parse(data)
print(a) # ['123']
https://stackoverflow.com/questions/6578986/how-to-convert-json-data-into-a-python-object
JSONPath.https://pypi.org/project/jsonpath-python/#examples