puudot/code/db.py
Lauri Koskenniemi 5c218c68c4 Introduce database code and remove unused block key
All code should be done within the new code directory.
Created db.py for reading the YAML file.

Removed block key from blocks; always a None value.
2025-05-24 12:06:23 +03:00

17 lines
296 B
Python

import json
import yaml
DATA="../data/styrman-blocks.yml"
def load_yaml(filename):
with open(filename, 'r') as f:
return yaml.safe_load(f)
def main():
data = load_yaml(DATA)
json_data = json.dumps(data, indent=2)
print(json_data)
if __name__ == "__main__":
main()