CycloneDX / CycloneDX/cyclonedx-python

SPDX license info from `requirements.txt`

Open
#354 5 comments 6 reactions 0 assignees View on GitHub
enhancement help wanted source: requirements
Dominant language
Python
Stars
390
Forks
98
Avg merge
2d 23h
Merged PRs (30d)
2

Description

Hi,

I am using requirements.txt to generate bom file. And the output is as follows. I would like to know how can I get the SPDX license id generated? thanks!

output:
```


2022-05-10T10:55:22.184404+00:00


CycloneDX
cyclonedx-bom
3.2.1


CycloneDX
cyclonedx-python-lib
2.3.0


https://github.com/CycloneDX/cyclonedx-python-lib/issues


https://cyclonedx.org


https://github.com/CycloneDX/cyclonedx-python-lib/actions


https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md


https://pypi.org/project/cyclonedx-python-lib/


https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE


https://cyclonedx.github.io/cyclonedx-python-lib/


https://github.com/CycloneDX/cyclonedx-python-lib







backports.entry-points-selectable
1.1.0
pkg:pypi/backports.entry-points-selectable@1.1.0


mypy-extensions
0.4.3
pkg:pypi/mypy-extensions@0.4.3


mccabe
0.6.1
pkg:pypi/mccabe@0.6.1


python-dateutil
2.8.1
pkg:pypi/python-dateutil@2.8.1


filelock
3.0.12
pkg:pypi/filelock@3.0.12


certifi
2021.5.30
pkg:pypi/certifi@2021.5.30


py
1.10.0
pkg:pypi/py@1.10.0


pydantic
1.8.2
pkg:pypi/pydantic@1.8.2


black
21.9b0
pkg:pypi/black@21.9b0


pytest
6.2.5
pkg:pypi/pytest@6.2.5


chardet
4.0.0
pkg:pypi/chardet@4.0.0


python-docx
0.8.11
pkg:pypi/python-docx@0.8.11


protobuf
3.17.2
pkg:pypi/protobuf@3.17.2


pyflakes
2.2.0
pkg:pypi/pyflakes@2.2.0


boto3
1.18.10
pkg:pypi/boto3@1.18.10


starlette
0.14.2
pkg:pypi/starlette@0.14.2


pycparser
2.20
pkg:pypi/pycparser@2.20


s3transfer
0.5.0
pkg:pypi/s3transfer@0.5.0


pyparsing
2.4.7
pkg:pypi/pyparsing@2.4.7


distlib
0.3.2
pkg:pypi/distlib@0.3.2


charset-normalizer
2.0.4
pkg:pypi/charset-normalizer@2.0.4


python-multipart
0.0.5
pkg:pypi/python-multipart@0.0.5


ddtrace
0.49.2
pkg:pypi/ddtrace@0.49.2


pytest-mock
3.6.1
pkg:pypi/pytest-mock@3.6.1


pytest-cov
2.12.1
pkg:pypi/pytest-cov@2.12.1


tenacity
7.0.0
pkg:pypi/tenacity@7.0.0


pymongo
3.11.4
pkg:pypi/pymongo@3.11.4


tox
3.24.3
pkg:pypi/tox@3.24.3


virtualenv
20.7.2
pkg:pypi/virtualenv@20.7.2


mangum
0.11.0
pkg:pypi/mangum@0.11.0


platformdirs
2.3.0
pkg:pypi/platformdirs@2.3.0


aiofiles
0.7.0
pkg:pypi/aiofiles@0.7.0


iniconfig
1.1.1
pkg:pypi/iniconfig@1.1.1


attrs
21.2.0
pkg:pypi/attrs@21.2.0


requests
2.25.1
pkg:pypi/requests@2.25.1


urllib3
1.26.5
pkg:pypi/urllib3@1.26.5


tomli
1.2.1
pkg:pypi/tomli@1.2.1


cryptography
3.4.7
pkg:pypi/cryptography@3.4.7


jmespath
0.10.0
pkg:pypi/jmespath@0.10.0


toml
0.10.2
pkg:pypi/toml@0.10.2


typing-extensions
3.10.0.0
pkg:pypi/typing-extensions@3.10.0.0


cachetools
4.2.2
pkg:pypi/cachetools@4.2.2


fastapi
0.65.1
pkg:pypi/fastapi@0.65.1


PyJWT
2.1.0
pkg:pypi/pyjwt@2.1.0


flake9
3.8.3.post2
pkg:pypi/flake9@3.8.3.post2


pycodestyle
2.6.0
pkg:pypi/pycodestyle@2.6.0


isort
5.9.3
pkg:pypi/isort@5.9.3


idna
2.10
pkg:pypi/idna@2.10


packaging
20.9
pkg:pypi/packaging@20.9


coverage
5.5
pkg:pypi/coverage@5.5


six
1.16.0
pkg:pypi/six@1.16.0


botocore
1.21.14
pkg:pypi/botocore@1.21.14


cffi
1.14.5
pkg:pypi/cffi@1.14.5


click
8.0.1
pkg:pypi/click@8.0.1


regex
2021.8.28
pkg:pypi/regex@2021.8.28


pathspec
0.9.0
pkg:pypi/pathspec@0.9.0


lxml
4.6.3
pkg:pypi/lxml@4.6.3


pluggy
1.0.0
pkg:pypi/pluggy@1.0.0


autoflake
1.4
pkg:pypi/autoflake@1.4






























































```

expected content included:
```
"license": {
"id": "Apache-2.0",
"text": {
"contentType": "text/plain",
"encoding": "base64",
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported generation flow from requirements.txt and inspect the CycloneDX XML component output shown in the issue. Trace how package metadata is gathered and represented, then verify that generated components include SPDX license identifiers when that metadata is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.