Metadata-Version: 2.4
Name: crml-engine
Version: 1.2.0
Summary: CRML reference engine (simulation/runtime)
Author: Zeron Research Labs
License: MIT License
        
        Copyright (c) 2025 Zeron Research Labs
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Faux16/crml
Project-URL: Repository, https://github.com/Faux16/crml
Project-URL: Documentation, https://faux16.github.io/crml/
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: crml-lang>=1.2.0
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pydantic
Requires-Dist: pyyaml
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# crml-engine

Reference runtime/simulation engine for CRML.

Depends on `crml-lang` for the CRML models and validation.

## Install

```bash
pip install crml-engine
```

## CLI

Validate a scenario/portfolio document:

```bash
crml-lang validate examples/scenarios/data-breach-simple.yaml
crml-lang validate examples/portfolios/portfolio.yaml
```

Run a simulation:

```bash
crml simulate examples/scenarios/data-breach-simple.yaml --runs 10000
crml simulate examples/portfolios/portfolio.yaml --runs 10000
crml simulate examples/portfolio_bundles/portfolio-bundle-documented.yaml --runs 10000
```

Notes:

- The `crml simulate` command auto-detects scenario vs portfolio vs portfolio-bundle inputs.
- Portfolio simulation uses `crml_lang.plan_portfolio` and applies portfolio semantics.

## Python

```python
from crml_engine.runtime import run_simulation

result = run_simulation("examples/scenarios/data-breach-simple.yaml", n_runs=10000)
print(result.metrics.eal)
```
