Python implementation of the OCSF (Open Cybersecurity Schema Framework) models. Provides Pydantic v2-based data models representing OCSF schema objects (e.g., DetectionFinding, ComplianceFinding). Current version 0.9.0, supports Python 3.10–3.14, maintained by Prowler Cloud.
pip install py-ocsf-modelsVerified import paths — ran on the pinned version, not inferred.
Create a simple DetectionFinding instance and serialize to JSON.
Upgrade to >=0.8.0 and use model_validate (v2 style) instead of parse_raw (v1).
Use Python >=3.10.
Remove product_uid from any model instantiation.
Use: from py_ocsf_models.events.findings.detection_finding import DetectionFinding
Ensure you pass type_uid, time, metadata, severity, confidence (or adjust to match required fields). Check the model's schema.