skillfed

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/.

py-ocsf-models v0.10.0 138.0K downloads/30d#11,349 on PyPI38
Permissive license Apache-2.0 Active released

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-models

uv

uv add py-ocsf-models

poetry

poetry add py-ocsf-models

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3

Tags

ocsf schema python modelscybersecurity data standardizationocsf detection findingsstructured security event modelsocsf compliance findingssecurity data serializationcybersecurity schema framework
cybersecurity-schemaocsf-compliancesecurity-findings

More Security packages