pythonpippython-packagingpipfile

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


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.


Solution

  • first install pipfile pip install pipfile.

    then just use the parser it provides

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