Agent skill
python-packaging-license-finder
Deterministically find license information for Python packages by checking PyPI metadata first, then falling back to Git repository LICENSE files using shallow cloning.
Install this agent skill to your Project
npx add-skill https://github.com/opendatahub-io/ai-helpers/tree/main/helpers/skills/python-packaging-license-finder
SKILL.md
Python Package License Finder
This skill helps you deterministically find license information for Python packages using a two-step approach: first checking PyPI metadata, then searching the source repository if needed.
Instructions
When a user asks to find the license for a Python package, follow this deterministic process:
Step 1: Check PyPI Metadata
First, attempt to find the license from PyPI using the package inspection script:
./scripts/find_license.py <package_name> [version]
If the script finds a license in the PyPI metadata, stop here and return the license name.
Step 2: Search Git Repository (if PyPI fails)
If no license is found in PyPI metadata, search the package's source repository:
- Get the source repository URL from the PyPI metadata (the script will provide it)
- Use the shallow-clone skill to clone the repository:
Skill: git:shallow-clone - Search for LICENSE files in the cloned repository:
bash
find . -iname "license*" -o -iname "copying*" -o -iname "copyright*" | head -10 - Read the license file to identify the license type:
bash
head -20 <license_file>
Step 3: Report Results
- License Found: Return the license name (e.g., "MIT License", "Apache-2.0", "GPL-3.0")
- License Not Found: Report that the license could not be determined
Usage Examples
Find License for Popular Package
./scripts/find_license.py requests
Expected: Find "Apache-2.0" from PyPI metadata
Find License for Package with Missing PyPI License
./scripts/find_license.py some-package
Expected: Fall back to repository search if PyPI metadata is incomplete
Specific Version Analysis
./scripts/find_license.py django 4.2.0
Expected: Find license for specific Django version
Error Handling
Package Not Found
- Verify package name spelling
- Check package availability on PyPI
- Suggest alternative package names
Repository Access Issues
- Report if source repository is unavailable
- Note private/restricted repositories
- Suggest manual license verification
License File Parsing
- Handle non-standard license file formats
- Report unclear or multiple licenses
- Recommend manual review for complex cases
Integration Notes
This skill complements:
- python-packaging-complexity - License info helps assess redistribution complexity
- python-packaging-license-checker - Provides license names for compatibility assessment
- python-packaging-source-finder - Uses similar PyPI metadata analysis
The skill focuses on finding license information, while license-checker focuses on assessing license compatibility for redistribution.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
python-packaging-env-finder
Investigate environment variables that can be set when building Python wheels for a given project. Analyzes setup.py, CMake files, and other build configuration files to discover customizable build environment variables.
torchtalk-analyzer
Analyze PyTorch internals across Python, C++, and CUDA layers using the TorchTalk MCP server. Use when asked about how PyTorch operators work internally, where functions are implemented, what would break if code is modified, or finding tests for PyTorch operators.
ai-bug-fix-triage
Triage JIRA bugs against repository code to classify AI fixability. Use when reviewing a backlog of bugs to determine which ones an AI agent can fix.
python-packaging-complexity
Analyze Python package build complexity by inspecting PyPI metadata. Evaluates compilation requirements, dependencies, distribution types, and provides recommendations for wheel building strategies.
coderabbit-review
Evaluate CodeRabbit PR comments and fix or reply
git-shallow-clone
Perform a shallow clone of a Git repository to a temporary location.
Didn't find tool you were looking for?