cyclonedx_py.parser.environment

Parser classes for reading installed packages in your current Python environment.

These parsers look at installed packages only - not what you have defined in any dependency tool - see the other Parsers if you want to derive CycloneDX from declared dependencies.

The Environment Parsers support population of the following data about Components:

Module Contents

Classes

EnvironmentParser

This will look at the current Python environment and list out all installed packages.

class cyclonedx_py.parser.environment.EnvironmentParser(use_purl_bom_ref: bool = False, *, debug_message: cyclonedx_py.parser._debug.DebugMessageCallback = quiet)[source]

Bases: cyclonedx.parser.BaseParser

This will look at the current Python environment and list out all installed packages.

Best used when you have virtual Python environments per project.

static _get_metadata_for_package(package_name: str) importlib.metadata.PackageMetadata[source]