Skip to content

Commit 3d0ea2f

Browse files
authored
doc: readme maintenance - shields & links (#72)
* README: restructure links Signed-off-by: Jan Kowalleck <[email protected]> * README: add lan to fenced code blocks Signed-off-by: Jan Kowalleck <[email protected]> * README: fix some formatting Signed-off-by: Jan Kowalleck <[email protected]> * README: modernized shields Signed-off-by: Jan Kowalleck <[email protected]> * README: harmonize links Signed-off-by: Jan Kowalleck <[email protected]> * README: add language to code fences Signed-off-by: Jan Kowalleck <[email protected]> * README: markdown fixes Signed-off-by: Jan Kowalleck <[email protected]> * README: removed py version shield Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 3f967b3 commit 3d0ea2f

File tree

1 file changed

+58
-36
lines changed

1 file changed

+58
-36
lines changed

README.md

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
# Python Library for generating CycloneDX
22

3-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/CycloneDX/cyclonedx-python-lib/Python%20CI)
4-
![Python Version Support](https://img.shields.io/badge/python-3.6+-blue)
5-
![PyPI Version](https://img.shields.io/pypi/v/cyclonedx-python-lib?label=PyPI&logo=pypi)
6-
[![GitHub license](https://img.shields.io/github/license/CycloneDX/cyclonedx-python-lib)](https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE)
7-
[![GitHub issues](https://img.shields.io/github/issues/CycloneDX/cyclonedx-python-lib)](https://github.com/sCycloneDX/cyclonedx-python-lib/issues)
8-
[![GitHub forks](https://img.shields.io/github/forks/CycloneDX/cyclonedx-python-lib)](https://github.com/CycloneDX/cyclonedx-python-lib/network)
9-
[![GitHub stars](https://img.shields.io/github/stars/CycloneDX/cyclonedx-python-lib)](https://github.com/CycloneDX/cyclonedx-python-lib/stargazers)
3+
[![shield_gh-workflow-test]][link_gh-workflow-test]
4+
[![shield_pypi-version]][link_pypi]
5+
[![shield_license]][license_file]
6+
[![shield_website]][link_website]
7+
[![shield_slack]][link_slack]
8+
[![shield_groups]][link_discussion]
9+
[![shield_twitter-follow]][link_twitter]
1010

1111
----
1212

1313
This CycloneDX module for Python can generate valid CycloneDX bill-of-material document containing an aggregate of all
1414
project dependencies.
1515

16-
This module is not designed for standalone use. If you're looking for a CycloneDX tool to run to generate (SBOM) software
17-
bill-of-materials documents, why not checkout:
16+
This module is not designed for standalone use.
17+
If you're looking for a CycloneDX tool to run to generate (SBOM) software bill-of-materials documents, why not checkout: [CycloneDX Python][cyclonedx-python]
1818

19-
- [cyclonedx-python](https://github.com/CycloneDX/cyclonedx-python)
20-
21-
Additionally, the following tool can be used as well (and this library was written to help improve it)
22-
- [Jake](https://github.com/sonatype-nexus-community/jake)
19+
Additionally, the following tool can be used as well (and this library was written to help improve it) [Jake][jake].
2320

2421
Additionally, you can use this module yourself in your application to programmatically generate SBOMs.
2522

@@ -29,7 +26,7 @@ CycloneDX is a lightweight BOM specification that is easily created, human-reada
2926

3027
Install from pypi.org as you would any other Python module:
3128

32-
```
29+
```shell
3330
pip install cyclonedx-python-lib
3431
```
3532

@@ -56,28 +53,28 @@ You can use one of the parsers to obtain information about your project or envir
5653
| PipEnvFileParser | `from cyclonedx.parser.pipenv import PipEnvFileParser` | Parses the `Pipfile.lock` file at the supplied path. |
5754
| PoetryParser | `from cyclonedx.parser.poetry import PoetryParser` | Parses `poetry.lock` content passed in as a string. |
5855
| PoetryFileParser | `from cyclonedx.parser.poetry import PoetryFileParser` | Parses the `poetry.lock` file at the supplied path. |
59-
| RequirementsParser | `from cyclonedx.parser.requirements import RequirementsParser` | Parses a multiline string that you provide that conforms to the `requirements.txt` [PEP-508](https://www.python.org/dev/peps/pep-0508/) standard. |
60-
| RequirementsFileParser | `from cyclonedx.parser.requirements import RequirementsFileParser` | Parses a file that you provide the path to that conforms to the `requirements.txt` [PEP-508](https://www.python.org/dev/peps/pep-0508/) standard. |
56+
| RequirementsParser | `from cyclonedx.parser.requirements import RequirementsParser` | Parses a multiline string that you provide that conforms to the `requirements.txt` [PEP-508] standard. |
57+
| RequirementsFileParser | `from cyclonedx.parser.requirements import RequirementsFileParser` | Parses a file that you provide the path to that conforms to the `requirements.txt` [PEP-508] standard. |
6158

6259
#### Example
6360

64-
```
61+
```py
6562
from cyclonedx.parser.environment import EnvironmentParser
6663

6764
parser = EnvironmentParser()
6865
```
6966

7067
#### Notes on Requirements parsing
7168

72-
CycloneDX software bill-of-materials require pinned versions of requirements. If your `requirements.txt` does not have
73-
pinned versions, warnings will be recorded and the dependencies without pinned versions will be excluded from the
69+
CycloneDX software bill-of-materials require pinned versions of requirements. If your `requirements.txt` does not have
70+
pinned versions, warnings will be recorded and the dependencies without pinned versions will be excluded from the
7471
generated CycloneDX. CycloneDX schemas (from version 1.0+) require a component to have a version when included in a
7572
CycloneDX bill of materials (according to schema).
7673

77-
If you need to use a `requirements.txt` in your project that does not have pinned versions an acceptable workaround
74+
If you need to use a `requirements.txt` in your project that does not have pinned versions an acceptable workaround
7875
might be to:
7976

80-
```
77+
```shell
8178
pip install -r requirements.txt
8279
pip freeze > requirements-frozen.txt
8380
```
@@ -89,15 +86,15 @@ have `pip install`ed your dependencies.
8986

9087
You can create a BOM Model from either a Parser instance or manually using the methods avaialbel directly on the `Bom` class.
9188

92-
The model also supports definition of vulnerabilities for output using the CycloneDX schema extension for
89+
The model also supports definition of vulnerabilities for output using the CycloneDX schema extension for
9390
[Vulnerability Disclosures](https://cyclonedx.org/use-cases/#vulnerability-disclosure) as of version 0.3.0.
9491

95-
**Note:** Known vulnerabilities associated with Components can be sourced from various data sources, but this library
96-
will not source them for you. Perhaps look at [Jake](https://github.com/sonatype-nexus-community/jake) if you're interested in this.
92+
**Note:** Known vulnerabilities associated with Components can be sourced from various data sources, but this library
93+
will not source them for you. Perhaps look at [Jake][jake] if you're interested in this.
9794

9895
#### Example from a Parser
9996

100-
```
97+
```py
10198
from cyclonedx.model.bom import Bom
10299
from cyclonedx.parser.environment import EnvironmentParser
103100

@@ -110,20 +107,22 @@ bom = Bom.from_parser(parser=parser)
110107
Once you have an instance of a `Bom` you can produce output in either `JSON` or `XML` against any of the supporting CycloneDX schema versions as you require.
111108

112109
We provide two helper methods:
113-
1. Output to string (for you to do with as you require)
114-
2. Output directly to a filename you provide
115110

116-
##### Example as JSON
111+
* Output to string (for you to do with as you require)
112+
* Output directly to a filename you provide
117113

118-
```
114+
#### Example as JSON
115+
116+
```py
119117
from cyclonedx.output import get_instance, OutputFormat
120118

121119
outputter = get_instance(bom=bom, output_format=OutputFormat.JSON)
122120
outputter.output_as_string()
123121
```
124122

125-
##### Example as XML
126-
```
123+
#### Example as XML
124+
125+
```py
127126
from cyclonedx.output import get_instance, SchemaVersion
128127

129128
outputter = get_instance(bom=bom, schema_version=SchemaVersion.V1_2)
@@ -214,8 +213,8 @@ _Note: We refer throughout using XPath, but the same is true for both XML and JS
214213

215214
### Notes on Schema Support
216215

217-
1. N/A is where the CycloneDX standard does not include this
218-
2. If the table above does not refer to an element, it is not currently supported
216+
* N/A is where the CycloneDX standard does not include this
217+
* If the table above does not refer to an element, it is not currently supported
219218

220219
## Python Support
221220

@@ -224,9 +223,32 @@ However, some features may not be possible/present in older Python versions due
224223

225224
## Changelog
226225

227-
See our [CHANGELOG](./CHANGELOG.md).
226+
See our [CHANGELOG][chaneglog_file].
228227

229228
## Copyright & License
230-
CycloneDX Python Lib is Copyright (c) OWASP Foundation. All Rights Reserved.
231229

232-
Permission to modify and redistribute is granted under the terms of the Apache 2.0 license.
230+
CycloneDX Python Lib is Copyright (c) OWASP Foundation. All Rights Reserved.
231+
Permission to modify and redistribute is granted under the terms of the Apache 2.0 license.
232+
See the [LICENSE][license_file] file for the full license.
233+
234+
[cyclonedx-python]: https://github.com/CycloneDX/cyclonedx-python
235+
[jake]: https://github.com/sonatype-nexus-community/jake
236+
237+
[chaneglog_file]: https://github.com/CycloneDX/cyclonedx-python-lib/blob/master/CHANGELOG.md
238+
[license_file]: https://github.com/CycloneDX/cyclonedx-python-lib/blob/master/LICENSE
239+
240+
[shield_gh-workflow-test]: https://img.shields.io/github/workflow/status/CycloneDX/cyclonedx-python-lib/Python%20CI/main?logo=GitHub&logoColor=white "build"
241+
[shield_pypi-version]: https://img.shields.io/pypi/v/cyclonedx-python-lib?logo=Python&logoColor=white "pypi"
242+
[shield_license]: https://img.shields.io/github/license/CycloneDX/cyclonedx-python-lib "license"
243+
[shield_website]: https://img.shields.io/badge/https://-cyclonedx.org-blue.svg "homepage"
244+
[shield_slack]: https://img.shields.io/badge/slack-join-blue?logo=Slack&logoColor=white "slack join"
245+
[shield_groups]: https://img.shields.io/badge/discussion-groups.io-blue.svg "groups discussion"
246+
[shield_twitter-follow]: https://img.shields.io/badge/Twitter-follow-blue?logo=Twitter&logoColor=white "twitter follow"
247+
[link_gh-workflow-test]: https://github.com/CycloneDX/cyclonedx-python-lib/actions/workflows/ci.yml?query=branch%3Amaster
248+
[link_pypi]: https://pypi.org/project/cyclonedx-python-lib/
249+
[link_website]: https://cyclonedx.org/
250+
[link_slack]: https://cyclonedx.org/slack/invite
251+
[link_discussion]: https://groups.io/g/CycloneDX
252+
[link_twitter]: https://twitter.com/CycloneDX_Spec
253+
254+
[PEP-508]: https://www.python.org/dev/peps/pep-0508/

0 commit comments

Comments
 (0)