{"modulePath":"github.com/carabiner-dev/unpack","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package python\n\nPackage python implements a SystemDecomposer that reads the Python distributions installed on a filesystem: the \\*.dist-info directories in its site-packages, wherever they live — system interpreters, virtualenvs, pip --target trees. This is how a container image says what Python software it holds, and it works with no lockfile, no network and no Python interpreter.\n\nUnlike the OS package decomposers, which emit a flat inventory, the result is a graph: installed metadata declares dependencies, and a declaration whose target is installed is an edge.\n\n## Types\n\n```go\ntype Decomposer struct{}\n```\nDecomposer reads installed Python distributions from a system filesystem.\n\n```go\nfunc New() *Decomposer\n```\nNew returns a ready-to-use Python system decomposer.\n\n```go\nfunc (d *Decomposer) DefaultOptions() any\n```\nDefaultOptions returns the driver-level options used when none are set.\n\n```go\nfunc (d *Decomposer) Extract(opts *api.DecomposerOptions) (*sbom.NodeList, error)\n```\nExtract opens opts.WorkDir as the system root and runs the FS-aware extractor against it, mirroring the other system decomposers.\n\n```go\nfunc (d *Decomposer) ExtractFromFS(source fs.FS, opts *api.DecomposerOptions) (*sbom.NodeList, error)\n```\nExtractFromFS reads every installed distribution on the filesystem and returns their graph. Returns (nil, nil) when the filesystem holds no Python at all, which is not an error.\n\n```go\nfunc (d *Decomposer) GenerationContext() api.GenerationContext\n```\nGenerationContext says in what context the decomposer's data is read: the distributions installed in a filesystem already put together.\n\n```go\nfunc (d *Decomposer) Requirements(_ *api.DecomposerOptions) []api.Requirement\n```\nRequirements returns nothing: reading dist-info is pure Go.\n\n```go\ntype Options struct{}\n```\nOptions configures the decomposer. There are none yet: discovery walks the filesystem, so there are no database locations to override.\n\n","path":"github.com/carabiner-dev/unpack/system/python","name":"python","synopsis":"Package python implements a SystemDecomposer that reads the Python distributions installed on a filesystem: the *.dist-info directories in its site-packages, wherever they live — system interpreters, virtualenvs, pip --target trees.","isRedistributable":true}
