Skip to content

Instantly share code, notes, and snippets.

@auxiliary-character
Created July 18, 2017 23:54
Show Gist options
  • Save auxiliary-character/fd8993d5144424f47289678fee8e2ef9 to your computer and use it in GitHub Desktop.
Save auxiliary-character/fd8993d5144424f47289678fee8e2ef9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import yaml
from pprint import pprint
yaml_code = """
Example:
name: "Example"
timestamp: 1500421023
nested:
- name: "Part 1"
content: "Stuff"
- name: "Part 2"
content: "Things"
- name: "Part 3"
content: "More Stuff"
meta:
count: 64
color:
red: 234
green: 138
blue: 4
"""
def main():
decoded = yaml.load(yaml_code)
pprint(decoded)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment