mirror of
https://github.com/YunoHost-Apps/mautrix_signal_ynh.git
synced 2024-09-03 19:46:07 +02:00
19 lines
234 B
Python
19 lines
234 B
Python
|
#!/usr/bin/python
|
||
|
|
||
|
# Usage: yaml2json.py <file>
|
||
|
|
||
|
import sys
|
||
|
import yaml
|
||
|
import json
|
||
|
|
||
|
|
||
|
assert len(sys.argv) == 2, "Expected a file as argument"
|
||
|
|
||
|
|
||
|
with open(sys.argv[1], "r") as f:
|
||
|
y = yaml.safe_load(f)
|
||
|
|
||
|
j = json.dumps(y)
|
||
|
|
||
|
print(j)
|