Immutable, typed result objects for CWE, Standards, and Schema workflows.
Provides strongly-typed Python models for Common Weakness Enumeration (CWE) analysis, standards framework mappings, and schema validation workflows.
- Zero Dependencies - Pure Python with no external requirements
- Immutable Design - Functional-style helpers return new instances
- Type Safety - Full static typing with
py.typedmarker - Composable - Small building blocks for complex workflows
- Memory Efficient - Frozen dataclasses for better performance
pip install civic-transparency-py-cwe-typesRequirements: Python 3.12+
from ci.transparency.cwe.types.cwe.results import CweLoadingResult, add_cwe
# Create immutable result objects
result = CweLoadingResult()
result = add_cwe(result, "CWE-79", {
"id": "CWE-79",
"name": "Cross-site Scripting",
"category": "injection"
})
print(f"Loaded CWEs: {result.cwe_count}")
print(f"Has errors: {result.messages.has_errors}")| Domain | Purpose | Key Results |
|---|---|---|
| CWE | Load, validate, analyze CWE data | CweLoadingResult, CweValidationResult, CweRelationshipResult |
| Standards | Framework loading & CWE mappings | StandardsLoadingResult, StandardsMappingResult |
| Schema | Generic schema operations | SchemaLoadingResult, SchemaValidationResult |
| CWE Schema | Domain-specific CWE schema validation | CweSchemaLoadingResult, CweSchemaValidationResult |
- Usage Guide - Detailed examples and patterns
- API Reference - Complete module documentation
- Contributing - Development guidelines
git clone https://github.com/civic-interconnect/civic-transparency-py-cwe-types
cd civic-transparency-py-cwe-types
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync --extra dev --extra docsRun tests:
uv run pytest
uv run pyright src/This specification follows semantic versioning. See CHANGELOG.md for version history.
MIT © Civic Interconnect