跳转到主要内容

用于处理Thoth组件报告的代码。

项目描述

这个名为 thoth-report-processing 的库用于项目 Thoth,用于处理由 Thoth 组件提供的所有输出,并使用 thoth-storages 库 存储这些输出。

安装和使用

可以通过 pip 或 Pipenv 从 PyPI 安装此库

pipenv install thoth-report-processing

此库不提供任何 CLI,而是一个支持 Thoth 其他部分的底层库。

报告处理

要处理的报告可以通过两种方式检索

  • 本地,提供路径。

  • 使用 Ceph S3 提供以下环境变量

    THOTH_CEPH_KEY_ID=<ceph_key_id>
    THOTH_CEPH_SECRET_KEY=<ceph_key_id>
    THOTH_S3_ENDPOINT_URL=<s3_endpoint_url>
    THOTH_CEPH_HOST=<ceph_host>
    THOTH_CEPH_BUCKET=<ceph_bucket>
    THOTH_CEPH_BUCKET_PREFIX=<ceph_bucket_prefix>
    THOTH_DEPLOYMENT_NAMR=<deployment_name>

查看 thoth-storages 当前可用的适配器,请点击此处 这里

安全指标

使用本地路径聚合安全指标

from thoth.report_processing.components.security import SecurityIndicatorsBandit, SecurityIndicatorsCloc
from thoth.report_processing.components.security import SecurityIndicatorsAggregator

_SI_BANDIT_FOLDER_PATH =<>
_SI_CLOC_FOLDER_PATH =<>

security_aggregator = SecurityIndicatorsAggregator()

si_bandit_report = SecurityIndicatorsBandit.aggregate_security_indicator_bandit_results(
   security_indicator_bandit_repo_path=_SI_BANDIT_FOLDER_PATH, is_local=True
)[0]

si_cloc_report = SecurityIndicatorsCloc.aggregate_security_indicator_cloc_results(
   security_indicator_cloc_repo_path=_SI_CLOC_FOLDER_PATH, is_local=True
)[0]

aggregated_json = security_aggregator.create_si_aggregated_json(
   si_bandit_report=si_bandit_report, si_cloc_report=si_cloc_report
)

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

thoth-report-processing-0.8.1.tar.gz (103.7 kB 查看哈希值)

上传时间

构建分布

thoth_report_processing-0.8.1-py3-none-any.whl (45.7 kB 查看哈希值)

上传时间 Python 3

支持