--- id: cwe2 version: "3.0.0" license: MIT and LicenseRef-scancode-cwe-tou license_treatment: permissive maintenance: dormant --- # cwe2 — cwe2 is a CWE common weakness enumeration library for Python License: permissive · Maintenance: dormant · Downloads: 78.9K/mo ## What it is and what it does cwe2 is a Python wrapper around the Common Weakness Enumeration (CWE) database maintained by MITRE. It bundles a vendored copy of the CWE data and exposes it through a simple query interface, letting you fetch weakness records by ID and access their structured attributes—name, description, related weaknesses, mitigation strategies, and more. The package is useful for security tools, vulnerability scanners, and code analysis systems that need to resolve CWE IDs to human-readable weakness information. The library requires Python 3.7 or later and has minimal dependencies. It provides convenience methods to retrieve curated subsets like the top 25 CWEs, OWASP top ten 2021 weaknesses, and those used by the National Vulnerability Database (NVD). Maintenance is dormant but the package is stable and carries no known security vulnerabilities. Use it for: - Resolve CWE IDs in vulnerability reports to fetch full weakness descriptions and mitigation guidance. - Build security dashboards or scanners that need to display MITRE CWE metadata alongside CVE findings. - Analyze code or dependencies and map detected weakness categories to their MITRE definitions for compliance reporting. - Query curated CWE lists like top 25 or OWASP top ten 2021 for security training or policy enforcement. - Enrich vulnerability data pipelines with standardized CWE weakness context and related attack patterns. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. cwe2 provides programmatic access to the Common Weakness Enumeration (CWE) database, allowing you to look up vulnerability weakness categories by ID and retrieve their detailed attributes. Yes, if you need to programmatically look up CWE weakness data in a Python application. The package is stable, has no known vulnerabilities, and low install friction. The main caveat is dormant maintenance—the vendored CWE data may lag behind MITRE's official updates, so verify the data freshness suits your use case before relying on it for critical security decisions. ## Install pip install cwe2 uv add cwe2 poetry add cwe2 ## Installing cwe2 Before you install: Low install friction with a single lightweight dependency (importlib-resources). Maintenance is dormant—last commit was 2024-08-29 and no releases in over a year, though the repository remains active and the package is marked Production/Stable. License in practice: Dual-licensed under MIT and LicenseRef-scancode-cwe-tou. The CWE data itself carries MITRE's terms of use; permissive for code but you must respect MITRE's CWE usage terms when distributing or relying on the weakness data. Quickstart: pip install cwe2 from cwe2.database import Database db = Database() weakness = db.get(15) print(weakness.description) Verify before relying: - Whether the vendored CWE data is kept current with MITRE's official CWE updates, given the dormant maintenance status. - Performance characteristics when querying large numbers of weaknesses or iterating the full database. ## Package facts - License: MIT and LicenseRef-scancode-cwe-tou (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 78.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags CWE lookup library, common weakness enumeration database, vulnerability weakness categories, CWE ID resolver, security weakness reference, MITRE CWE data access, CVE weakness mapping, vulnerability-reference, security-metadata [View on SkillFed](https://skillfed.io/packages/cwe2) · [View on PyPI](https://pypi.org/project/cwe2/)