# Third_Party_Notice_software **Repository Path**: keilo-wang/Third_Party_Notice_software ## Basic Information - **Project Name**: Third_Party_Notice_software - **Description**: No description available - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2025-02-17 - **Last Updated**: 2025-03-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Third_Party_Notice_software #### 介绍 #### 使用说明 1. `pip install requests tqdm bs4` 3. `python Third_Party_Notice.py output.txt --token your_github_token` --input_file path_of_feching_license_file 1. output.txt:Notice文件名(默认生成位置为当前目录) 2. --token:your_github_token 3. --input_file: Path of text file including package names for fetching license (one per line), specify this param will disable searching package names in `code_directory` #### 原理 1. 初始化: 1. 配置日志系统,创建日志目录。 2. 加载SPDX License列表。 3. 设置常量和包名别名映射。 3. 发现第三方依赖库: 读取input_file中的三方库名。 4. 获取许可证信息: 1. 并行化获取许可证,优先从PyPI获取。 2. 如果PyPI找不到许可证,从GitHub查找相关仓库。 3. 标准化许可证名称,获取完整的许可证文本。 5. 提取版权声明: 1. 从LICENSE文件或README文件中提取版权声明。 2. 使用正则表达式匹配常见格式,支持多种语言。 6. 生成输出: 1. 将结果按照指定格式写入输出文件。 2. 包括软件名称、许可证类型、版权信息和许可证文本。 3. 针对未匹配三方库输出之unknown.txt中人工复查。 7. 处理异常: 保证代码的稳健性,处理可能出现的错误。