Metadata-Version: 2.4
Name: civic-transparency-cwe-types
Version: 0.0.12
Summary: Immutable datatype library for Common Weakness Enumeration (CWE) analysis and validation workflows
Author: Civic Interconnect
Project-URL: Bug Tracker, https://github.com/civic-interconnect/civic-transparency-py-cwe-types/issues
Project-URL: Documentation, https://civic-interconnect.github.io/civic-transparency-py-cwe-types/latest/
Project-URL: Homepage, https://github.com/civic-interconnect/civic-transparency-py-cwe-types
Project-URL: Repository, https://github.com/civic-interconnect/civic-transparency-py-cwe-types
Keywords: civic,transparency,cwe,security,vulnerability,dataclasses,types,validation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: bandit[toml]; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: deptry; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: validate-pyproject; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-gen-files; extra == "docs"
Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == "docs"
Requires-Dist: mkdocs-include-markdown-plugin; extra == "docs"
Requires-Dist: mkdocs-literate-nav; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-static-i18n; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.18; extra == "docs"
Requires-Dist: mike; extra == "docs"
Dynamic: license-file

# Civic Transparency CWE Types

[![Docs](https://img.shields.io/badge/docs-mkdocs--material-blue)](https://civic-interconnect.github.io/civic-transparency-py-cwe-types/)
[![PyPI](https://img.shields.io/pypi/v/civic-transparency-py-cwe-types.svg)](https://pypi.org/project/civic-transparency-py-cwe-types/)
[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue?logo=python)](#)
[![CI Status](https://github.com/civic-interconnect/civic-transparency-py-cwe-types/actions/workflows/ci.yml/badge.svg)](https://github.com/civic-interconnect/civic-transparency-py-cwe-types/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)

**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.typed` marker
- **Composable** - Small building blocks for complex workflows
- **Memory Efficient** - Frozen dataclasses for better performance

## Installation

```bash
pip install civic-transparency-py-cwe-types
```

**Requirements:** Python 3.12+

## Quick Start

```python
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](https://civic-interconnect.github.io/civic-transparency-py-cwe-types/usage/)** - Detailed examples and patterns
- **[API Reference](https://civic-interconnect.github.io/civic-transparency-py-cwe-types/api/)** - Complete module documentation
- **[Contributing](./CONTRIBUTING.md)** - Development guidelines

## Development

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

```bash
uv run pytest
uv run pyright src/
```

## Versioning

This specification follows semantic versioning.
See [CHANGELOG.md](./CHANGELOG.md) for version history.

## License

MIT © [Civic Interconnect](https://github.com/civic-interconnect)
