LiCoRICE Python API
The licorice Python API wraps the same core functions used by the CLI and therefore offers the same functionality, but through Python function calls. This is useful for programmatically interfacing with LiCoRICE and testing variations on models.
- licorice.generate_model(model: str, **kwargs) None
- licorice.generate_model(model: dict, **kwargs) None
Generate user code scaffolds from model.
This function wraps the core functionality of the LiCoRICE CLI generate command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
- Returns
None
- licorice.parse_model(model: str, **kwargs) None
- licorice.parse_model(model: dict, **kwargs) None
Parse a given LiCoRICE model.
This function wraps the core functionality of the LiCoRICE CLI parse command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
- Returns
None
- licorice.compile_model(model: str, **kwargs) None
- licorice.compile_model(model: dict, **kwargs) None
Compile a given LiCoRICE model.
This function wraps the core functionality of the LiCoRICE CLI compile command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
- Returns
None
- licorice.run_model(model: str, **kwargs) None
- licorice.run_model(model: dict, **kwargs) None
Run the given compiled LiCoRICE model.
This function wraps the core functionality of the LiCoRICE CLI run command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
- Returns
None
- licorice.go(model: str, **kwargs) None
- licorice.go(model: dict, **kwargs) None
Peform LiCoRICE parse, compile, and run in succession.
This function wraps the core functionality of the LiCoRICE CLI go command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
Returns: None
- licorice.export_model(model: str, **kwargs) None
- licorice.export_model(model: dict, **kwargs) None
Export a LiCoRICE model.
This function wraps the core functionality of the LiCoRICE CLI export command, but allows users to pass in either a YAML model file string or a full dict detailing the model as well as any CLI flags as keyword arguments.
- Parameters
model (dict) – Filename of LiCoRICE model accessible through default or included paths. .yaml and .yml file extensions are optional.
model – LiCoRICE model as a dict. Must adhere to YAML config reference and can be loaded in from a YAML file or created manually.
- Keyword Arguments
kwargs (dict) – Extra LiCoRICE arguments.
- Returns
None