Skip to main content

Standard BOM for Python

build coverage GitHub Tag

A Python library for creating and consuming documents in standard-bom format.

"Standard BOM" is our Siemens-internal SBOM format based on the Siemens CycloneDX Property Taxonomy, which is 100% compatible with the CycloneDX.

Every Standard BOM document is a 100% CycloneDX document, so both CycloneDX and Standard BOM formats are supported both for reading and writing SBOMs with this library.

Installation

To install the library, run following command ...

... for pip:

pip install siemens-standard-bom

... for Poetry:

poetry add siemens-standard-bom

The library provides Standard BOM parser and serializer classes. The parser class is used to read a Standard BOM from a file, and the serializer class is used to write a Standard BOM to a file.

💡 Hint: This library provides strict type checking using mypy. Using mypy with strict type checks in your own codebase is recommended to ensure type safety.

Read a Standard BOM from a JSON file

from siemens_standard_bom.parser import StandardBomParser

bom = StandardBomParser.parse("sbom.cdx.json")

Write a Standard BOM to a JSON file

from siemens_standard_bom.parser import StandardBomParser

bom = ...
StandardBomParser.save(bom, "sbom.cdx.json")

If you'd like to skip the .dependencies field in the output file, you can use the following code:

from siemens_standard_bom.parser import StandardBomParser

bom = ...
StandardBomParser.save(bom, "sbom.cdx.json", with_dependencies=False)

This will save the Standard BOM to the file without the .dependencies field, which is prohibited in the external profile.

Create a Standard BOM document programmatically

The StandardBom class wraps the cyclonedx.model.bom.Bom class from the upstream library cyclonedx-python-lib. This library provides convenience wrappers around model objects from the upstream library.

from cyclonedx.model.component import Component, ComponentType
from cyclonedx.model.contact import OrganizationalContact
from siemens_standard_bom.model import StandardBom

bom = StandardBom()
bom.add_author(OrganizationalContact(name='John Doe'))
bom.add_tool(Component(name='Sample Tool', version='1.0.0', type=ComponentType.APPLICATION))
bom.add_component(Component(name='Sample Component', version='1.2.3', type=ComponentType.LIBRARY))

You can also use the Standard BOM wrapper classes to create and edit the Standard BOM document. For example, you can do the following similar to the example abode:

from cyclonedx.model.component import Component, ComponentType
from cyclonedx.model.contact import OrganizationalContact
from siemens_standard_bom.model import StandardBom, SbomComponent

bom = StandardBom()
bom.add_author(OrganizationalContact(name='John Doe'))
bom.add_tool(SbomComponent(Component(name='Sample Tool', version='1.0.0', type=ComponentType.APPLICATION)))
bom.add_component(SbomComponent(Component(name='Sample Component', version='1.2.3', type=ComponentType.LIBRARY)))

Retrieve fields from the Standard BOM object

Once you retrieve several fields from the StandardBom object, you get the wrapped Standard BOM types for these fields. For example, the tools or components getters returns a list of SbomComponent objects:

from typing import Iterable
from siemens_standard_bom.model import SbomComponent

bom = ...
components: Iterable[SbomComponent] = bom.components
tools: Iterable[SbomComponent] = bom.tools

Setting licenses to a component

You can set licenses to a component by using the licenses setter method of the SbomComponent class. SbomComponent.licenses setter method accepts an iterable of type License which can be a LicenseExpression or a DisjunctiveLicense:

from cyclonedx.model.license import LicenseExpression

component = SbomComponent(...)
licenses = [LicenseExpression(value="MIT")]
component.licenses = licenses

Development

In order to build this library on your local PC, and/or contribute to this library, mind the following prerequisites:


Once you have those prerequisites you can perform following development tasks locally:

  • Run the build by executing

    poetry install
    

    then

    poetry build
    

    This will generate the build artifacts under dist/ folder.

  • Run all unit tests with all test cases and static code analysis

    poetry run tox run
    

    This will run all the tests for all supported Python versions as well as static linting and type checking.

License

This project is Inner Source under the MIT license (SPDX-License-Identifier: MIT).

Copyright (c) Siemens AG 2019-2025 ALL RIGHTS RESERVED

Release files for siemens-standard-bom 4.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for siemens-standard-bom 4.3.0
File Size Uploaded
siemens_standard_bom-4.3.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for siemens-standard-bom 4.3.0
File Interpreter ABI Platform
siemens_standard_bom-4.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / siemens_standard_bom-4.3.0.tar.gz

Download URL siemens_standard_bom-4.3.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ac10dbbf0c247a06e8dc5e2ed35872580af20e658a5aaa65a8f4806cd456feb
BLAKE2b-256 checksum
How to use checksums
2fa146d9c801e1eaa81f684e3ae5bed4d1ca4b4a9d93163b3c98a42558bd0f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / siemens_standard_bom-4.3.0-py3-none-any.whl

Download URL siemens_standard_bom-4.3.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
806f93076f06a5fb05662cc68d7d6daa5fc56b1b78ec491308dd75bf3d181e1d
BLAKE2b-256 checksum
How to use checksums
a969814a3093bc2136976507ce15e5948c5d6d4c11f7b4d90338a63ee5305e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.3.0 This release

2 release files

4.2.1

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page