ocsf-lib
Tools for working with the OCSF schema
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-libuv
uv add ocsf-libpoetry
poetry add ocsf-libInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
py-ocsf-modelsProvides Python models for the Open…
permissive · top 15,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI
warchant_dc_schemaGenerates JSON Schema (2020-12 draft) from…
permissive · top 15,000 on PyPI
sqlalchemy-diffCompares database schemas across two…
permissive · top 15,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
check-jsonschemaA command-line tool and pre-commit hook that…
permissive · top 5,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI
flexValidates Swagger 2.0 API specifications…
permissive · top 15,000 on PyPI
yamaleYamale validates YAML files against a schema…
permissive · top 5,000 on PyPI
py-solc-xManages installation and version control of the…
permissive · top 15,000 on PyPI