Skip to main content

JSON processor with Python one-liner

Project description

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

jqp

jqp is a JSON processor with Python one-liner.

Requirement

  • Python 2.7, 3.3, 3.4, 3.5

Install

$ pip install jqp

Usage

jqp parses each line as a JSON object, and evaluates a given expression. A parsed JSON object is bounded a variable named j.

jqp cmd
cmd:

An expression to evaluate.

optional arguments:
-h, --help

show this help message and exit

--version

show 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

Example

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

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jqp-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file jqp-0.1.0.tar.gz.

File metadata

  • Download URL: jqp-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jqp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36f2056806fb2f647f16297e610fd25fb829cc5d137b5c04735ca6191d675502
MD5 448164f8de8566e663c1fb85d5ad9ec5
BLAKE2b-256 db14150bb2d87ed605221ef93e7325fb465a1f93a4476a78eefe068f769831fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page