Skip to main content

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 as from ocsf import ...)
  • ocsf.v1_6_0 - OCSF 1.6.0
  • ocsf.v1_5_0 - OCSF 1.5.0
  • ocsf.v1_2_0 - OCSF 1.2.0
  • ocsf.v1_1_0 - OCSF 1.1.0
  • ocsf.v1_0_0 - OCSF 1.0.0

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_ocsf-1.7.0.20260129.tar.gz (612.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_ocsf-1.7.0.20260129-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file pydantic_ocsf-1.7.0.20260129.tar.gz.

File metadata

  • Download URL: pydantic_ocsf-1.7.0.20260129.tar.gz
  • Upload date:
  • Size: 612.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydantic_ocsf-1.7.0.20260129.tar.gz
Algorithm Hash digest
SHA256 1129ad6b8c9f444dfda577a7b05ad6b56d9121a9bfc16cb2072d84678ca4773f
MD5 9e54a8b36d03b77f09ccda4ad686d2f4
BLAKE2b-256 da6004a103b54da5fdd8f2dabbcc23144f7df542683f2c7ccee87529e9ed1b92

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_ocsf-1.7.0.20260129.tar.gz:

Publisher: publish.yml on mcm/pydantic-ocsf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydantic_ocsf-1.7.0.20260129-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_ocsf-1.7.0.20260129-py3-none-any.whl
Algorithm Hash digest
SHA256 5461c1d3354229d2b8ecb04415c6cae10e6154b21742c80e698e117765b08af0
MD5 b2e46444e4a3c798e72c7e92d6fb91d2
BLAKE2b-256 24c508bdba8deb97633d50d83060756f72342f0d67b58ffa0882ee4f59092304

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydantic_ocsf-1.7.0.20260129-py3-none-any.whl:

Publisher: publish.yml on mcm/pydantic-ocsf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page