Metadata-Version: 2.4
Name: pydantic-ocsf
Version: 1.7.0.20260129.post1
Summary: Pydantic models for the Open Cybersecurity Schema Framework (OCSF)
Project-URL: Homepage, https://github.com/mcm/pydantic-ocsf
Project-URL: Documentation, https://github.com/mcm/pydantic-ocsf#readme
Project-URL: Repository, https://github.com/mcm/pydantic-ocsf
Author-email: Your Name <you@example.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: cybersecurity,ocsf,pydantic,schema,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: eval-type-backport>=0.2.0; python_version < '3.10'
Requires-Dist: pydantic<3.0,>=2.5
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Provides-Extra: generator
Requires-Dist: httpx>=0.25; extra == 'generator'
Requires-Dist: jinja2>=3.0; extra == 'generator'
Description-Content-Type: text/markdown

# pydantic-ocsf

Pydantic models for the Open Cybersecurity Schema Framework (OCSF).

## Installation

```bash
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

```python
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
