py-ocsf-models
This is a Python implementation of the OCSF models. The models are used to represent the data of the OCSF Schema defined in https://schema.ocsf.io/.
What it is and what it does
py-ocsf-models is a Python library that implements the Open Cybersecurity Schema Framework (OCSF) as a set of Pydantic-based data models. It lets you work with structured cybersecurity data—events, findings, and objects—in a standardized format that can be serialized to and from JSON. The package is built to support tools like Prowler in generating OCSF-compliant security findings that can be shared across different security platforms and tools.
The library depends on Pydantic for model validation and email-validator for email field handling. It covers Detection Findings, Compliance Findings, and Application Security Posture Findings as defined by the OCSF schema. You can create, modify, and serialize cybersecurity data structures while staying compliant with the OCSF specification, making it useful for security platforms, compliance reporting, and interoperability between tools.
Use it for:
- Generate standardized OCSF-formatted security findings from custom security tools or scanners
- Consume and validate OCSF detection or compliance findings from external security platforms
- Build compliance reporting pipelines that output findings in OCSF format for regulatory or audit purposes
- Integrate security data from multiple sources into a unified OCSF-compliant data model
- Serialize and store cybersecurity events in a standardized, widely-accepted schema for long-term analysis
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python models for the Open Cybersecurity Schema Framework (OCSF), enabling structured representation and manipulation of cybersecurity events, findings, and objects.
Yes. The package is actively maintained, has low install friction, carries a permissive license, and fills a specific need for OCSF schema compliance in Python. It has no known vulnerabilities and is already in use by established security tools. Install it if you need to work with OCSF-formatted cybersecurity data or integrate with platforms that expect OCSF compliance.
Install
py-ocsf-models on PyPI
pip
pip install py-ocsf-modelsuv
uv add py-ocsf-modelspoetry
poetry add py-ocsf-modelsInstalling py-ocsf-models
Before you install
Low friction: pure Python wheel with only two runtime dependencies (pydantic and email-validator). Last release 32 days ago; repository is active with recent commits and no archived status.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes, but derivative works are permitted.
Quickstart
pip install py-ocsf-models
import py_ocsf_models
# Create and work with OCSF model instances for detection findings, compliance findings, or application security posture findings
Requires Python 3.10 or later (supports up to but not including 3.15)
Verify before relying
- Whether the package's OCSF coverage extends beyond the three finding types explicitly listed (Detection, Compliance, Application Security Posture)
- Performance characteristics when handling large volumes of cybersecurity events or findings
- Whether custom model extensions remain compatible with OCSF schema validation across updates
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — email-validator, pydantic |
| Maintenance | actively maintained — 32 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 137,951/month — #11,349 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_ocsf_models-0.10.0-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
ocsf-libProvides Python tools to compile, validate,…
permissive · top 15,000 on PyPI
mixboxMixbox provides shared utility code for…
permissive · top 15,000 on PyPI
cloudsec-auditAudits AWS cloud security posture by checking…
permissive · top 15,000 on PyPI
pydantic-scimProvides Pydantic data models for SCIM (System…
unclear · top 15,000 on PyPI
cisco-ai-mcp-scannerScans MCP (Model Context Protocol) servers and…
unclear · top 15,000 on PyPI
google-cloud-securitycenterPython client library for Google Cloud Security…
permissive · top 15,000 on PyPI
pqcryptoProvides Python bindings to post-quantum…
permissive · top 15,000 on PyPI
socketsecuritySocket Security CLI scans Python projects for…
permissive · top 15,000 on PyPI
domaintools-apiProvides a Python interface to DomainTools…
permissive · top 15,000 on PyPI
kingfisher-binKingfisher is a command-line secret scanner…
permissive · top 15,000 on PyPI