Logo Python Packaging License Checker

Python Packaging License Checker

Tổ chức
opendatahub-io
python-packaging-license-checker

Use this skill to check whether a Python package license is compatible with redistribution in Red Hat products, using the Fedora License Data as the authoritative policy source. Produces a structured six-field verdict with escalation guidance for non-trivial cases.

Tổng quan

Nhà phát hànhopendatahub-io
Kho mãai-helpers
Tên kỹ năngpython-packaging-license-checker
Sao
39
Bản fork
76
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được opendatahub-io công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Python Packaging License Checker trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-license-checker
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-python-packaging/skills/python-packaging-license-checker .claude/skills/python-packaging-license-checker
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Python Packaging License Checker trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Python Packaging License Checker ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Python Packaging License Checker với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Python Package License Compatibility Checker

Evaluate whether a Python package license permits redistribution in Red Hat products.

Policy basis: Red Hat redistribution policy follows the Fedora Linux license policy. Use the Fedora License Data as the authoritative source -- NOT OSI-approval status.

Inputs

  • package_name: Python package name
  • repo_url: upstream repository URL (if already known — skip the source-finder step and clone this directly)
  • source_available: whether buildable source exists (if already known)
  • upstream_org: name and primary country of the maintaining organisation (if already known)

Step 1: Locate and clone the source repository

If a repo_url is provided, skip the source-finder step and use the provided URL directly with the git-shallow-clone skill.

Otherwise, use the python-packaging-source-finder skill to find the upstream repo URL:

text
Skill: python-packaging-source-finder

Then use the git-shallow-clone skill to clone the repository locally:

text
Skill: git-shallow-clone

This gives a local path to the cloned repo for deterministic license inspection.

Step 2: Read the license from source

Search the cloned repo root for license files in this order: LICENSE, LICENSE.txt, LICENSE.md, COPYING, COPYING.txt, LICENCE, LICENCE.txt

bash
ls <clone_path>/{LICENSE,COPYING,LICENCE}{,.txt,.md} 2>/dev/null | head -1

Read the license file (up to 128 KB) and map to an SPDX identifier. If the file exceeds 128 KB, read only the first 128 KB and note the truncation. If the file cannot be read within 30 seconds, treat it as unreadable and set Verdict: NEEDS-HUMAN-REVIEW with a note explaining the timeout.

Also check pyproject.toml or setup.cfg for a license field as a secondary signal. If the PyPI metadata license differs from the source file, set Source verified: MISMATCH (PyPI: [X], repo: [Y]) and use the source file as authoritative.

Normalise to SPDX ID using exact then fuzzy matching:

  • Deterministic: "Apache 2" -> Apache-2.0, "GPL v2" -> GPL-2.0-only, "MIT License" -> MIT, "LGPLv2.1" -> LGPL-2.1-only
  • Ambiguous (do NOT auto-map): "BSD", "GPLv3" -> set NEEDS-HUMAN-REVIEW. These tokens map to multiple SPDX IDs; require human confirmation.

Compound expressions: If the license contains AND or OR:

  • AND: split into components; every component must be individually allowed. If any single component is not-allowed, the whole expression is BLOCKED. Document the split in Notes.
  • OR: evaluate each component; use the most permissive allowed one. If none are allowed, the overall verdict is the best individual verdict.

If no license file found and no SPDX mapping possible: Verdict: NEEDS-HUMAN-REVIEW.

Clean up the clone when done:

bash
if [ -n "${CLONE_DIR}" ] && echo "${CLONE_DIR}" | grep -q '^/tmp/'; then
  rm -rf -- "${CLONE_DIR}"
else
  echo "ERROR: refusing to delete '${CLONE_DIR}' -- not under /tmp/" >&2
fi

Step 3: Look up license in Fedora License Data

Fetch the live data:

text
WebFetch: https://gitlab.com/fedora/legal/fedora-license-data/-/jobs/artifacts/main/raw/fedora-licenses.json?job=json

Search for an entry matching the SPDX ID (case-insensitive on spdx_abbrev). Each entry has a status field which may be a string or an array. Normalise to an array and apply the following deterministic mapping.

Fedora License Data defines these status values:

StatusMeaningOutcome
allowedApproved for Fedora packagesProceed to Step 4
allowed-fontsApproved only for font packagesProceed to Step 4 (add note: "License approved for fonts only; verify component type")
allowed-documentationApproved only for documentationProceed to Step 4 (add note: "License approved for documentation only; verify component type")
allowed-contentApproved only for content (non-code)Proceed to Step 4 (add note: "License approved for content only; verify component type")
not-allowedExplicitly prohibitedVerdict: BLOCKED

Apply fail-closed logic:

  • If any entry is "not-allowed" -> Verdict: BLOCKED
  • If all entries are one of the allowed* statuses above (and none "not-allowed") -> proceed to Step 4
  • If the status field is missing, empty, or contains a value not listed in the table above -> Verdict: NEEDS-HUMAN-REVIEW (note the unrecognised value)
  • SPDX ID not found in data -> Verdict: NEEDS-HUMAN-REVIEW

Fallback table (use only when the JSON fetch fails):

StatusSPDX identifiers (representative)
allowedMIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, PSF-2.0, CC0-1.0
allowedGPL-2.0-only, GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later
allowedLGPL-2.0-only, LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-or-later
allowedAGPL-3.0-only, AGPL-3.0-or-later, MPL-2.0, EUPL-1.2, EPL-2.0
not-allowedSSPL-1.0, BUSL-1.1, Commons-Clause
ESCALATEAny custom/proprietary license not in SPDX

When using fallback, append to Notes: "Fedora License Data unreachable; fallback table used. Verify at https://docs.fedoraproject.org/en-US/legal/allowed-licenses/"

Step 4: Verdict refinement (apply in order)

Rule A -- Proprietary or custom license (not in Fedora data):

First check the Vendor Agreements table below. If covered by an agreement: Verdict: ALLOWED, Notes: "Covered by Red Hat [Vendor] redistribution agreement."

Otherwise:

  • Red Hat / IBM-owned upstream (e.g. Neural Magic): Verdict: ESCALATE-TO-LEGAL. Notes: "Red Hat-owned proprietary license. Must be relicensed before inclusion. Open a ServiceNow opensource-legal ticket."
  • Third-party proprietary: Verdict: ESCALATE-TO-LEGAL. Notes: "Third-party proprietary license. May be includable as a EULA-listed component. Open a legal-review task."

Rule B -- AGPL-3.0 (status=allowed, SPDX is AGPL-3.0-only or -or-later): Verdict: ALLOWED-WITH-CAVEAT. Notes: "AGPL-3.0 is allowed for redistribution but is frequently part of a dual-licensing strategy, increasing risk. PM sign-off required."

Rule C -- All other allowed licenses: Verdict: ALLOWED. Notes: omit unless compliance note needed (e.g. LGPL dynamic linking does not propagate copyleft).

Rule D -- Not-allowed: Verdict: BLOCKED. Notes: "License is on the Fedora not-allowed list."

Step 5: Compliance checks

Build compliance (independent of license verdict): If source_available is false or no buildable source exists (no setup.py, pyproject.toml, or equivalent):

  • Build compliance: BUILD-COMPLIANCE-FLAG
  • Append to Notes: "No buildable source. Options: (1) request upstream sdist, (2) make dependency optional, (3) file PSX exception with 6-month deadline per PSS.SBR.02.02."
  • Otherwise: Build compliance: OK

Export compliance (independent of license verdict): Check the upstream org's primary country against these authoritative machine-readable sources:

For each source checked, record the following metadata:

  • source_url: the URL fetched
  • retrieved_at: ISO 8601 timestamp of the fetch
  • fetch_outcome: success or failure
  • retry_count: number of retries attempted (0 if first attempt succeeded)

If flagged by any source:

  • Export compliance: EXPORT-COMPLIANCE-FLAG
  • Append to Notes: "Upstream org may require export compliance review. Contact exportcompliance@redhat.com. Source: <source_url>; Fetched: <retrieved_at>; Outcome: <fetch_outcome>; Retries: <retry_count>. Geopolitical sensitivity does not automatically block inclusion."

If sources are unreachable after 2 retries:

  • Export compliance: EXPORT-COMPLIANCE-FLAG
  • Append to Notes: "Export sanctions data unreachable (Retries: <retry_count>). Verdict: NEEDS-HUMAN-REVIEW"

Otherwise: Export compliance: OK

Output Format

Produce ONLY this six-field block. No preamble, no extra text.

text
_License:_ [SPDX expression, or "non-SPDX: [raw string]" if unmappable]
_Source verified:_ YES | NO | MISMATCH (PyPI: [X], repo: [Y])
_Verdict:_ ALLOWED | ALLOWED-WITH-CAVEAT | NEEDS-HUMAN-REVIEW | ESCALATE-TO-LEGAL | BLOCKED
_Build compliance:_ OK | BUILD-COMPLIANCE-FLAG
_Export compliance:_ OK | EXPORT-COMPLIANCE-FLAG
_Notes:_ [Actionable guidance. Omit if verdict is ALLOWED and all flags are OK.]

Vendor Agreements

VendorCovered components
NVIDIACUDA libraries, runtimes, NCCL, and related NVIDIA components
Intel GaudiGaudi AI accelerator software and libraries
IBM SpyreIBM Spyre AI hardware and associated software components

Quick Reference

ScenarioVerdictBuild
MIT, Apache-2.0, BSD-*, ISC, PSF-2.0ALLOWEDOK
GPL-*, LGPL-*ALLOWEDOK
AGPL-3.0-*ALLOWED-WITH-CAVEATOK
SSPL-1.0, BUSL-1.1, Commons-ClauseBLOCKED--
RH-owned proprietaryESCALATE-TO-LEGAL--
Third-party proprietary (no vendor agreement)ESCALATE-TO-LEGAL--
PyPI/repo license mismatchper repo license (MISMATCH noted)OK
No buildable sourceper licenseFLAG

Error Handling

  • Fedora data unreachable: Use fallback table; append note.
  • Source repo not found: If python-packaging-source-finder returns null/low confidence, set Source verified: NO, verdict: NEEDS-HUMAN-REVIEW.
  • Source repo private/inaccessible: Set Source verified: NO. Verdict: NEEDS-HUMAN-REVIEW.
  • Multiple conflicting LICENSE files: Source verified: MISMATCH, verdict: NEEDS-HUMAN-REVIEW. Note the conflicting files.

Câu hỏi thường gặp

Kỹ năng AI Python Packaging License Checker làm được gì?

Use this skill to check whether a Python package license is compatible with redistribution in Red Hat products, using the Fedora License Data as the authoritative policy source. Produces a structured six-field verdict with escalation guidance for non-trivial cases.

Vì sao nên dùng Python Packaging License Checker trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Python Packaging License Checker là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Python Packaging License Checker trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-python-packaging/skills/python-packaging-license-checker. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Python Packaging License Checker?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Python Packaging License Checker với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Python Packaging License Checker với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Python Packaging License Checker có miễn phí không?

Có. Kỹ năng này được opendatahub-io phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇