Open ibraheemdev opened 6 days ago
I think we should probably use --format json
for consistency with other interfaces?
should this be part of uv pip tree
or uv pip list
? uv pip list --format json
seems to already print something very similar to what pipdeptree --json
prints:
$ uv pip list --format json | jq
[
{
"name": "certifi",
"version": "2024.6.2"
},
{
"name": "charset-normalizer",
"version": "3.3.2"
},
{
"name": "idna",
"version": "3.7"
},
{
"name": "requests",
"version": "2.32.3"
},
{
"name": "urllib3",
"version": "2.2.2"
}
]
additionally the output of pipdeptree --json
doesn't seem to necessarily relate to the concept of tree, since when there's a nested dependency, it doesn't actually nest it in the json output.
thoughts @dsully @kdeldycke?
Oh I'm not really picky about the shape of the JSON output, as long as it is machine readable.
That's because I'm only interested in creating a Mermaid diagram to visualize dependencies like so: https://kdeldycke.github.io/meta-package-manager/install.html#python-dependencies
So whatever the JSON looks like, I'll have to write a script to generate the .mmd
file out of uv pip tree
output.
e.g. JSON with
-j
. This is useful for interacting with graph tools such as mermaid.