Metadata-Version: 2.4
Name: cyclonedx2report
Version: 0.1.0
Summary: CycloneDX JSON to interactive HTML report generator
Author: cyclonedx2report contributors
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-cov>=5.0; extra == "test"
Dynamic: license-file

# cyclonedx2report

`cyclonedx2report` is a Python CLI that converts a CycloneDX JSON SBOM into an interactive HTML report. It is the core used on [cyclonedx2report.github.io](https://cyclonedx2report.github.io/).

## Features

- Converts CycloneDX JSON into self-contained report HTML
- Embeds SBOM payload into URL hash (`#pako`) for offline usage
- Copies required runtime asset (`report-core.js`) next to generated report
- Supports report title and template selection

## Installation

Install from PyPI:

```bash
pip install cyclonedx2report
```

Install from source (editable):

```bash
pip install -e .
```

## CLI Usage

```bash
cyclonedx2report INPUT_JSON [-o OUTPUT_HTML] [--title TITLE] [--template {main,light}]
```

Examples:

```bash
cyclonedx2report cyclonedx-example.json
cyclonedx2report cyclonedx-example.json -o report.generated.html --title "My SBOM" --template light
```

## Development

Create distributions locally:

```bash
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
```

Upload manually (optional):

```bash
python -m twine upload dist/*
```

## Publishing From GitHub Actions

This repository includes:

- `.github/workflows/ci.yml` for CI checks on PR/push
- `.github/workflows/publish.yml` for trusted publishing to PyPI on GitHub Release

### One-time setup

1. Create a PyPI project named `cyclonedx2report` (or rename `project.name` if needed).
2. In PyPI, configure Trusted Publisher for this GitHub repository and workflow `.github/workflows/publish.yml`.
3. In GitHub, create an environment named `pypi` (optional but recommended) and allow deployment.

### Release flow

1. Bump version in `pyproject.toml`.
2. Push changes to GitHub.
3. Create a GitHub Release (tag like `v0.1.1`).
4. `publish.yml` builds and uploads package to PyPI.

## License

MIT
