Immutable datatype library for Common Weakness Enumeration (CWE) analysis and validation workflows
Project description
Civic Transparency CWE Types
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.
Features
- 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
Installation
pip install civic-transparency-py-cwe-types
Requirements: Python 3.12+
Quick Start
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}")
What's Included
| 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 |
Documentation
- Usage Guide - Detailed examples and patterns
- API Reference - Complete module documentation
- Contributing - Development guidelines
Development
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 docs
Run tests:
uv run pytest
uv run pyright src/
Versioning
This specification follows semantic versioning. See CHANGELOG.md for version history.
License
MIT © Civic Interconnect
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file civic_transparency_cwe_types-0.0.12.tar.gz.
File metadata
- Download URL: civic_transparency_cwe_types-0.0.12.tar.gz
- Upload date:
- Size: 781.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53fc6eac7d8038ebb08c5ef713218f79a81f18c9dcf30d10e6a28077cb07ebd9
|
|
| MD5 |
dc7023a22120382ace6d8e8ee11591e2
|
|
| BLAKE2b-256 |
82d3654835dadcc8834deb35b654bd215f9d9e781edf9a29f07545a8ea254627
|
Provenance
The following attestation bundles were made for civic_transparency_cwe_types-0.0.12.tar.gz:
Publisher:
release.yml on civic-interconnect/civic-transparency-py-cwe-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
civic_transparency_cwe_types-0.0.12.tar.gz -
Subject digest:
53fc6eac7d8038ebb08c5ef713218f79a81f18c9dcf30d10e6a28077cb07ebd9 - Sigstore transparency entry: 600988970
- Sigstore integration time:
-
Permalink:
civic-interconnect/civic-transparency-py-cwe-types@b26c82e9852e46775592295cf09ded91db20ab84 -
Branch / Tag:
refs/tags/v0.0.12 - Owner: https://github.com/civic-interconnect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b26c82e9852e46775592295cf09ded91db20ab84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file civic_transparency_cwe_types-0.0.12-py3-none-any.whl.
File metadata
- Download URL: civic_transparency_cwe_types-0.0.12-py3-none-any.whl
- Upload date:
- Size: 53.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e1945ca3335c8c6926bbf32b43042e7a9409f5feae7cdd774c9542658003d18
|
|
| MD5 |
520b5e891ae966c83fea81665740ac30
|
|
| BLAKE2b-256 |
22c923496433cb25a5771fedf10e5f8147f21401adb23e6ad286e104c7a517e7
|
Provenance
The following attestation bundles were made for civic_transparency_cwe_types-0.0.12-py3-none-any.whl:
Publisher:
release.yml on civic-interconnect/civic-transparency-py-cwe-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
civic_transparency_cwe_types-0.0.12-py3-none-any.whl -
Subject digest:
2e1945ca3335c8c6926bbf32b43042e7a9409f5feae7cdd774c9542658003d18 - Sigstore transparency entry: 600988971
- Sigstore integration time:
-
Permalink:
civic-interconnect/civic-transparency-py-cwe-types@b26c82e9852e46775592295cf09ded91db20ab84 -
Branch / Tag:
refs/tags/v0.0.12 - Owner: https://github.com/civic-interconnect
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b26c82e9852e46775592295cf09ded91db20ab84 -
Trigger Event:
push
-
Statement type: