Metadata-Version: 2.5
Name: sbombox-core
Version: 0.1.1
Summary: SBOMBox core library - parse, validate, score, and check compliance of SBOMs
Project-URL: Homepage, https://sbombox.com
Project-URL: Documentation, https://sbombox.com/docs/cli
Project-URL: Source, https://github.com/sbombox-hq/cli
Project-URL: Issues, https://github.com/sbombox-hq/cli/issues
Author-email: sia-sbombox <sia@sbombox.com>
Maintainer-email: sia-sbombox <sia@sbombox.com>
License-Expression: Apache-2.0
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: jsonschema>=4.20
Requires-Dist: license-expression>=30.0
Requires-Dist: lxml>=5.0
Requires-Dist: packageurl-python>=0.11
Requires-Dist: pydantic>=2.0
Requires-Dist: ruamel-yaml>=0.18
Requires-Dist: univers>=0.21
Provides-Extra: cyclonedx
Requires-Dist: cyclonedx-python-lib>=8.0; extra == 'cyclonedx'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: sigstore
Requires-Dist: sigstore>=3.0; extra == 'sigstore'
Provides-Extra: spdx
Requires-Dist: spdx-tools>=0.8; extra == 'spdx'
Description-Content-Type: text/markdown

# sbombox-core

Parse, validate, score, fix and check the compliance of software bills of materials (SBOMs) in CycloneDX and SPDX. This is the library behind the [SBOMBox CLI](https://pypi.org/project/sbombox/) and the SBOMBox platform.

- **Offline.** Nothing is fetched over the network, including schemas.
- **No framework dependencies.** Embed it in any Python 3.12+ application.
- **Formats.** CycloneDX (JSON, XML, YAML) and SPDX (JSON, tag-value), detected automatically.

## Install

```sh
pip install sbombox-core
```

## Usage

```python
from sbombox_core import load, validate_sbom, score, check_compliance, fix

sbom = load("bom.json")                  # path, bytes or text; format auto-detected

result = score(sbom)
print(result.total, result.grade)        # e.g. 8.12 B

report = validate_sbom(sbom)             # semantic findings; never raises
print(report.valid, len(report.issues))

ntia = check_compliance(sbom, "ntia-2021")
print(ntia.status)

fixed = fix(sbom)                        # repair common defects
```

Compliance rulesets: `ntia-2021`, `cisa-2025`, `cisa-2026`, `cra-readiness`, `bsi-tr-03183-2@2.1.0` (and earlier versions), `fsct-v3` and `openchain-telco`.

Lower-level entry points: `parse_sbom` for the parser, `validate_document` for schema and semantic validation of a raw document, `diff` to compare two SBOMs, and `sbombox_core.model` for the data model.

## Links

- Source and issues: [github.com/sbombox-hq/cli](https://github.com/sbombox-hq/cli)
- Docs: [sbombox.com/docs](https://sbombox.com/docs)

Licensed under Apache-2.0.
