Coder Social home page Coder Social logo

jp's Introduction

JMESPath

JMESPath (pronounced "james path") allows you to declaratively specify how to extract elements from a JSON document.

For example, given this document:

{"foo": {"bar": "baz"}}

The jmespath expression foo.bar will return "baz".

JMESPath also supports:

Referencing elements in a list. Given the data:

{"foo": {"bar": ["one", "two"]}}

The expression: foo.bar[0] will return "one". You can also reference all the items in a list using the * syntax:

{"foo": {"bar": [{"name": "one"}, {"name": "two"}]}}

The expression: foo.bar[*].name will return ["one", "two"]. Negative indexing is also supported (-1 refers to the last element in the list). Given the data above, the expression foo.bar[-1].name will return "two".

The * can also be used for hash types:

{"foo": {"bar": {"name": "one"}, "baz": {"name": "two"}}}

The expression: foo.*.name will return ["one", "two"].

Installation

You can install JMESPath from pypi with:

pip install jmespath

API

The jmespath.py library has two functions that operate on python data structures. You can use search and give it the jmespath expression and the data:

>>> import jmespath
>>> path = jmespath.search('foo.bar', {'foo': {'bar': 'baz'}})
'baz'

Similar to the re module, you can use the compile function to compile the JMESPath expression and use this parsed expression to perform repeated searches:

>>> import jmespath
>>> expression = jmespath.compile('foo.bar')
>>> expression.search({'foo': {'bar': 'baz'}})
'baz'
>>> expression.search({'foo': {'bar': 'other'}})
'other'

This is useful if you're going to use the same jmespath expression to search multiple documents. This avoids having to reparse the JMESPath expression each time you search a new document.

Options

You can provide an instance of jmespath.Options to control how a JMESPath expression is evaluated. The most common scenario for using an Options instance is if you want to have ordered output of your dict keys. To do this you can use either of these options:

>>> import jmespath
>>> jmespath.search('{a: a, b: b}',
...                 mydata,
...                 jmespath.Options(dict_cls=collections.OrderedDict))


>>> import jmespath
>>> parsed = jmespath.compile('{a: a, b: b}')
>>> parsed.search(mydata,
...               jmespath.Options(dict_cls=collections.OrderedDict))

Custom Functions

The JMESPath language has numerous built-in functions, but it is also possible to add your own custom functions. Keep in mind that custom function support in jmespath.py is experimental and the API may change based on feedback.

If you have a custom function that you've found useful, consider submitting it to jmespath.site and propose that it be added to the JMESPath language. You can submit proposals here.

To create custom functions:

  • Create a subclass of jmespath.functions.Functions.
  • Create a method with the name _func_<your function name>.
  • Apply the jmespath.functions.signature decorator that indicates the expected types of the function arguments.
  • Provide an instance of your subclass in a jmespath.Options object.

Below are a few examples:

import jmespath
from jmespath import functions

# 1. Create a subclass of functions.Functions.
#    The function.Functions base class has logic
#    that introspects all of its methods and automatically
#    registers your custom functions in its function table.
class CustomFunctions(functions.Functions):

    # 2 and 3.  Create a function that starts with _func_
    # and decorate it with @signature which indicates its
    # expected types.
    # In this example, we're creating a jmespath function
    # called "unique_letters" that accepts a single argument
    # with an expected type "string".
    @functions.signature({'types': ['string']})
    def _func_unique_letters(self, s):
        # Given a string s, return a sorted
        # string of unique letters: 'ccbbadd' ->  'abcd'
        return ''.join(sorted(set(s)))

    # Here's another example.  This is creating
    # a jmespath function called "my_add" that expects
    # two arguments, both of which should be of type number.
    @functions.signature({'types': ['number']}, {'types': ['number']})
    def _func_my_add(self, x, y):
        return x + y

# 4. Provide an instance of your subclass in a Options object.
options = jmespath.Options(custom_functions=CustomFunctions())

# Provide this value to jmespath.search:
# This will print 3
print(
    jmespath.search(
        'my_add(`1`, `2`)', {}, options=options)
)

# This will print "abcd"
print(
    jmespath.search(
        'foo.bar | unique_letters(@)',
        {'foo': {'bar': 'ccbbadd'}},
        options=options)
)

Again, if you come up with useful functions that you think make sense in the JMESPath language (and make sense to implement in all JMESPath libraries, not just python), please let us know at jmespath.site.

Specification

If you'd like to learn more about the JMESPath language, you can check out the JMESPath tutorial. Also check out the JMESPath examples page for examples of more complex jmespath queries.

The grammar is specified using ABNF, as described in RFC4234. You can find the most up to date grammar for JMESPath here.

You can read the full JMESPath specification here.

Testing

In addition to the unit tests for the jmespath modules, there is a tests/compliance directory that contains .json files with test cases. This allows other implementations to verify they are producing the correct output. Each json file is grouped by feature.

Discuss

Join us on our Gitter channel if you want to chat or if you have any questions.

jp's People

Contributors

brianolson avatar flisky avatar issaclin32 avatar jamesls avatar kakakakakku avatar masyukun avatar odidev avatar petruisfan avatar vdm avatar zmedico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jp's Issues

Error when expression end with a number

When I try do execute the following code it throws an error:

curl https://coreos.com/dist/aws/aws-stable.json -sS | jp "eu-central-1"

SyntaxError: Unexpected token at the end of the expresssion: tNumber
eu-central-1
  ^

Am I missing something obvious here?

EDIT: using latest version changed the error message

Streaming Json Blobs

Hello,

Thank you for this. On individual JSON blobs it works well.

I usually deal with streams of JSON bobs, usually one JSON blob per line, but as jp reads only the first blob and then exits I have to write a bash loop that runs a separate process on each blob as it comes in. Needles to say this is very slow, not to mention inconvenient.

What do you think of reading a stream of blobs from stdin? This behaviour can always be behind a flag to keep current behaviour in the probably rare case of users are making use of the fact that only the first blob is processed.

Best wishes, Max

will not install with homebrew

Title kinda says it all:

-> % brew install jmespath/jmespath/jp
Error: jmespath/jmespath/jp: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the jmespath/jmespath tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/jmespath/homebrew-jmespath/Formula/jp.rb:8

I tried removing the line in question, but got a different error saying Error: Your Command Line Tools are too outdated. - I upgraded those and tried again and it installed.

README example fails

The README includes the following example:

$ echo '{"foo": {"bar": ["a", "b", "c"]}}' | jp foo.bar[1]
"b"

On Mac, this fails as follows:

$ echo '{"foo": {"bar": ["a", "b", "c"]}}' | jp foo.bar[1]
2020/02/19 10:35:50 line.go:44: no valid y values given

Bug: Segmentation fault on Apple M1 when running jp

Description:
I'm working with some json output that I want to filter out using jp, but when running filtering via the jp tool I receive segmentation fault.

Command:
echo '{"key": "value"}' | jp key

Expected behavior:
echo '{"key": "value"}' | jp key -> returns "values"

Actual behavior:
zsh: done echo '{"key": "value"}' |
zsh: segmentation fault jp key

Additional info:

  • have tried with and without Rosetta enabled on the Terminal
  • tried also with sudo
  • using Apple M1 MacBook Pro

GPG key expired?

You might need to update your GPG key @jamesls ?

Import the key used to sign the binary package checksums:

gpg --keyserver hkps://keyserver.ubuntu.com --search-keys A0BE6CFACEC3BE69CAD146BBCD2646EDDCC1FDB6 

Download and check the checksums:

wget https://github.com/jmespath/jp/releases/download/0.2.1/jp-checksums.sha256.asc
gpg --verify jp-checksums.sha256.asc
gpg: Signature made Thu 30 Sep 2021 19:25:21 BST
gpg:                using RSA key A0BE6CFACEC3BE69CAD146BBCD2646EDDCC1FDB6
gpg: Good signature from "James Saryerwinnie <[email protected]>" [expired]
gpg: Note: This key has expired!
Primary key fingerprint: A0BE 6CFA CEC3 BE69 CAD1  46BB CD26 46ED DCC1 FDB6

fails compliance tests for benchmarks, functions, literal, and syntax.

Go version of jmespath is failing compliance tests in the following suites: benchmarks, functions, literal, and syntax.

The python version fails only in benchmarks suite.

See also: jmespath/go-jmespath#33

% jp -v
jp version 0.1.3

% jp-compliance -e jp -t benchmarks
'error'

% jp-compliance -e jp -t functions
.................
FAIL functions,0,17
The expression: avg(empty_list)
was suppose to give: null
for the JSON: {"foo": -1, "zero": 0, "numbers": [-1, 3, 4, 5], "array": [-1, 3, 4, 5, "a", "100"], "strings": ["a", "b", "c"], "decimals": [1.01, 1.2, -1.5], "str": "Str", "false": false, "empty_list": [], "empty_hash": {}, "objects": {"foo": "bar", "bar": "baz"}, "null_key": null}
but instead gave: ""
..........................................................................................................................................................
FAIL

% jp-compliance -e jp -t literal
........................................
FAIL literal,2,12
The expression: '\\'
was suppose to give: "\\\\"
for the JSON: {}
but instead gave: ""
FAIL

% jp-compliance -e jp -t syntax
...............................................
FAIL syntax,8,1
The expression: [:::]
was suppose to have non zero for error error: syntax
but instead gave rc of: 0, stderr: 
.....................................................................................
OK

homebrew tap uses deprecated option

After installing it via homebrew, every time I use it it shows this error message:

Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the jmespath/jmespath tap (not Homebrew/brew or Homebrew/core):
  /path/to/Homebrew/Library/Taps/jmespath/homebrew-jmespath/Formula/jp.rb:8

GPG public key for checksums

Is this the correct GPG public key for checking the checksums file?

gpg --search-keys A0BE6CFACEC3BE69CAD146BBCD2646EDDCC1FDB6
gpg: data source: https://keys.openpgp.org:443
(1)	 4096 bit RSA key CD2646EDDCC1FDB6, created: 2012-07-26
Keys 1-1 of 1 for "A0BE6CFACEC3BE69CAD146BBCD2646EDDCC1FDB6".  Enter number(s), N)ext, or Q)uit > 1
gpg: key CD2646EDDCC1FDB6: new key but contains no user ID - skipped
gpg: Total number processed: 1
gpg:           w/o user IDs: 1

If so how do you import it to then use it to check the files when it has no user ID?

Example Usage is incorrect.

Operating System: OSX El Capitan
➜ ~ uname -a
Darwin USHOLAFU1-ML 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

➜ ~ jp --version
jp version 0.1.1

Following works.

➜ ~ echo '{"foo": {"bar": ["a", "b", "c"]}}' | jp foo.bar
[ "a", "b", "c" ]

Following does not work.
➜ ~ echo '{"foo": {"bar": ["a", "b", "c"]}}' | jp foo.bar[0]
Must provide at least one argument.

brew install fails on macOS Sierra

https://github.com/jmespath/jp#installing fails with the following on macOS Sierra (Version 10.12) with the following:

$ brew install jp --debug
/usr/local/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Library/Taps/jmespath/homebrew-jmespath/Formula/jp.rb
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing jp from jmespath/jmespath
/usr/local/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Library/Taps/homebrew/homebrew-core/Formula/go.rb
go: This formula either does not compile or function as expected on OS X
versions newer than El Capitan due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
/usr/local/Library/Homebrew/formula_installer.rb:325:in `check_requirements'
/usr/local/Library/Homebrew/formula_installer.rb:291:in `compute_dependencies'
/usr/local/Library/Homebrew/formula_installer.rb:131:in `verify_deps_exist'
/usr/local/Library/Homebrew/formula_installer.rb:124:in `prelude'
/usr/local/Library/Homebrew/cmd/install.rb:271:in `install_formula'
/usr/local/Library/Homebrew/cmd/install.rb:150:in `block in install'
/usr/local/Library/Homebrew/cmd/install.rb:150:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:150:in `install'
/usr/local/Library/Homebrew/brew.rb:87:in `<main>'
VIC011967M:~ nitin.sharma 01:11 PM
$ brew install -v jp
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing jp from jmespath/jmespath
go: This formula either does not compile or function as expected on OS X
versions newer than El Capitan due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.

For now, I decided to download jp-darwin-amd64 from https://github.com/jmespath/jp/releases/tag/0.1.2 and placed it as /usr/local/bin/jp also chmod'ing it to +x.

quote type matters

Given input of :

{
  "machines": [
    {"name": "a", "state": "running"},
    {"name": "b", "state": "stopped"},
    {"name": "b", "state": "running"}
  ]
}

I would expect these 2 commands to give the same result, but they don't.

$ cat toto3.json  | jp 'machines[?state == "running"].name'
[]
$ cat toto3.json  | jp "machines[?state == 'running'].name"
[
  "a",
  "b"
]

Single quotes are specifically mentioned as being the recommended approach due to shell escapes, but plainly they don't work the way that might (naively?) be expected.

jp for ARM7 cross-compiles and passes all tests under go 1.5 (Raspberry Pi 2)

I was able to get a running binary of jp for the Raspberry Pi by cross-compiling on my Mac and then scp'ing the binary over. The invocation on the Mac was

env GOOS=linux GOARCH=arm GOARM=7 go build -o jp.arm7
scp jp.arm7 [email protected]:src/jp/jp

The resulting binary passes all 9 tests in the test suite.

I cross-compiled in part because I wasn't able to get jp to build using the go provided when I did an apt-get install golang on the Pi 2; that reports out as go version go1.0.2. That build fails with this error:

/usr/lib/go/src/pkg/github.com/jmespath/jp/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go:771: syntax error: unexpected :, expecting ]

which I am guessing is a little syntax difference between go 1.0.2 and later versions of go.

Provide normal unix-like text output

There doesn't seem to be any way to output a flat list as a set of lines. Perhaps the -u option should handle flat lists this way, or we could have some other option, or even a jmespath function like 'echo' so that you could do something like:

jp 'foo.bar[] | echo(@)' -f foo.json

where foo.json like:

{
  "foo": {
    "bar": [
      "bang",
      "bling",
      "baz"
    ],
    "zow": ...
  }
}

we would get:

bang
bling
baz

which is suitable for bash loops and xargs and the like.

Apologies if I've missed what should have been an obvious way to achieve this.

Not Equal modifier not working

Using the below query I get the expected results, but when replacing == with != it breaks and includes all SnapshotId's. Using != to fix parsing error.
Snapshots[?Tags[?Key=='Migration']].SnapshotId

I am able to get expression working correctly with the following but does seem like an extra step.
Snapshots[?!not_null(Tags[?Key == Migration].Value)].SnapshotId

Feature request: just pretty-print (ie. identity transform)

An underappreciated feature of jq is simply using it to pretty-print compact JSON such as jq . compact.json.

Is there a jp equivalent? I tried cat compact.json | jp @ but that did not do what I expected, probably owing to my having learned JMESPath only a couple hours ago and still finding my legs.

The current release 0.2.1 has known critical trivy vulnerabilities

The current release available (0.2.1) has the following CVE's detected:

usr/local/bin/jp (gobinary)
===========================
Total: 1 (CRITICAL: 1)

┌─────────┬────────────────┬──────────┬────────┬───────────────────┬─────────────────┬────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability  │ Severity │ Status │ Installed Version │  Fixed Version  │                           Title                            │
├─────────┼────────────────┼──────────┼────────┼───────────────────┼─────────────────┼────────────────────────────────────────────────────────────┤
│ stdlib  │ CVE-2024-24790 │ CRITICAL │ fixed  │ 1.17.1            │ 1.21.11, 1.22.4 │ golang: net/netip: Unexpected behavior from Is methods for │
│         │                │          │        │                   │                 │ IPv4-mapped IPv6 addresses                                 │
│         │                │          │        │                   │                 │ https://avd.aquasec.com/nvd/cve-2024-24790                 │
└─────────┴────────────────┴──────────┴────────┴───────────────────┴─────────────────┴────────────────────────────────────────────────────────────┘

Also:

┌─────────┬────────────────┬──────────┬────────┬───────────────────┬─────────────────┬────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability  │ Severity │ Status │ Installed Version │  Fixed Version  │                           Title                            │
├─────────┼────────────────┼──────────┼────────┼───────────────────┼─────────────────┼────────────────────────────────────────────────────────────┤
│ stdlib  │ CVE-2022-23806 │ CRITICAL │ fixed  │ 1.17.1            │ 1.16.14, 1.17.7 │ golang: crypto/elliptic: IsOnCurve returns true for invalid │
│         │                │          │        │                   │                 │ field elements                                              │
│         │                │          │        │                   │                 │ https://avd.aquasec.com/nvd/cve-2022-23806                  │
│         ├────────────────┤          │        │                   ├─────────────────┼─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-24538 │          │        │                   │ 1.19.8, 1.20.3  │ golang: html/template: backticks not treated as string      │
│         │                │          │        │                   │                 │ delimiters                                                  │
│         │                │          │        │                   │                 │ https://avd.aquasec.com/nvd/cve-2023-24538                  │
│         ├────────────────┤          │        │                   ├─────────────────┼─────────────────────────────────────────────────────────────┤
│         │ CVE-2023-24540 │          │        │                   │ 1.19.9, 1.20.4  │ golang: html/template: improper handling of JavaScript      │
│         │                │          │        │                   │                 │ whitespace                                                  │
│         │                │          │        │                   │                 │ https://avd.aquasec.com/nvd/cve-2023-24540                  │
└─────────┴────────────────┴──────────┴────────┴───────────────────┴─────────────────┴─────────────────────────────────────────────────────────────┘

Scientific notation for large numbers

The example command line is

curl -s 'http://microapi.theride.org/Location' | jp '[0].Id'

which produces this output on a recent run:

4.7268765e+07

in scientific notation, instead of simply 47268765 like I would have expected.

jp not doing the same as the playground

input:
{"z":{"a":{"b":"c"},"g":{"b":"d"},"h":{"b":"e"},"i":{"b":"f"}}}
expression:
z.*|[?b == `d`]
on the playground returns:
[ { "b": "d" } ]
but on Debian 12.5 jp version 0.2.1 with:
jp --filename z.json --expr-file z.jp
returns:
Error evaluating JMESPath expression: invalid character 'd' looking for beginning of value
with return code 1.

Numeric comparison is broken

When comparing numeric values, I get an error:

(feature/1176)$ echo '[{"vote": 10, "Name": "First"},{"vote": 5, "Name": "Second"}]' | jp "[?vote!='10'].{Name: Name}"
[
  {
    "Name": "First"
  },
  {
    "Name": "Second"
  }
]
(feature/1176)$ echo '[{"vote": 10, "Name": "First"},{"vote": 5, "Name": "Second"}]' | jp "[?vote==10].{Name: Name}"
SyntaxError: Invalid token: tNumber
[?vote==10].{Name: Name}

Using v 0.1.3

Is there any option to make the output 'null' to empty?

I love this simple tool, but I found out a problem here.
In shell script, the null value matches the string check inconvenient since [ -z $var ] is usually for checking empty string and the null string makes it failed. The solution here is that we need to remove the null string becoming a empty string.
I think maybe jp could add a option to solve this problem as it's really common for writing shell script.
Thanks!

join not working?

No matter what I do, I simply can't get join to work:

➜   echo '["a", "b"]' | jp 'join(", ",@)'
Error evaluating JMESPath expression: Invalid type for: <nil>, expected: []jmespath.jpType{"string"}
➜   echo '["a", "b"]' | jp 'join(`, `,@)'
Error evaluating JMESPath expression: invalid character ',' looking for beginning of value

Doubt : Is it possible to return all possible path in a dictionary, having a given value through jp filters ?

Problem Statement

I have a requirement where I have to search through a raw unstructure non-standard json file and provide all the possible paths which contains a given value.

Example
For a given json

{ 
  "a" : {"a1": ["1","2", {"a2":"IAMHERE"}] },
   "b" : "IAMHERE",
   "c" : {"c1" : {"c2" : {"c3" : {"c4" : "1" , "c5" : "IAMHERE"}}}}
}

For above json and for a given value "IAMHERE" , I would want to get [ "a.a1[2].a2" , "b", "c.c1.c2.c3.c5"] or something similar as those are the paths which has that value.

Also, the structure of the json is not known before hand.

jp always alphabetically sorts the output?

Hi,

Is there a way to prevent JP from alphabetically sorting the output? I've tried using the -e and -f parameters, just the -f parameter, and no command line arguments other than the expression.

Attached is a very simple example in a data.zip file.

Using the following command on Windows 10, I'm finding the contents of the out.json file is alphabetically sorted. e.g.
jp -f data.json -e expr.json > out.json

Similarly these invocations experience the same result:

  • jp -f data.json "@" > out.json
  • type data.json | jp "@" > out.json

data.zip

The VS Code extension honours the order of the expression statements. Is there a way for jp to behave similarly?

Thanks, Matt

Multihash does not work in jp v0.1.1

When performing the select people[].{Name: name, State: state.name} on

{
  "people": [
    {
      "name": "a",
      "state": {"name": "up"}
    },
    {
      "name": "b",
      "state": {"name": "down"}
    },
    {
      "name": "c",
      "state": {"name": "up"}
    }
  ]
}

It returns SyntaxError: Incomplete expression.
I am using jp-linux-amd64 v 0.1.1.
Running the same in jpterm version 0.2.1 the expression works and it returns

[
  {
    "State": "up", 
    "Name": "a"
  }, 
  {
    "State": "down", 
    "Name": "b"
  }, 
  {
    "State": "up", 
    "Name": "c"
  }
]

I am running Linux Ubuntu 14.04 (uname -a):
Linux aneagu 3.16.0-39-generic #53~14.04.1-Ubuntu SMP Wed May 27 10:03:17 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
How can I get the jp program to behave correctly, like jpterm? Thank you.

Require binary for ARM64 architecture

I was trying to build the Azure/azure-cli image on arm64 platform but it requires a jp binary which is not available for the arm64 platform.
I have built the binary successfully by following below steps:

  • Installed the golang 1.13 version.

  • Cloned the package and cd to jp directory.

  • Ran command go build

Do you have any plans to release binary for arm64?

It will be very helpful if the binary is released for arm64.

brew install command pulls another jp

README suggests the following to install from Homebrew:

brew tap jmespath/jmespath
brew install jp

This however installs another jp package

$ brew info jp
jp: stable 1.1.12 (bottled)
Dead simple terminal plots from JSON data
https://github.com/sgreben/jp
...

I believe the correct command should be

brew install jmespath/jmespath/jp

Update Go version used to build releases

Golang 1.17.1 (used for latest build 0.2.1) has several critical vulnerabilities (CVEs), and would be nice to use a more current version if possible for pre-built binaries (I'm lazy and I assume there are many others as well). I know it's a never-ending battle, but since this is used in Microsoft's azure-cli container this way (which uses a WAY older version, but that's another story -- and I can't fix that (easily) until this is resolved), I'm hoping this is easy and controversy-free. Thanks.

Currently Go 1.19.9+ or 1.20.4+ would be needed to be "Critical-CVE-free".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.