git @ Cat's Eye Technologies Dipple / master python / unyaml-links.py
master

Tree @master (Download .tar.gz)

unyaml-links.py @masterraw · history · blame

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

import yaml
try:
    from yaml import CLoader as Loader
except ImportError:
    from yaml import Loader

with open('LINKS.md', 'r') as file_:
    config = yaml.load(file_, Loader=Loader)

for link in config['links']:
    print("*   [{}]({}) - {}".format(link.get('title', 'LINK'), link.get('url', ''), link.get('description', '')))