Browse Source

feat: json format release function

master
Dnomd343 2 years ago
parent
commit
4efb168200
  1. 20
      src/release/to-json.py
  2. 0
      src/release/to-txt.py

20
src/release/to-json.py

@ -0,0 +1,20 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import json
from common import loadData
def jsonRelease(metadata: dict, content: dict) -> str:
return json.dumps(
{
'metadata': metadata,
'content': content,
}, separators = (',', ':')
)
if __name__ == '__main__':
data = loadData(sys.argv[1])
print(jsonRelease(data['metadata'], data['content']))

0
src/release/txt.py → src/release/to-txt.py

Loading…
Cancel
Save