Git Product home page Git Product logo

jpt's People

Contributors

brunerd 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

Watchers

 avatar  avatar  avatar

jpt's Issues

SyntaxError: Malformed path expression, but it works in Postgres

When I run the command:

jpt $'$.computer_application_usage[*] ? (@.apps[*].name == "Microsoft Outlook.app").date' < data.json

with this data.json.zip, I get the error:

Error: SyntaxError: Malformed path expression: $.computer_application_usage[*] ? (@.apps[*].name == "Microsoft Outlook.app").date

However, when I run the same jsonpath query in Postgres, I don't get an error.

select jsonb_path_query('{"computer_application_usage":[{"date":"2023/03/20","apps":[{"name":"Notes.app","version":"4.10","foreground":21,"open":0},{"name":"Safari.app","version":"16.3","foreground":9,"open":0}]},{"date":"2023/03/19","apps":[{"name":"Microsoft Excel.app","version":"16.71.23031200","foreground":2,"open":0},{"name":"Microsoft Outlook.app","version":"16.71.23031200","foreground":1,"open":0},{"name":"Microsoft Word.app","version":"16.71.23031200","foreground":1,"open":0}]},{"date":"2023/03/16","apps":[{"name":"Mail.app","version":"16.0","foreground":2,"open":0}]}]}'
,     '$.computer_application_usage[*] ? (@.apps[*].name == "Microsoft Outlook.app").date')
;

Not too sure if the query is the problem or if it might be a bug...

Integrating the project in a script opened with CodeRunner

Hi.
I would like to integrate jpt (minimized) in an existing script.
My code editor is CodeRunner on Mac.
I can paste the project in the script but then, it's like the function has an error so the functions browser of CodeRunner stops after jpt.
If I remove the locations=( [...] fi part at the end, the functions browser does not stop after jpt.
I have also opened a support request with CodeRunner but maybe someone here already has a solution.
Thanks !
Franck

File error (note: jsc max size is 2147483647 bytes): Error: Could not open file.

Hi.
I have attached 2 JSON files produced from Jamf Pro API (curl then redirection to file so you can get the content).
The request is made using
EA_ID=$(echo "$JSON_DATA" | jpt -T '$..*[?(@.name=="EasyLAPS")].definitionId')
With the content of file C39BB5D2-342A-597E-BF83-2D60E923C362.json, the ID is returned
With the content of file A7D7D99B-1CF6-58FB-A47A-BDC555E24E6F.json, the error is File error (note: jsc max size is 2147483647 bytes): Error: Could not open file.
In the 2 files, we have the same entry for the EasyLAPS attribute.
Using https://jsonformatter.curiousconcept.com, the 2 files are reported valid.
Do you see why jpt returns the error ?
Franck
Archive.zip

Feature Request: Add version flag

Happy Thursday, @brunerd!

First, thanks for all your hard work on jpt.

While the version is displayed when using jpt -h, it'd be nice to have a -v or --version flag which would return just 1.0.0 (i.e., for a Jamf Pro Extension Attribute).

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.