SupplyChainAnalysis (version 0.0.1)
index
SupplyChainAnalysis.py

This module provides CLI and functions to analyse supply chain and
dependencies in python packages and apt packages.

 
Classes
       
_PackagesAnalysisTemplate(abc.ABC)
AptPackagesAnalysis
ImportlibPackagesAnalysis
PkgResourcesPackagesAnalysis
builtins.object
PackageCounter
builtins.tuple(builtins.object)
PackageSeenTree

 
class AptPackagesAnalysis(_PackagesAnalysisTemplate)
    This class implements package dependencies analysis for apt.
 
 
Method resolution order:
AptPackagesAnalysis
_PackagesAnalysisTemplate
abc.ABC
builtins.object

Methods defined here:
check_exists(self, package_name: str) -> bool
This method should True if package exists else False.
get_all(self) -> Iterable[str]
The generator yields all installed packages from apt cache.
get_dependencies(self, package_name: str) -> Iterable[str]
This generator yields all installed dependencies
names for a package name.

Data and other attributes defined here:
__abstractmethods__ = frozenset()

Methods inherited from _PackagesAnalysisTemplate:
dependencies_count(self, package_name: str, package_counters: Dict[str, SupplyChainAnalysis.PackageCounter] = None) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method counts the dependencies number and
the seen time number.
make_statistics(self) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method make statistics about packages and dependencies.
package_seen_tree(self, package_name: str, level: int = 0, seen: set = None) -> Iterable[SupplyChainAnalysis.PackageSeenTree]
This generator yields dependencies recursively
with level and seen state.
print_dependencies_tree(self, package_name: str) -> None
This method prints dependencies tree for a package.

Static methods inherited from _PackagesAnalysisTemplate:
print_line_grepable_details(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints details in grepable lines.
print_package_counter(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints package counters and statistics.

Data descriptors inherited from _PackagesAnalysisTemplate:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ImportlibPackagesAnalysis(_PackagesAnalysisTemplate)
    This class implements package dependencies analysis for python packages.
 
 
Method resolution order:
ImportlibPackagesAnalysis
_PackagesAnalysisTemplate
abc.ABC
builtins.object

Methods defined here:
check_exists(self, package_name: str) -> bool
This method should True if package exists else False.
get_all(self) -> Iterable[str]
The generator yields all installed packages from importlib.
get_dependencies(self, package_name: str) -> Iterable[str]
This generator yields all installed dependencies
names for a package name.

Data and other attributes defined here:
__abstractmethods__ = frozenset()

Methods inherited from _PackagesAnalysisTemplate:
dependencies_count(self, package_name: str, package_counters: Dict[str, SupplyChainAnalysis.PackageCounter] = None) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method counts the dependencies number and
the seen time number.
make_statistics(self) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method make statistics about packages and dependencies.
package_seen_tree(self, package_name: str, level: int = 0, seen: set = None) -> Iterable[SupplyChainAnalysis.PackageSeenTree]
This generator yields dependencies recursively
with level and seen state.
print_dependencies_tree(self, package_name: str) -> None
This method prints dependencies tree for a package.

Static methods inherited from _PackagesAnalysisTemplate:
print_line_grepable_details(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints details in grepable lines.
print_package_counter(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints package counters and statistics.

Data descriptors inherited from _PackagesAnalysisTemplate:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PackageCounter(builtins.object)
    PackageCounter(counter: int = 0, dependencies: Set[str] = <factory>) -> None
 
PackageCounter(counter: int = 0, dependencies: Set[str] = <factory>)
 
  Methods defined here:
__eq__(self, other)
Return self==value.
__init__(self, counter: int = 0, dependencies: Set[str] = <factory>) -> None
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__annotations__ = {'counter': <class 'int'>, 'dependencies': typing.Set[str]}
__dataclass_fields__ = {'counter': Field(name='counter',type=<class 'int'>,default=...appingproxy({}),kw_only=False,_field_type=_FIELD), 'dependencies': Field(name='dependencies',type=typing.Set[str],d...appingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__hash__ = None
__match_args__ = ('counter', 'dependencies')
counter = 0

 
class PackageSeenTree(builtins.tuple)
    PackageSeenTree(name, level, seen)
 
PackageSeenTree(name, level, seen)
 
 
Method resolution order:
PackageSeenTree
builtins.tuple
builtins.object

Methods defined here:
__getnewargs__(self)
Return self as a plain tuple.  Used by copy and pickle.
__repr__(self)
Return a nicely formatted representation string
_asdict(self)
Return a new dict which maps field names to their values.
_replace(self, /, **kwds)
Return a new PackageSeenTree object replacing specified fields with new values

Class methods defined here:
_make(iterable) from builtins.type
Make a new PackageSeenTree object from a sequence or iterable

Static methods defined here:
__new__(_cls, name, level, seen)
Create new instance of PackageSeenTree(name, level, seen)

Data descriptors defined here:
name
Alias for field number 0
level
Alias for field number 1
seen
Alias for field number 2

Data and other attributes defined here:
__match_args__ = ('name', 'level', 'seen')
_field_defaults = {}
_fields = ('name', 'level', 'seen')

Methods inherited from builtins.tuple:
__add__(self, value, /)
Return self+value.
__contains__(self, key, /)
Return key in self.
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(self, key, /)
Return self[key].
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__rmul__(self, value, /)
Return value*self.
count(self, value, /)
Return number of occurrences of value.
index(self, value, start=0, stop=9223372036854775807, /)
Return first index of value.
 
Raises ValueError if the value is not present.

Class methods inherited from builtins.tuple:
__class_getitem__(...) from builtins.type
See PEP 585

 
class PkgResourcesPackagesAnalysis(_PackagesAnalysisTemplate)
    This class implements package dependencies analysis for python packages.
 
 
Method resolution order:
PkgResourcesPackagesAnalysis
_PackagesAnalysisTemplate
abc.ABC
builtins.object

Methods defined here:
check_exists(self, package_name: str) -> bool
This method should True if package exists else False.
get_all(self) -> Iterable[str]
The generator yields all installed packages from importlib.
get_dependencies(self, package_name: str) -> Iterable[str]
This generator yields all installed dependencies
names for a package name.

Data and other attributes defined here:
__abstractmethods__ = frozenset()

Methods inherited from _PackagesAnalysisTemplate:
dependencies_count(self, package_name: str, package_counters: Dict[str, SupplyChainAnalysis.PackageCounter] = None) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method counts the dependencies number and
the seen time number.
make_statistics(self) -> Dict[str, SupplyChainAnalysis.PackageCounter]
This method make statistics about packages and dependencies.
package_seen_tree(self, package_name: str, level: int = 0, seen: set = None) -> Iterable[SupplyChainAnalysis.PackageSeenTree]
This generator yields dependencies recursively
with level and seen state.
print_dependencies_tree(self, package_name: str) -> None
This method prints dependencies tree for a package.

Static methods inherited from _PackagesAnalysisTemplate:
print_line_grepable_details(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints details in grepable lines.
print_package_counter(counters: Dict[str, SupplyChainAnalysis.PackageCounter]) -> None
This method prints package counters and statistics.

Data descriptors inherited from _PackagesAnalysisTemplate:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
exit(status=None, /)
Exit the interpreter by raising SystemExit(status).
 
If the status is omitted or None, it defaults to zero (i.e., success).
If the status is an integer, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).
main() -> int
This function is the main function
to start the module from command line.

 
Data
        Dict = typing.Dict
Iterable = typing.Iterable
Set = typing.Set
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nSupplyChainAnalysis Copyright (C) 2025 Mauric...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis module provides CLI and functions to analy...ependencies in python packages and apt packages.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/SupplyChainAnalysis'
apt_imported = True
argv = ['/usr/lib/python3.10/pydoc.py', '-w', 'SupplyChainAnalysis.py']
cache = <apt.cache.Cache object>
copyright = '\nSupplyChainAnalysis Copyright (C) 2025 Mauric...ome to redistribute it\nunder certain conditions.\n'
executable = '/usr/bin/python3'
installed_packages_names = {'Brlapi', 'LibAppArmor', 'Mako', 'MarkupSafe', 'Pillow', 'PyGObject', ...}
license = 'GPL-3.0 License'
modules = {'apt': <class 'SupplyChainAnalysis.AptPackagesAnalysis'>, 'importlib': <class 'SupplyChainAnalysis.ImportlibPackagesAnalysis'>, 'pkg_resources': <class 'SupplyChainAnalysis.PkgResourcesPackagesAnalysis'>}
stderr = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>
working_set = <pkg_resources.WorkingSet object>

 
Author
        Maurice Lambert