Python SDK: DeleteEngine
The DeleteEngine deletes an ALP object from a workspace file.
Installation
bash
pip install autonomous-lifecycle-protocol-alpQuick Start
python
from alp_sdk import DeleteEngine
engine = DeleteEngine()
result = engine.delete("./my-project", "task-1")
print(f"Deleted: {result.deleted}")
print(f"File: {result.file}")API Reference
DeleteEngine
delete(workspace_path, object_id, file=None) -> DeleteResult
Deletes an ALP object by id from a workspace file.
workspace_path: Path to workspace containing.alpdirectoryobject_id: The object id to deletefile: Optional specific file path to delete from. If omitted, searches all.alpfiles
DeleteResult
object_id: The deleted object's idfile: The file where the object was deleteddeleted:Trueif the object was successfully deleted
Examples
Delete by ID
python
from alp_sdk import DeleteEngine
engine = DeleteEngine()
result = engine.delete("./my-project", "old-task")
print(f"Deleted: {result.deleted}")Delete from Specific File
python
from alp_sdk import DeleteEngine
engine = DeleteEngine()
result = engine.delete("./my-project", "task-1", file=".alp/tasks.alp")
print(f"Deleted from {result.file}")Handle Missing Object
python
from alp_sdk import DeleteEngine
engine = DeleteEngine()
try:
result = engine.delete("./my-project", "missing")
except FileNotFoundError as e:
print(f"Not found: {e}")