Skip to content
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

Select support #55

Closed
mslinn opened this issue Feb 22, 2021 · 4 comments
Closed

Select support #55

mslinn opened this issue Feb 22, 2021 · 4 comments

Comments

@mslinn
Copy link

mslinn commented Feb 22, 2021

The Bash version of jq has a select option, which is accessed via a pipe. Is there a way to do something similar with jq.py, for example:

jq.compile(f'.[] | select({expression} == {value})').input(my_json_data).text()
@mwilliamson
Copy link
Owner

What happens when you trying doing so at the moment with jq.py?

@mslinn
Copy link
Author

mslinn commented Feb 22, 2021

This did what I wanted it to:

jq.compile(f'.[] | select({expression} == {value})').input(text=dumpdata).all()

Seems jq.py delegates a lot of behavior to the underlying jq executable. Is that documented?

@mwilliamson
Copy link
Owner

The top of the README says:

This project contains Python bindings for jq.

which is intended to convey that these are bindings, rather than (for instance) a reimplementation/port.

@mslinn
Copy link
Author

mslinn commented Feb 22, 2021

Might want to call that out more explicitly, and point to the jq docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants