Is there a Python library that documents all modules and licenses used in a script? [closed]

自闭症网瘾萝莉.ら 提交于 2020-05-14 14:44:06

问题


For nodejs there seems to be a very straightforward way to list all used modules and their licenses. Why is there no similar tool for python?

What I've found so far is pip-licenses which is pretty intuitive but has the flaw that it outputs all installed pip modules and not just the ones I actually imported in an actual project.

Another option might be to write a script that first searches for imported modules in my scripts by using modulefinder and then iterates over that list using pkg_resources to get the licenses.

Isn't there an easier, cleaner way to do this? I'm sure this task has been done by thousands of coders all over the world before.

来源:https://stackoverflow.com/questions/61662812/is-there-a-python-library-that-documents-all-modules-and-licenses-used-in-a-scri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!