使用toml文件的实用程序
jetblack-tomlutils的Python项目详细描述
喷气式飞机
一些用于处理toml文件的实用程序。在
使用
使用pip安装:
$ pip install jetblack-tomlutils
toml2json
要将toml转换为JSON:
^{pr2}$json2toml
要将JSON转换为toml:
usage: json2toml [<input> [<output]] input/output: either a path or '-'for stdin/stdout examples: $ json2toml < pyproject.json $ json2toml pyproject.json $ cat pyproject.toml | json2toml $ cat pyproject.toml | json2toml -
jsonget
查询JSON
可以使用JSON Pointer查询JSON
usage: jsonget <json-pointer> [<input> [<output>]] json-pointer: a valid JSON Pointer path input/output: either a path or '-'for stdin/stdout examples: $ toml2json pyproject.toml | jsonget /tool/poetry/version
J发病
更新JSON
可以使用JSON Pointer更新JSON 还有一个价值观
usage: jsonset <json-pointer> <json-value> [<input> [<output>]] json-pointer: a valid JSON Pointer path json-value: a value that can be parsed as JSON. input/output: either a path or '-'for stdin/stdout examples: $ toml2json pyproject.toml | jsonset /tool/poetry/version '"1.2.3"'
致谢
此项目是以下项目的简单包装:
- qtoml-一个toml解析器
- jsonpointer-一个JSON指针包
- 项目
标签: