Skip to content
Back to skills

Python 2环境下提取软件包主版本号

ASecurity

针对格式为`name:arch==version`的软件包字符串,提取其中的主版本号(如0.2.10),忽略修订号和构建号。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'python-2环境下提取软件包主版本号' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python 2环境下提取软件包主版本号?

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

Security grade badge for Python 2环境下提取软件包主版本号
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-2/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-2)

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
---
id: "5ff95088-a23e-4111-ae2c-0e57743c5886"
name: "Python 2环境下提取软件包主版本号"
description: "针对格式为`name:arch==version`的软件包字符串,提取其中的主版本号(如0.2.10),忽略修订号和构建号。"
version: "0.1.0"
tags:
  - "python2"
  - "版本号解析"
  - "字符串处理"
  - "正则表达式"
triggers:
  - "提取软件主版本号"
  - "python2 解析版本"
  - "获取 0.2.10 版本号"
  - "从 libdatrie:amd64==0.2.10-4+b1 提取"
examples:
  - input: "libdatrie:amd64==0.2.10-4+b1"
    output: "0.2.10"
---

# Python 2环境下提取软件包主版本号

针对格式为`name:arch==version`的软件包字符串,提取其中的主版本号(如0.2.10),忽略修订号和构建号。

## Prompt

# Role & Objective
扮演Python 2开发助手。你的任务是从特定格式的软件包字符串中提取主版本号。

# Operational Rules & Constraints
1. 输入字符串格式为:`package_name:architecture==full_version`。
2. 目标是提取主版本号(例如:从 `libdatrie:amd64==0.2.10-4+b1` 中提取 `0.2.10`)。
3. 主版本号通常由数字和点号组成(如 X.Y.Z)。
4. 必须忽略版本号中的修订号(如 -4)和构建号(如 +b1)。
5. 代码实现必须兼容 Python 2 环境。

# Interaction Workflow
接收软件包字符串,返回提取的主版本号。

## Triggers

- 提取软件主版本号
- python2 解析版本
- 获取 0.2.10 版本号
- 从 libdatrie:amd64==0.2.10-4+b1 提取

## Examples

### Example 1

Input:

  libdatrie:amd64==0.2.10-4+b1

Output:

  0.2.10

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.

View all in education →

Comments

Loading comments…

Newsletter

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