Since release 9 we provide easy access to ORE via a pre-compiled Python module, updated with each release. The Python module provides the same functionality as the ORE command line executable and more.
Some example scripts using this ORE module are provided in this ORE-Python directory.
Prerequisite: Python3
You may have built ORE including the ORE Python module. In that case ensure that your PYTHONPATH contains the build artifacts (ORE.py and _OREP.so), e.g. with "export PYTHONPATH=$HOME/ore/build/ORE-SWIG".
Otherwise install the pre-built Python module as follows:
Create a virtual environment: python -m venv env1
Activate the virtual environment
- on Windows:
.\env1\Scripts\activate.bat - on macOS or Linux:
source env1/bin/activate
Then insall ORE: pip install open-source-risk-engine
Try the Python examples
- Re-run the Swap exposure of the first Exposure example:
python ore.py - Show how to access and post-process ORE in-memory results without reading files:
python ore2.py - Demonstrate lower-level access to the QuantLib and QuantExt libraries:
python commodityforward.py - Then try any of the Jupyter notebooks, in directories ORE-Python/Notebooks/Example_*;
install juypter:
python -m pip install jupyterlabstart juypter:python -m jupyterlab &and open any of the notebooks