jmespath.pl

Build Status Coverage Status CPAN version

Repository for the Jmespath for Perl implementation.

See the Changes file for release notes.

About

JMESPath is a query language for JSON. This repository is the JMESPath implementation for the Perl programming language.

Installation

Although you can install from Github, certainly the better way is to install using CPAN.

$ cpan Jmespath

Usage

JMESPath releases with the command line utility jp.

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    perl -I lib/ script/jp email
"["riche@cpan.org"]"

To remove the quotes, use the JP_UNQUOTED environment variable.

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp email
["riche@cpan.org"]

Rather,

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp email[0]
riche@cpan.org

With full JMESPath compliance, for example:

$  curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp "email[0].length(@)"
14