summaryrefslogtreecommitdiff
path: root/_example/small.py
blob: 2dd72f932ae892830dbc2f7a80c045cfc05d45f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys
from ruamel.yaml import YAML

inp = """\
# example
name:
  # details
  family: Smith   # very common
  given: Alice    # one of the siblings
"""

yaml = YAML()
code = yaml.load(inp)
code['name']['given'] = 'Bob'

yaml.dump(code, sys.stdout)