v2.8.0
===================================================================== --- Changes ------------------------------ - python library functions moved to `py/lib` - python scwrypts renamed in kebob-case to help prevent import - __name__ == '__main__' enforced on all python scwrypts --- New Features ------------------------- - `__override` variables now allow values to be force-overwritten - py.lib.http.client provides a slim `requests.request` wrapper --- New Scripts -------------------------- py/data/convert ) quick data converters - csv-to-json - csv-to-yaml - json-to-csv - json-to-yaml - yaml-to-csv - yaml-to-json py/linear ) uses the linear.app graphql API for PM tasks - comment --- Bug Fixes ---------------------------- - `scwrypts` handles arguments with quotes and special characters
This commit is contained in:
21
py/data/convert/yaml-to-json.py
Executable file
21
py/data/convert/yaml-to-json.py
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from py.lib.data.io import add_io_arguments
|
||||
from py.lib.data.converter import convert
|
||||
|
||||
if __name__ != '__main__':
|
||||
raise Exception('executable only; must run through scwrypts')
|
||||
|
||||
|
||||
parser = ArgumentParser(description = 'converts yaml into json')
|
||||
add_io_arguments(parser)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
convert(
|
||||
input_file = args.input_file,
|
||||
input_type = 'yaml',
|
||||
output_file = args.output_file,
|
||||
output_type = 'json',
|
||||
)
|
Reference in New Issue
Block a user