Skip to main content

Immutable datatype library for Common Weakness Enumeration (CWE) analysis and validation workflows

Project description

Civic Transparency CWE Types

Docs PyPI Python 3.12+ CI Status License: MIT security: 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

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

civic_transparency_cwe_types-0.0.12.tar.gz (781.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

civic_transparency_cwe_types-0.0.12-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file civic_transparency_cwe_types-0.0.12.tar.gz.

File metadata

File hashes

Hashes for civic_transparency_cwe_types-0.0.12.tar.gz
Algorithm Hash digest
SHA256 53fc6eac7d8038ebb08c5ef713218f79a81f18c9dcf30d10e6a28077cb07ebd9
MD5 dc7023a22120382ace6d8e8ee11591e2
BLAKE2b-256 82d3654835dadcc8834deb35b654bd215f9d9e781edf9a29f07545a8ea254627

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file civic_transparency_cwe_types-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for civic_transparency_cwe_types-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 2e1945ca3335c8c6926bbf32b43042e7a9409f5feae7cdd774c9542658003d18
MD5 520b5e891ae966c83fea81665740ac30
BLAKE2b-256 22c923496433cb25a5771fedf10e5f8147f21401adb23e6ad286e104c7a517e7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page