Use yamlscript.py as a drop-in replacement for your current YAML loader:
# program.py
from yamlscript import YAMLScript
import json
ys = YAMLScript()
# Load from file
input = open('config.yaml').read()
config = ys.load(input)
# Convert to JSON
print(json.dumps(config, indent=2))Install YAMLScript for Python and the libys.so shared library:
pip install yamlscript
curl -sSL https://yamlscript.org/install | bashSee https://yamlscript.org/doc/install/ for more info.
- Python 3.8 or higher