FOSSology  4.5.1
Open Source License Compliance by Open Source Software
ScanDeps.Parsers.Parser Class Reference
Collaboration diagram for ScanDeps.Parsers.Parser:
Collaboration graph

Public Member Functions

def __init__ (self, str sbom_file)
 
def classify_components (self, str root_download_dir)
 
list[dict[str, Any]] python_components (self)
 
list[dict[str, Any]] npm_components (self)
 
list[dict[str, Any]] php_components (self)
 
list[dict[str, Any]] unsupported_components (self)
 

Public Attributes

 sbom_data
 
 root_component_name
 

Private Member Functions

str|None _extract_type (self, str purl)
 

Detailed Description

Parser to classify each component based on it's type.
Ex: If purl is pkg:pypi/django@1.11.1,
it is a pypi package and should belong to python_components.

Definition at line 22 of file Parsers.py.

Constructor & Destructor Documentation

◆ __init__()

def ScanDeps.Parsers.Parser.__init__ (   self,
str  sbom_file 
)
Initialize components list and load the sbom_data.
Args:
    sbom_file: str | Path to sbom file

Definition at line 29 of file Parsers.py.

Member Function Documentation

◆ _extract_type()

str | None ScanDeps.Parsers.Parser._extract_type (   self,
str  purl 
)
private
Extracts the package type from the purl.
Example purl: pkg:pypi/django@1.11.1
The type here is 'pypi'.
Args:
    purl: str | Purl of the package to scan
Return:
    purl_type: str | Type of component or None

Definition at line 79 of file Parsers.py.

◆ classify_components()

def ScanDeps.Parsers.Parser.classify_components (   self,
str  root_download_dir 
)
Classify components based on it's type

:param root_download_dir: Download dir prefix. Will be used to create
download dir.

Definition at line 53 of file Parsers.py.


The documentation for this class was generated from the following file: