UiPath Core Abstractions
uipath-core is a foundational Python library providing core abstractions for the UiPath Python SDK. It encapsulates fundamental components like common exceptions, versioning, and registry mechanisms that underpin the broader UiPath automation and AI ecosystem. As of version 0.5.11, it serves as a dependency for higher-level UiPath libraries, offering essential building blocks for integration and development. Its release cadence is tied to the main UiPath Python SDK.
Warnings
- breaking The `platform` module, which previously provided core functionalities, was extracted into a separate `uipath-platform` library starting with `uipath-python` SDK v2.9.0. If your application or custom `uipath-core` extensions relied on direct imports from `uipath.platform`, these imports will now fail unless `uipath-platform` is explicitly installed and imports are updated.
- breaking Core 'context grounding' contracts underwent significant changes in `uipath-python` SDK v2.9.0. Specific fields like `PreProcessing` and `Fields` were removed, while `extraction_strategy`, `embeddings_enabled`, and `is_encrypted` were added. This impacts any code that interacts with or extends UiPath's context grounding mechanisms, potentially including custom components built using `uipath-core` abstractions.
- gotcha `uipath-core` provides low-level abstractions and foundational components. It is not intended for direct interaction with high-level UiPath SDK functionalities such as orchestrator communication, AI functions, or RPA process execution. Attempting to find or use such features directly from `uipath-core` will result in `AttributeError` or `ImportError`.
Install
-
pip install uipath-core
Imports
- UiPathError
from uipath.exceptions import UiPathError
from uipath.core.exceptions import UiPathError
Quickstart
from uipath.core.exceptions import UiPathError
class CustomUiPathComponent:
def __init__(self, name):
self.name = name
def execute(self, should_fail: bool):
if should_fail:
raise UiPathError(f"Component '{self.name}' failed to execute.")
return f"Component '{self.name}' executed successfully."
try:
component = CustomUiPathComponent("MyProcessor")
print(component.execute(False))
print(component.execute(True))
except UiPathError as e:
print(f"Caught expected UiPathError: {e}")