-
Notifications
You must be signed in to change notification settings - Fork 214
Add jsonpath.py script that can be used when installing this package #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ut improved and expanded) that will be installed in bin/. this means anyone installing this package will also get a jsonpath.py that will work on the command line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past I've used something like
entry_points = {
'console_scripts': ['jsonpath = jsonpath_rw.cli:entry_point']
}
Two things I really like about that are:
- You can test the function easily
- The name of the script is independent
Is there any pitfall to this method? I know the packaging situation is confusing in Python so I could have got something wrong.
|
Overall, this is a great idea. I've dropped a few specific comments just on little improvements. Any of them that you would care to take on would be super. I can do the rest, but it will get done sooner if you do :-) |
Add jsonpath.py script that can be used when installing this package
|
Didn't mean to leave this sitting here. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this. This makes it break when the files have special characters in their name. Globbing is the shell's job. Do you actually require this? Is this a Windows thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. Just discovered that, at least at the time of some SO answers, DOS/Windows shell does not glob.This behavior is a bug in the DOS/Windows shell. I'll leave this in until someone on a unixy OS reports a bug, at which point I'll be forced to fix this to not glob. It is just a rare corner case so who knows if it will ever come up.
|
This is available in the new 1.3.0 release on PyPi |
|
Sorry for taking so long to get back, I noticed just now you had already merged it. Otherwise I would have done the remaining work now. Thanks! |
|
No worries. Thanks for the contribution! |
This script is based on https://github.com/makefu/jsonpath but expanded to work well with batches of files, globbing etc.
It will be installed as a bin/ script, so pip installing this package also gives a useful tool for testing and doing stuff. This is really useful, and I had a hard time finding a working JSONpath script (there are so many outdated, or for old versions of perl and what not).
There are two modes: stdin input and file path input
Examples:
Please merge! :)