{"id":22097435,"url":"https://github.com/nuclei-software/npk-checker","last_synced_at":"2025-10-13T17:39:26.672Z","repository":{"id":250974257,"uuid":"836014859","full_name":"Nuclei-Software/npk-checker","owner":"Nuclei-Software","description":"Nuclei PacKage(NPK) Checker Tool","archived":false,"fork":false,"pushed_at":"2024-07-31T03:05:42.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T14:43:29.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nuclei-Software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T01:53:22.000Z","updated_at":"2024-07-31T03:05:45.000Z","dependencies_parsed_at":"2024-07-31T05:10:35.077Z","dependency_job_id":null,"html_url":"https://github.com/Nuclei-Software/npk-checker","commit_stats":null,"previous_names":["nuclei-software/npk-checker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nuclei-Software/npk-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnpk-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnpk-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnpk-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnpk-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nuclei-Software","download_url":"https://codeload.github.com/Nuclei-Software/npk-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nuclei-Software%2Fnpk-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016369,"owners_count":26085828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T04:15:33.526Z","updated_at":"2025-10-13T17:39:26.656Z","avatar_url":"https://github.com/Nuclei-Software.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 功能概述\n\n本组件检查工具旨在自动化评估和确保代码质量，其核心功能聚焦于代码风格、变量命名、函数结构以及依赖关系的合规性检查，专为检测npk组件包的合法性而设计。  \n该工具兼容**Python 3.11.1**环境。\n\n关于 `NPK`的设计文档目前请参见: https://github.com/Nuclei-Software/nuclei-sdk/wiki/Nuclei-Studio-NPK-Introduction\n\n**如果使用上有Bug反馈，请直接发 [issue](https://github.com/Nuclei-Software/npk-checker/issues) 给本项目，也欢迎直接给项目贡献修改。**\n\n## 必需的第三方库\n\n为了启用此工具的所有特性，您需要确保以下第三方库已被安装：\n\n- `semantic-version`: 用于语义化版本号的解析与比较。\n- `PyYAML`: 支持YAML格式文件的读取与解析。\n- `jsonschema`: 实现JSON Schema的验证功能，确保数据结构的一致性与完整性。\n\n## 安装指导\n\n在您的项目目录中打开终端，执行以下命令以安装必需的第三方库：\n\n```shell\n# 如果你有python3的环境，这里pip可能需要换成 pip3\npip install semantic-version PyYAML jsonschema\n```\n\n## 使用指南\n\n### 启动检查\n\n运行检查工具，只需指定目标目录或ZIP文件的路径，工具将自动分析其中的组件包，评估其编码风格与规范遵守情况。\n\n```shell\npython npk_checker.py \u003c目录路径或zip文件路径\u003e\n```\n\n- `\u003c目录路径或zip文件路径\u003e`: 指定待检查的组件包所在目录或压缩包的完整路径。\n\n### 示例\n\n假设您的项目位于 `~/projects/my_project` 目录下，您希望检查名为 `my_component` 的子目录，命令如下：\n\n```shell\ncd ~/projects/my_project\npython npk_checker.py ./my_component\n```\n\n或者，若组件以ZIP格式打包，存放于同一目录下，检查流程同样简洁：\n\n```shell\npython npk_checker.py ./my_component.zip\n```\n\n返回内容说明：\n\n`[NPKVerificationResult]` 包含脚本检测到的各种警告或错误信息，\n`[NPKInfo]` 为所检测组件包的包信息。下面以**sdk-n100_sdk**为例。\n\n```\nC:\\nuclei-studio-ci\\npk_pacakge_verification_tool\u003epython npk_checker.py C:\\Users\\chendong\\nuclei-pack-npk-v2\\NPKs\\nuclei\\Software_Development_Kit\\sdk-n100_sdk\\0.1.0\n\n[NPKVerificationResult]\nC:\\Users\\chendong\\nuclei-pack-npk-v2\\NPKs\\nuclei\\Software_Development_Kit\\sdk-n100_sdk\\0.1.0\\nuclei-sdk-n100-0.1.0\\SoC\\evalsoc\\Board\\nuclei_fpga_eval\\npk.yml： 'version' is a required property\nC:\\Users\\chendong\\nuclei-pack-npk-v2\\NPKs\\nuclei\\Software_Development_Kit\\sdk-n100_sdk\\0.1.0\\nuclei-sdk-n100-0.1.0\\SoC\\evalsoc\\Common\\npk.yml： 'version' is a required property\nDirectory 'C:\\Users\\chendong\\nuclei-pack-npk-v2\\NPKs\\nuclei\\Software_Development_Kit\\sdk-n100_sdk\\0.1.0' contains invalid variables: workspace_loc:/${ProjName\n未能找到匹配的npk文件：名称:sdk-nuclei_sdk, 版本:, 拥有者:\n是否执行打包操作？(y/n,回车略过): n\n[NPKInfo]\nnpkpacagename: sdk-n100_sdk\nowner: nuclei\nversion: 0.1.0\ntype: sdk\nos: None\ndependencies:\n  name:sdk-nuclei_sdk version: owner:\nzipsize: None\nmd5sum: None\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclei-software%2Fnpk-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuclei-software%2Fnpk-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuclei-software%2Fnpk-checker/lists"}