aboutcode-org / aboutcode-org/scancode-toolkit

Parse pip cache dir

Open
#4,220 7 comments 0 reactions 0 assignees View on GitHub
codeday easy good first issue new feature package-formats
Dominant language
Python
Stars
2.6k
Forks
791
Avg merge
1d 12h
Merged PRs (30d)
5

Description

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:
```$ less .cache/pip/wheels/eb/60/37/ee40403cbd895ccdb57eb28b03b0afabeb449d5df9ce776a0d/origin.json
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"}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.