一行python的json处理器

jqp的Python项目详细描述


https://img.shields.io/pypi/v/jqp.svghttps://travis-ci.org/unnonouno/jqp.svg?branch=masterhttps://coveralls.io/repos/unnonouno/jqp/badge.png?branch=master

JQP

jqp是一个带有python一行程序的json处理器。

要求

  • python 2.7、3.3、3.4、3.5

安装

$ pip install jqp

使用量

jqp将每一行解析为json对象,并计算给定的表达式。 解析的json对象被一个名为j的变量绑定。

jqp cmd
cmd:An expression to evaluate.
可选参数:
-h, --helpshow this help message and exit
--versionshow version and exit
--import IMPORT
modules to import
--ascii-output, -a
with this option, jqp ensures ASCII output
--sort-keys, -S
sort keys in objects when the command print it
--raw-input, -R
pass each line text as a string instead of parsing it as JSON
--raw-output, -r
when a result is string, the command shows a raw string
--join-output, -j
do not show newlines

示例

% echo '{"name": "Taro", "age": 10}' | jqp '[j["name"], j["age"]]'
["Taro", 10]

许可证

麻省理工学院许可证

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

推荐PyPI第三方库


热门话题
写入远程文件java   在java中尝试播放音频时出现音频流错误。wav文件   用户界面如何在Java中禁用GUI按钮   在java中如何使用条件拆分字符串   java从一个方法在数组中设置,从另一个方法获取   java如何忽略“”而不是“”   java证书。木卫一。IOException:密钥库被篡改,或密码不正确   java Android onCreate不调用   在play framework(i18n)中未正确显示德语Umlautes的java显示   使用java从eclipse运行MacOSX命令的macos   java是检查数组中备用项的最有效方法   如何使用java流编写包含循环、if/else和返回语句的代码   为什么在Java中,循环内的声明似乎比循环外的声明更快?   java软件包不存在mvn clean install