datasette-jq-0.2.1
توضیحات
Datasette plugin that adds custom SQL functions for executing jq expressions against JSON values
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | datasette-jq-0.2.1 |
| نام | datasette-jq |
| نسخه کتابخانه | 0.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Simon Willison |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/simonw/datasette-jq |
| آدرس اینترنتی | https://pypi.org/project/datasette-jq/ |
| مجوز | Apache License, Version 2.0 |
# datasette-jq
[](https://pypi.org/project/datasette-jq/)
[](https://circleci.com/gh/simonw/datasette-jq)
[](https://github.com/simonw/datasette-jq/blob/master/LICENSE)
Datasette plugin that adds custom SQL functions for executing [jq](https://stedolan.github.io/jq/) expressions against JSON values.
Install this plugin in the same environment as Datasette to enable the `jq()` SQL function.
Usage:
select jq(
column_with_json,
"{top_3: .classifiers[:3], v: .version}"
)
See [the jq manual](https://stedolan.github.io/jq/manual/#Basicfilters) for full details of supported expression syntax.
## Interactive demo
You can try this plugin out at [datasette-jq-demo.datasette.io](https://datasette-jq-demo.datasette.io/)
Sample query:
select package, "https://pypi.org/project/" || package || "/" as url,
jq(info, "{summary: .info.summary, author: .info.author, versions: .releases|keys|reverse}")
from packages
[Try this query out](https://datasette-jq-demo.datasette.io/demo?sql=select+package%2C+%22https%3A%2F%2Fpypi.org%2Fproject%2F%22+%7C%7C+package+%7C%7C+%22%2F%22+as+url%2C%0D%0Ajq%28info%2C+%22%7Bsummary%3A+.info.summary%2C+author%3A+.info.author%2C+versions%3A+.releases%7Ckeys%7Creverse%7D%22%29%0D%0Afrom+packages) in the interactive demo.
نیازمندی
| مقدار | نام |
|---|---|
| - | datasette |
| - | pyjq |
| - | six |
| - | pytest |
نحوه نصب
نصب پکیج whl datasette-jq-0.2.1:
pip install datasette-jq-0.2.1.whl
نصب پکیج tar.gz datasette-jq-0.2.1:
pip install datasette-jq-0.2.1.tar.gz