jsonselect (http://jsonselect.org/) 的Python实现
项目描述
#jsonselect.py
<img src="https://travis-ci.org/mwhooker/jsonselect.png" />
jsonselect.py 是 https://github.com/fd/json_select 的 Python 实现
更多信息请访问 http://jsonselect.org/
## 使用方法
jsonselect 可以直接从命令行调用。
`python -m jsonselect <selector> < jsonfile`
这在解析 JSON API 中的值时非常有用。
```sh
$aws ec2 describe-instances --filters "Name=tag:Name,Values=kafka" | python -m jsonselect .InstanceId
["i-12345678", "i-23456789", "i-3456789A"]
```
### 完整用法
```
用法: __main__.py [-h] [--list | --machine-readable] selector [infile]
使用 jsonselect 解析 JSON。
位置参数
selector
infile
可选参数
-h, --help 显示此帮助信息并退出
--list, -l 以换行符分隔的值列表。在列表上效果最佳。
--machine-readable 不带格式地打印 JSON
```
## 项目状态
jsonselect.py 目前实现了这些一致性测试的 1 & 2 级 https://github.com/lloyd/JSONSelectTests
第 3 级未实现,因为我难以理解正确的行为应该是什么
## 测试
获取上游一致性测试
git submodule update --init
使用以下命令运行特定级别的测试
nosetests -m '.*_level_1' ./tests/test_conformance.py
<img src="https://travis-ci.org/mwhooker/jsonselect.png" />
jsonselect.py 是 https://github.com/fd/json_select 的 Python 实现
更多信息请访问 http://jsonselect.org/
## 使用方法
jsonselect 可以直接从命令行调用。
`python -m jsonselect <selector> < jsonfile`
这在解析 JSON API 中的值时非常有用。
```sh
$aws ec2 describe-instances --filters "Name=tag:Name,Values=kafka" | python -m jsonselect .InstanceId
["i-12345678", "i-23456789", "i-3456789A"]
```
### 完整用法
```
用法: __main__.py [-h] [--list | --machine-readable] selector [infile]
使用 jsonselect 解析 JSON。
位置参数
selector
infile
可选参数
-h, --help 显示此帮助信息并退出
--list, -l 以换行符分隔的值列表。在列表上效果最佳。
--machine-readable 不带格式地打印 JSON
```
## 项目状态
jsonselect.py 目前实现了这些一致性测试的 1 & 2 级 https://github.com/lloyd/JSONSelectTests
第 3 级未实现,因为我难以理解正确的行为应该是什么
## 测试
获取上游一致性测试
git submodule update --init
使用以下命令运行特定级别的测试
nosetests -m '.*_level_1' ./tests/test_conformance.py
项目详情
关闭
jsonselect-0.2.3.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 95765eb47ba7b114f08cf411511b6a4137302005c8e7789c263747a54c09440a |
|
MD5 | b2fc1e9910d3c2a0b27977b6e74b4ef0 |
|
BLAKE2b-256 | de56d4753e9bc7495b24f462d1fb050849065a8efc6905b45ee851cd4cdc2c54 |