skillfed

ocsf-lib

Tools for working with the OCSF schema

ocsf-lib v0.10.4 554.1K downloads/30d#6,038 on PyPI
Permissive license Apache-2.0 AGING released

What it is and what it does

ocsf-lib is a Python toolkit for working with the Open Cybersecurity Schema Framework. It provides both CLI commands and programmatic APIs to compile OCSF schemas from repository sources, validate them for backwards compatibility, compare different schema versions to detect breaking changes, and fetch schemas from the official OCSF API. The library is built around several discrete packages: ocsf.schema for data model representation, ocsf.repository for working with schema repositories on disk, ocsf.compile for schema compilation, ocsf.compare for detecting schema differences, and ocsf.validate.compatibility for breaking-change detection.

The package targets Python 3.11 and depends on dacite for dataclass deserialization, semver for version handling, and termcolor for CLI output formatting. It is designed as a namespace package so other OCSF-related tools can coexist in the same namespace. The library grew out of internal tooling and aims to make OCSF more hackable by providing reference implementations and composable utilities for the OCSF community.

Use it for:

  • Validate OCSF schema pull requests for breaking changes before merging.
  • Programmatically detect and report schema differences between two OCSF versions.
  • Compile an OCSF schema repository into a single JSON file for deployment.
  • Build adapters between different OCSF schema versions or flavors.
  • Fetch and cache OCSF schemas from the official API for local use.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python tools to compile, validate, compare, and work with OCSF (Open Cybersecurity Schema Framework) schemas, including CLI commands and programmatic APIs for schema manipulation.

Yes, if you work with OCSF schemas and need validation, comparison, or compilation tooling. The low install friction and permissive license make it accessible. However, the aging maintenance status warrants caution for production deployments—verify that the package still meets your schema version requirements and that the public API integration tests remain reliable.

Install

ocsf-lib on PyPI

pip

pip install ocsf-lib

uv

uv add ocsf-lib

poetry

poetry add ocsf-lib

Installing ocsf-lib

Before you install

Low install friction with three lightweight runtime dependencies. Maintenance status is aging, so expect slower response to issues, though no recent vulnerabilities are recorded.

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 note any modifications.

Quickstart

pip install ocsf-lib

from ocsf.util import get_schema
schema = get_schema("1.1.0")

# Or use CLI:
# python -m ocsf.compile path/to/ocsf-schema
# python -m ocsf.compare 1.0.0 1.1.0

Requires Python 3.11 or later. Integration tests depend on network access to https://schema.ocsf.io.

Verify before relying

  • Whether the aging maintenance status reflects active stability or abandonment risk for production use.
  • Whether the public OCSF server integration tests still pass reliably against https://schema.ocsf.io.
  • Current reliability of the package against OCSF schema versions in active use.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<4.0,>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 3 — dacite, semver, termcolor
Maintenance aging — 403 days since the last release
First released
Downloads 554,097/month — #6,038 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ocsf_lib-0.10.4-py3-none-any.whl

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

Tags

OCSF schema compilercybersecurity schema validationOCSF schema comparisonschema backwards compatibilityOCSF schema tools
schema-validationocsfcli-tool

More Software Development packages