pydistcheck icon indicating copy to clipboard operation
pydistcheck copied to clipboard

[feature request] export `--inspect` results in a machine-readable format

Open jameslamb opened this issue 3 years ago • 0 comments

What change would you like to see?

pydistcheck --inspect should support optionally writing its information into at least one machine-readable format.

How would implementing this improve pydistcheck?

Right now, pydistcheck --inspect just prints information like the following.

file size
  * compressed size: 6.3779K
  * uncompressed size: 11.5596K
  * compression space saving: 0.448
contents
  * directories: 2
  * files: 9
size by extension
  * .txt - 11.1K (96.0%)
  * .py - 0.4K (3.2%)
  * .PY - 0.1K (0.6%)
  * .ini - 0.0K (0.2%)

Exporting it to JSON (and maybe CSV or Parquet in the future) would enable the following:

  • analyzing the results of pydistcheck run over multiple Python package distributions (e.g. for research purposes)
  • building extensions that merge pydistcheck's analysis with other tools' analyses of Python package distributions

Notes

I really like the way that pytest-cov does this.

https://pytest-cov.readthedocs.io/en/latest/reporting.html

pytest --cov-report html:cov_html
        --cov-report xml:cov.xml
        --cov-report lcov:cov.info

That's awesome because it allows for:

  • writing multiple formats or different copies from a single command
  • redirecting output to other directories without needing a separate argument

jameslamb avatar Nov 28 '22 05:11 jameslamb