plantsimpath documentation

Add your content using reStructuredText syntax. See the reStructuredText documentation for details.

class plantsimpath.path.PlantsimPath(*entries)

Bases: object

PlantSim path object for handling and concatenating hierarchical object paths.

Parameters:

entries (Union[str, PlantsimPath]) – Entries to be concatenated into a path.

Variables:

_path (str) – Internal string representation of the path.

append(entry)

Append a path entry to the current path.

Parameters:

entry (str) – Path entry to append.

Return type:

None

classmethod from_path(path)

Create a PlantsimPath from a pathlib.Path or string.

Parameters:

path (Union[Path, str]) – Path object or string.

Return type:

PlantsimPath

Returns:

PlantsimPath instance.

is_child_of(other)

Check if self is a child of other.

Parameters:

other (PlantsimPath) – Parent path.

Return type:

bool

Returns:

True if self is a child of other.

is_empty()

Check if the path is empty.

Return type:

bool

Returns:

True if path is empty, else False.

parent()

Get the parent path.

Return type:

PlantsimPath

Returns:

Parent PlantsimPath.

parts()

Split the path into its segments.

Return type:

List[str]

Returns:

List of path parts.

to_folder_path()

Convert the PlantsimPath to a pathlib Path object referring to the meta data of a folder / frame.

Return type:

Path

Returns:

pathlib.Path object.

to_object_path()

Convert the PlantsimPath to a pathlib Path object referring to the meta data of an object.

Return type:

Path

Returns:

pathlib.Path object.

to_path()

Convert the PlantsimPath to a pathlib Path object.

Return type:

Path

Returns:

pathlib.Path object.

to_str()

Return the path as a string.

Returns:

Path as string.

Return type:

str