spiff-arena/spiffworkflow-backend/bin/task_data_to_python_variables.py
jasquat 59d19bb457
Rjsf typing is slow (#1663)
* updated rjsf packages w/ burnettk

* use performance improvement branch of validate js v8 w/ burnettk

* Update spiffworkflow-backend/bin/task_data_to_python_variables.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
Co-authored-by: Kevin Burnett <18027+burnettk@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-06-03 16:19:15 -07:00

27 lines
637 B
Python

import json
import sys
from spiffworkflow_backend import create_app
def main() -> None:
app = create_app()
task_data_json_file = sys.argv[1]
python_variable_file = f"{task_data_json_file}_output.py"
with app.app_context():
contents = None
with open(task_data_json_file) as file:
contents = json.load(file)
with open(python_variable_file, "w") as file:
for key, value in contents.items():
file.write(f"{key} = {repr(value)}\n")
if len(sys.argv) < 2:
raise Exception("A task data json file must be provided")
if __name__ == "__main__":
main()