Parser for Pipfiles (get a list of all packages used in a Pipfile)

醉酒当歌 提交于 2019-12-11 19:29:43

问题


Is there any parser out there for reading in a Pipfile and returning a list of all packages used in the Pipfile?

If not, how would one go about this? I was thinking a regular expression could do the job, but I am not sufficiently acquainted with the structure of Pipfiles to confirm that is the case.


回答1:


first install pipfile pip install pipfile.

then just use the parser it provides

from pipfile import  Pipfile
parsed = Pipfile.load(filename=pipfile_path)


来源:https://stackoverflow.com/questions/53015705/parser-for-pipfiles-get-a-list-of-all-packages-used-in-a-pipfile

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