Mondaic
This API reference is not for the latest stable Salvus version.

salvus.project.components.entity_component

Classes

EntityComponent

class EntityComponent(builtins.object):
    def __init__(
        self, project: salvus.project.project.Project, path: pathlib.Path
    ):
        ...

Project subclass handling all things related to various configuration components which we’ll call entities.

Parameters
  • project salvus.project.project.Project — The project.
  • path pathlib.Path — The path where the entities are stored within the project.
Methods
add()
def add(self, entity: Any, overwrite: bool = False) -> None:
    ...

Add an entity to the project.

Parameters
  • entity Any — The entity to add.
  • overwrite bool — Potentially overwrite an existing thing in project if it already exists.
Returns None
delete()
def delete(self, entity_type: str, entity_name: str) -> None:
    ...

Remove an entity from the project.

Parameters
  • entity_type str — The type of entity to delete.
  • entity_name str — The name of the entity.
Returns None
get()
def get(self, entity_type: str, entity_name: str) -> Any:
    ...

Get an entity.

Parameters
  • entity_type str — The type of entity to get.
  • entity_name str — The name of the entity.
Returns Any
get_all()
def get_all(self, entity_type: str) -> Dict[str, Any]:
    ...

Get all entities of a given type.

Parameters
  • entity_type str — The type of entities to get.
Returns Dict[str, Any]
has()
def has(self, entity_type: str, entity_name: str) -> bool:
    ...

A check if an entity of a given type or name exists.

Parameters
  • entity_type str — The type of entity to get.
  • entity_name str — The name of the entity.
Returns bool
list()
def list(self, entity_type: str) -> List[str]:
    ...

List all available entities of the chosen type.

Parameters
  • entity_type str — The type of the entities to list.
Returns List[str]