Pydantic models for the Open Cybersecurity Schema Framework (OCSF)
Project description
pydantic-ocsf
Pydantic models for the Open Cybersecurity Schema Framework (OCSF).
Installation
pip install pydantic-ocsf
Version Scheme
This package uses a version format of {ocsf_version}.{generation_date}:
- OCSF Version: The latest OCSF schema version included (e.g.,
1.7.0) - Generation Date: When the models were generated (format:
YYYYMMDD)
Example: 1.7.0.20260129 means OCSF schema v1.7.0 generated on January 29, 2026
This versioning scheme ensures you can track both the OCSF schema version and when the Pydantic models were last regenerated.
Quick Start
from ocsf import File, StatusId
import time
# Create a file object (using latest v1.7.0 by default)
file = File(
name="document.pdf",
type_id=1,
size=1024000,
)
# Serialize to JSON
json_str = file.model_dump_json(indent=2)
print(json_str)
# Parse from JSON
parsed = File.model_validate_json(json_str)
Supported OCSF Versions
ocsf.v1_7_0- OCSF 1.7.0 (also available asfrom ocsf import ...)ocsf.v1_6_0- OCSF 1.6.0ocsf.v1_5_0- OCSF 1.5.0ocsf.v1_2_0- OCSF 1.2.0ocsf.v1_1_0- OCSF 1.1.0ocsf.v1_0_0- OCSF 1.0.0
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_ocsf-1.7.0.20260129.post1.tar.gz.
File metadata
- Download URL: pydantic_ocsf-1.7.0.20260129.post1.tar.gz
- Upload date:
- Size: 612.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b61308743e889306de167ab7782839e6f0f3d5c967e96d2c93b8a59341b5b8e
|
|
| MD5 |
900cb88c5ad65c0579b885a79d4f9aff
|
|
| BLAKE2b-256 |
abf73f4f47f5d7072d3bd4141278558570369bfbe95ac1aad7fb4db1fa159eef
|
File details
Details for the file pydantic_ocsf-1.7.0.20260129.post1-py3-none-any.whl.
File metadata
- Download URL: pydantic_ocsf-1.7.0.20260129.post1-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d468b7ba2c31305aa9ffbcba4732cc15c1ec02073842118b2450b891622c8bc6
|
|
| MD5 |
036d090b1507f1d2e316b192ce86db7e
|
|
| BLAKE2b-256 |
d2f9e6d74a0463437b0946bdc7151fecc53bb69d9d9b98a008e9bc5397f91f8e
|