Add devterm tools and TUI menu
Some checks failed
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
CI / test (3.10) (push) Has been cancelled
Some checks failed
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled
CI / test (3.10) (push) Has been cancelled
This commit is contained in:
11
devterm/tools/json_tool.py
Normal file
11
devterm/tools/json_tool.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
def format_json(data: str, indent: int = 2) -> str:
|
||||||
|
parsed = json.loads(data)
|
||||||
|
return json.dumps(parsed, indent=indent)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_json(data: str) -> bool:
|
||||||
|
json.loads(data)
|
||||||
|
return True
|
||||||
Reference in New Issue
Block a user