Install & Compatibility
Where this runs
tested against v1.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 21MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
add_sarif_options
✓ from bandit_sarif_formatter import add_sarif_options
✗ from bandit_sarif_formatter import add_sarif_options
Example usage via command line or programmatic invocation. The preferred method is to use the bandit CLI with the custom formatter.
import bandit
from bandit.core import manager, config
# Use bandit with the sarif formatter via command line or programmatically
# The quickest way: run bandit with the custom formatter
# command: bandit -r /path/to/your/code -f sarif -o results.sarif
# Or using Python:
from bandit_sarif_formatter import add_sarif_options
args = ['-r', '.', '-f', 'sarif', '-o', 'output.sarif']
bandit_runner = manager.BanditManager(config.BanditConfig(), agg_type='vuln')
bandit_runner.run_tests(args)
Upgrade
Version history
1.1.1latest on PyPI · released Oct 5, 2019
Audit
Dependencies
banditrequiredRequired runtime dependency; Bandit must be installed and used to generate the SARIF output.
sarif-omrequiredLibrary used for creating SARIF objects, automatically installed.