Skip to content
Back to skills

1178 Name Skill 7b7c4eed

ASecurity

Deterministically find license information for Python packages by checking PyPI metadata first, then falling back to Git repository LICENSE files using shallow cloning.

  • 9 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 1, 2026
developmentpythongobashdjangogit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 1, 2026

npx -y skills add tools-only/X-Skills --skill 1178-name-skill_7b7c4eed --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1178 Name Skill 7b7c4eed?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1178 Name Skill 7b7c4eed
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1178-name-skill-7b7c4eed/badge)](https://www.skillsdirectory.com/skills/tools-only-1178-name-skill-7b7c4eed)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-packaging-license-finder
description: Deterministically find license information for Python packages by checking PyPI metadata first, then falling back to Git repository LICENSE files using shallow cloning.
allowed-tools: Bash Skill
---

# 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:

```bash
./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:

1. **Get the source repository URL** from the PyPI metadata (the script will provide it)
2. **Use the shallow-clone skill** to clone the repository:
   ```
   Skill: git:shallow-clone
   ```
3. **Search for LICENSE files** in the cloned repository:
   ```bash
   find . -iname "license*" -o -iname "copying*" -o -iname "copyright*" | head -10
   ```
4. **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
```bash
./scripts/find_license.py requests
```
**Expected**: Find "Apache-2.0" from PyPI metadata

### Find License for Package with Missing PyPI License
```bash
./scripts/find_license.py some-package
```
**Expected**: Fall back to repository search if PyPI metadata is incomplete

### Specific Version Analysis
```bash
./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.

Files in this skill

  • README.md999 B
  • skill.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.