| |
- builtins.object
-
- ContentPackage
class ContentPackage(builtins.object) |
|
ContentPackage(name: str, workflows: Optional[Dict[str, Any]], workflows_base_path: Union[str, pathlib.Path], examples: Union[str, pathlib.Path, NoneType] = None, license: Optional[str] = None, description: Optional[str] = None, version: Optional[str] = None)
The ContentPackage object defines a content packages
:param name: Name of the package
:type name: str
:param workflows: Dict of workflows see class:`ai_core_sdk.content.workflow.Workflow` for details
:type workflows: Union[Dict[str, Any], None]
:param workflows_base_path: Base path for all relative paths in the workflow definition
:type workflows_base_path: Union[str, pathlib.Path]
:param examples: Paths to a folder containing examples
:type examples: Union[str, pathlib.Path, None], optional
:param license: Name of the content package's license
:type license: Union[str, None], optional
:param description: Description text
:type description: Union[str, None], optional
:param version: Version str
:type version: Union[str, None], optional |
|
Methods defined here:
- __getitem__(self, name: str) -> ai_core_sdk.content.workflow.Workflow
- Get Workflow by its name.
:raises: class:`ai_core_sdk.content.workflow.WorkflowNotFound`
:return: Workflow
:rtype: class:`ai_core_sdk.content.workflow.Workflow`
- __init__(self, name: str, workflows: Optional[Dict[str, Any]], workflows_base_path: Union[str, pathlib.Path], examples: Union[str, pathlib.Path, NoneType] = None, license: Optional[str] = None, description: Optional[str] = None, version: Optional[str] = None)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self) -> str
- Return repr(self).
- __str__(self) -> str
- Return str(self).
- validate(self) -> None
- Run validationfor the content package definition and its workflows.
:raises: ValueError when validations fails
Class methods defined here:
- from_yaml(yaml_path: Union[pathlib.Path, str]) -> 'ContentPackage' from builtins.type
- Initialize a content package from a yaml file.
:param yaml_path: Path to the yaml file
:type yaml_path: Union[pathlib.Path, str]
:raises: class:`FileNotFoundError`, class:`ValueError`
:return: ContentPackage
:rtype: class:`ai_core_sdk.content.content_package.ContentPackage`
Static methods defined here:
- check_path(path: Union[pathlib.Path, str], validate_is_dir: bool = False, validate_is_file: bool = False) -> Optional[str]
- Funciton to check the existence of a path.
:param path: Path, which is transformed into an absolute path by the function prior to validation
:type path: Union[str, pathlib.Path]
:param validate_is_file: Bool specifying whether to check if the file is a folder
:type path: bool, optional
:param validate_is_dir: Bool specifying whether to check if the path is a folder
:type path: bool, optional
:return: str in case of a valid path and None in case of an invalid path
:rtype: Union[None, str]
Readonly properties defined here:
- workflows
- Return dict of workflows from the ContentPackage.
:return: Dict of workflows from the ContentPackage
:rtype: Dict[str, Workflow]
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |