Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

protobom-py

CI Status PyPI - Python Version PyPI - Version

protobom-py is a Python wrapper for bom-squad/protobom that can be used to generate both SPDX and CycloneDX SBOMs from Python code. There are two main parts:

  1. protobom_py.sbom_pb2 provides precompiled Protobuf definitions for the Protobom format.
  2. protobom_py.convert() can be used to render SPDX and CycloneDX SBOMS from the Protobom format.

Usage

import protobom_py

document = protobom_py.sbom_pb2.Document()
spdx = protobom_py.convert(document, "spdx")

proto = b"..."
cyclonedx = protobom_py.convert(proto, "cyclonedx")

See tests/test_protobom.py for more in-depth examples.

Development

Tests

The project maintains a strict 100% test coverage. You can run tests locally as follows:

pdm run test

Code Style

The project enforces a consistent code style using Ruff:

pdm run fmt

Architecture

protobom is written in Go, which makes it tricky to distribute Python bindings. While projects such as gopy make it possible to generate CPython extensions, this approach would require {Windows, Linux, macOS} x {Python 3.10, Python 3.11, Python 3.12, ...} individual wheel distributions, which is not very sustainable. To simplify distribution, protobom_py uses an alternative approach:

  1. ./protobom-writer contains a small Go binary that converts a Protobom file to either SPDX or CycloneDX.
  2. This binary is compiled to Go's WebAssembly/WASI target.
  3. protobom_py uses wasmtime to execute the wasm binary when convert() is called.

The WASM binary works across platforms, so only a single binary distribution is needed.

Metadata

Release files for protobom-py 0.1b1

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

Source distribution (sdist)

Source distribution for protobom-py 0.1b1
File Size Uploaded Provenance
protobom_py-0.1b1.tar.gz 18.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for protobom-py 0.1b1
File Interpreter ABI Platform
protobom_py-0.1b1-py3-none-any.whl Python 3 none any Details

Total release size: 2.7 MB

Release files / protobom_py-0.1b1.tar.gz

Download URL protobom_py-0.1b1.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2933d60c8984dd8cde403080258bdf85422f1aaee15039d2e9e864565bc63d44
BLAKE2b-256 checksum
How to use checksums
302ec1e3d46edabdb752ea00b758f49c3e9628da2c29c2a291197ad196c1e2ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Release files / protobom_py-0.1b1-py3-none-any.whl

Download URL protobom_py-0.1b1-py3-none-any.whl
Size 2.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2e7cbb809e5b62e529096c514542ba940f3a39ef786fd02c06b9f6ad2dc6c217
BLAKE2b-256 checksum
How to use checksums
79ef78d845822c84b9e6e817c06540d7c8aa7953ff91f67cbc8ad3bdcfd2a82a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

Security for protobom-py 0.1b1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
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