Skip to content

Parse pip cache dir #4220

Description

@pombredanne

It can happen that we find a pip cache directory in a codebase. It contains both code archives and JSON that would be useful to parse and collect.
For instance:

pombreda@computer4:~$ ll .cache/pip/wheels/eb/60/37/ee40403cbd895ccdb57eb28b03b0afabeb449d5df9ce776a0d/
total 80
drwxrwxr-x 2 pombreda pombreda  4096 Mar 11 17:12 ./
drwxrwxr-x 3 pombreda pombreda  4096 Mar 11 17:12 ../
-rw-rw-r-- 1 pombreda pombreda   332 Mar 11 17:12 origin.json
-rw-rw-r-- 1 pombreda pombreda 69427 Mar 11 17:12 pefile-2022.5.30-py3-none-any.whl

$ ll .cache/pip/wheels/eb/60/37/ee40403cbd895ccdb57eb28b03b0afabeb449d5df9ce776a0d/
total 80
drwxrwxr-x 2 foo bar  4096 Mar 11 17:12 ./
drwxrwxr-x 3 foo bar  4096 Mar 11 17:12 ../
-rw-rw-r-- 1 foo bar   332 Mar 11 17:12 origin.json
-rw-rw-r-- 1 foo bar 69427 Mar 11 17:12 pefile-2022.5.30-py3-none-any.whl




$ less .cache/pip/wheels/eb/60/37/ee40403cbd895ccdb57eb28b03b0afabeb449d5df9ce776a0d/origin.json 

{"archive_info": {"hash": "sha256=a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b", "hashes": {"sha256": "a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b"}}, "url": "https://files.pythonhosted.org/packages/48/30/4559d06bad5bb627733dac1ef28c34f5e35f1461247ba63e5f6366901277/pefile-2022.5.30.tar.gz"}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions