Documentation ¶
Overview ¶
Package python provides a concrete Cataloger implementation for Python ecosystem files (egg, wheel, requirements.txt).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPythonIndexCataloger ¶
func NewPythonIndexCataloger() *common.GenericCataloger
NewPythonIndexCataloger returns a new cataloger for python packages referenced from poetry lock files, requirements.txt files, and setup.py files.
Types ¶
type Dependency ¶ added in v0.21.0
type Dependency struct {
Version string `json:"version"`
}
type PackageCataloger ¶
type PackageCataloger struct{}
func NewPythonPackageCataloger ¶
func NewPythonPackageCataloger() *PackageCataloger
NewPythonPackageCataloger returns a new cataloger for python packages within egg or wheel installation directories.
func (*PackageCataloger) Catalog ¶
func (c *PackageCataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []artifact.Relationship, error)
Catalog is given an object to resolve file references and content, this function returns any discovered Packages after analyzing python egg and wheel installations.
func (*PackageCataloger) Name ¶
func (c *PackageCataloger) Name() string
Name returns a string that uniquely describes a cataloger
type PipfileLock ¶ added in v0.21.0
type PipfileLock struct { Meta struct { Hash struct { Sha256 string `json:"sha256"` } `json:"hash"` PipfileSpec int `json:"pipfile-spec"` Requires struct { PythonVersion string `json:"python_version"` } `json:"requires"` Sources []struct { Name string `json:"name"` URL string `json:"url"` VerifySsl bool `json:"verify_ssl"` } `json:"sources"` } `json:"_meta"` Default map[string]Dependency `json:"default"` Develop map[string]Dependency `json:"develop"` }
type PoetryMetadata ¶
type PoetryMetadata struct {
Packages []PoetryMetadataPackage `toml:"package"`
}
func (PoetryMetadata) Pkgs ¶
func (m PoetryMetadata) Pkgs() []*pkg.Package
Pkgs returns all of the packages referenced within the poetry.lock metadata.
type PoetryMetadataPackage ¶
type PoetryMetadataPackage struct { Name string `toml:"name"` Version string `toml:"version"` Category string `toml:"category"` Description string `toml:"description"` Optional bool `toml:"optional"` }
func (PoetryMetadataPackage) Pkg ¶
func (p PoetryMetadataPackage) Pkg() *pkg.Package
Pkg returns the standard `pkg.Package` representation of the package referenced within the poetry.lock metadata.