structurediff是用于结构化数据文件的diff实用程序
structurediff的Python项目详细描述
structurediff是一个使用DeepDiff的工具(实际上是一个命令行包装器) 为“diffing”提供一个简单的命令行实用程序(在 比基于行的级别)大型yaml和/或json文件(意味着它可以区分yaml 针对yaml,或针对json的yaml,或针对json的json)。
structurediff对两个json都使用pyyaml解析器 以及yaml来解决字符串的unicode化问题。作为一个 不能依赖Result StructureDiff来区分Unicode json和yaml之间的非unicode类型。
贡献
直接联系(或者提交补丁或合并请求)。我试着留意 打开。
待办事项
此代码没有测试。应该有一些。
如何
在命令行中:
usage: structurediff [-h] [-d DIFF_VERBOSITY] [-i INDENT_LEVEL] [-v] input1 input2 positional arguments: input1 initial input input2 input to compare against input1 optional arguments: -h, --help show this help message and exit -d DIFF_VERBOSITY, --diff-verbosity DIFF_VERBOSITY set the DeepDiff verbose_level, 0-2 (default 1) -i INDENT_LEVEL, --indent-level INDENT_LEVEL set the pprint indent spacing (default 2) -v, --verbose make output verbose_level
在python中(为什么要这样做?改为使用deepdiff!):
from structurediff import DataComparison, DataFile comparison = DataComparison(DataFile(PATH), DataFile(PATH), VERBOSITY) print(comparison)