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)
 

Public Attributes

 sbom_data
 
 python_components
 
 npm_components
 
 php_components
 
 unsupported_components
 

Private Member Functions

Union[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 12 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 18 of file Parsers.py.

Member Function Documentation

◆ _extract_type()

Union[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 50 of file Parsers.py.

◆ classify_components()

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

Definition at line 31 of file Parsers.py.


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