Filters cyclonedx-py json files by pipdeptree json output
- Install your package and
cyclonedx-bom
andpipdeptree
(preferably in a virtual environment)
$ pip install <package_name> cyclonedx-bom pipdeptree
- Create SBOM and dependency file
# create SBOM of current virtual env
$ cyclonedx-py -pb --format json -e
# create pipdeptree file
$ pipdeptree -p <package_name> --json > dependencies.json
- Filter SBOM
$ python filter-sbom.py --sbom cyclonedx.json --dependencies dependencies.json --out cyclonedx_filtered.json
# or also extend dependencies
$ python filter-sbom.py --sbom cyclonedx.json --dependencies dependencies.json --out cyclonedx_filtered.json --extend-dependencies