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

All tools should offer JSON output format #9

Open
dwstern opened this issue Jan 25, 2019 · 1 comment
Open

All tools should offer JSON output format #9

dwstern opened this issue Jan 25, 2019 · 1 comment
Assignees

Comments

@dwstern
Copy link
Contributor

dwstern commented Jan 25, 2019

Several recent tools (including listcaslibs.py, listcastables.py, listcaslibsandeffectiveaccess.py, listcastablesandeffectiveaccess.py and listgroupsandmembers.py) only output text, in CSV format.

As a general design goal, it would be preferable for all pyviyatools to have at least an option to output JSON rather than text.

Any views on whether one or the other needs to universally be the default? Or are we happy for some to default to JSON, some to CSV text, and so on depending on what job they were developed to do?

Could also split this issue into one per tool, to make tracking completion easier. I haven't yet because that would create a lot of issues and perhaps one is enough.

@dwstern dwstern self-assigned this Jan 25, 2019
@gerrynelson63
Copy link
Member

Take a look at the way the printresult function is implemented in sharedfunctions. It currently defaults to json. But it will generically handle "simple", "csv" and "json" as long as it is passed json in the format that the Viya rest api's output. I think this may be as simple as ensuring the individual tools always create json in that format. Currently most already do that (not all) and I think some exceptions are ok.

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