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

--key option, for when you don't have pyjq #7

Closed
simonw opened this issue Aug 30, 2023 · 1 comment
Closed

--key option, for when you don't have pyjq #7

simonw opened this issue Aug 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Aug 30, 2023

In trying this out against the new Datasette table API I realized it's not quite the right shape for this tool:

https://latest.datasette.io/fixtures/compound_three_primary_keys.json

link: <https://latest.datasette.io/fixtures/compound_three_primary_keys.json?_next=a%2Cd%2Cv>; rel="next"

{
  "rows": [{ ... }]
}

This tool prefers JSON that is a list, not an object.

You can use the --jq option to work around that, but only if pyjq is installed.

So I think a simpler --key option would be worth supporting too:

paginate-json \
  https://latest.datasette.io/fixtures/compound_three_primary_keys.json \
  --key rows
@simonw simonw added the enhancement New feature or request label Aug 30, 2023
@simonw simonw closed this as completed in 2c60c7e Aug 30, 2023
@simonw
Copy link
Owner Author

simonw commented Aug 30, 2023

Still needs documentation but I'm going to push an improved README shortly.

simonw added a commit that referenced this issue Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant