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

Is there some way to generate the deptree output from code #4

Open
gaugup opened this issue Mar 3, 2021 · 5 comments
Open

Is there some way to generate the deptree output from code #4

gaugup opened this issue Mar 3, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@gaugup
Copy link

gaugup commented Mar 3, 2021

Hi, great tool to visualize the dependencies. But is there some way to generate the deptree output from code? It might be helpful to search for certain dependencies within a structure.

@sinoroc
Copy link
Owner

sinoroc commented Mar 3, 2021

Thanks for trying my code. I will look into this in the next days.

@sinoroc
Copy link
Owner

sinoroc commented Mar 5, 2021

It should be partly possible to use this tool as a library.

Providing input and triggering the computation is straightforward. But as the code is written now, the output will still be strings written to the console. So it is probably not what you need.

@sinoroc
Copy link
Owner

sinoroc commented Mar 5, 2021

I will see if I can make it easier to use as a library.

@sinoroc
Copy link
Owner

sinoroc commented Mar 21, 2021

@gaugup Any details on how you would like to use this in a library context?

@gaugup
Copy link
Author

gaugup commented Mar 24, 2021

Hi @sinoroc,

I have something like this in mind:-

from deptree import deptree
dependencies_graph = deptree('package_name') 
for dependency in dependencies_graph:
     # Do something with the immediate dependency
 
     # recursively walk the dependencies of the top level dependency
     

Currently, for testing dependencies in my line of product development, I use python subprocess module with deptree and then parse the console output. We could parse the console output as well to achieve the above, though it might be fairly tedious.

Regards,

@sinoroc sinoroc added the enhancement New feature or request label Mar 28, 2021
@sinoroc sinoroc self-assigned this Mar 28, 2021
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

2 participants