mirror of
https://github.com/alerta/alerta.git
synced 2025-01-24 17:29:39 +00:00
12 lines
No EOL
232 B
Python
12 lines
No EOL
232 B
Python
from bunch import Bunch, bunchify, unbunchify
|
|
import json
|
|
import yaml
|
|
|
|
b = Bunch()
|
|
|
|
b = bunchify({'foo': 'bar', 'baz': ['qqr', 'abc'], 'ppp': {'a': 'b', 'c': 'd'}})
|
|
|
|
print b
|
|
print json.dumps(b)
|
|
print yaml.dump(b)
|
|
print unbunchify(b) |