只是一个对json文件中的键进行排序的小工具

json-sort的Python项目详细描述


https://travis-ci.org/cdumay/json-sort.svg?branch=master

json排序

只是一个对json文件中的键进行排序的小工具

快速启动

首先,使用 pip

sh-4.2$ pip install json-sort

接下来,使用json-sort-fromfilejson-sort-fromremote

sh-4.2$ json-sort-fromremote http://headers.jsontest.com/
{
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Host": "headers.jsontest.com",
    "User-Agent": "python-requests/2.10.0",
    "X-Cloud-Trace-Context": "8de3c28b6c503d26d38c1c7d6111bfa6/11298559371430510765"
}

参数

要查看二进制文件的用法,只需设置-h

usage: json-sort-fromfile [-h] [--output FILE] [--verbose] file

positional arguments:
  file                  input file

optional arguments:
  -h, --help            show this help message and exit
  --output FILE, -o FILE
                        output file (default: stdout)
  --verbose             increase output verbosity

示例:

sh-4.2$ json-sort-fromfile --verbose --output test2.json ../test.json
DEBUG   : Checking file: /tmp/test.json
DEBUG   : Saving to: /tmp/json-sort/test2.json

许可证

apache许可证2.0

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java NIO选择器最多只能选择50个SelectionKeys?   java阻止ImageButton创建新活动   为什么Java方法“Arrays.copyOf”处理中的整数数组与处理对象数组时的行为不同   java将安卓 1.6日历字段提取到vcal   将字符串转换为双精度后的java问题   java使用Webflux,是否可以使用AOP获取用于日志记录的ServerHttpRequest   java与jTextArea的基本区别是什么。setText()和jTextArea。append()方法?   java程序执行时间|将值保存到文件或数据结构?   java如何将表示字符的整数转换为字符串?   Java LWJGL新的渲染问题windows   java GUI提供异常   java创建第二个对象使类的函数不再工作   如何在java中将000验证为3位数字?   java bigO算法的时间复杂度,可以在不重复的情况下找到最长的子串   在30像素内点击按钮后,java在两个图像之间转换   java eclipse maven nexus不可解父pom   当存在其他SecurityConstraint时,java TransportGuary机密将被忽略   重新连接后激发的java Red5客户端流断开事件   javafx聊天应用程序中连接客户端的java问题