Skip to main content

object_from_path

GitHub source

object_from_path

evo.objects.typed.base.object_from_path

object_from_path(context: IContext, path: str, version: str | None = None) -> _BaseObject

Download a GeoscienceObject by its path and create the appropriate typed instance.

This function downloads the object using its path (the hierarchical location/name in the workspace) and automatically selects the correct typed class (e.g., PointSet, Regular3DGrid) based on the object's sub-classification.

Parameters:

NameTypeDescriptionDefault
contextIContextThe context for connecting to Evo APIs.required
pathstrThe object path (e.g., "my-folder/my-object.json" or "/my-folder/my-object.json").required
versionstr | NoneOptional version ID string to download a specific version.None

Returns:

TypeDescription
_BaseObjectA typed GeoscienceObject instance (PointSet, Regular3DGrid, etc.).

Raises:

TypeDescription
ValueErrorIf no typed class is found for the object's sub-classification. Example:: from evo.objects.typed import object_from_path # Download latest version by path obj = await object_from_path(context, "my-folder/pointset.json") # Download specific version obj = await object_from_path(context, "my-folder/pointset.json", version="abc123")

What is the reason for your feedback?