Registry / workflow / acryl-executor

acryl-executor

JSON →
library0.3.10pypypiunverified

Acryl Executor is a Python library used internally by Acryl Agents and the DataHub ecosystem to define and execute modular tasks. It provides core abstractions like `BaseTask` and `Executor` for building extensible task-based workflows. As a sub-package of the larger DataHub project, its releases are often coupled with DataHub's evolution, though its own versioning is independent. The current version is 0.3.10, and it follows an active release cadence driven by DataHub development.

workflowdata
pip install acryl-executor
Install & Compatibility
Where this runs
tested against v0.3.15 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 201.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 21.9s · import 0.000s · 201MB
208MB installed
● package 208MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BaseTask
from acryl.executor import BaseTask
from acryl import BaseTask
Executor
from acryl.executor import Executor
from acryl import Executor

This quickstart demonstrates how to define a custom task by inheriting from `BaseTask`, implement its `execute` method, and then run it using the `Executor`. It shows how to pass configuration to the task and retrieve results. The example also illustrates how to safely access environment variables for sensitive data.

import os from typing import Dict, Any, NamedTuple from abc import ABC, abstractmethod from acryl.executor.sdk.tasks.base_task import BaseTask, TaskResult from acryl.executor.sdk.executor import Executor class MySimpleTaskResult(NamedTuple): status: str message: str class MySimpleTask(BaseTask): def execute(self, config: Dict[str, Any]) -> MySimpleTaskResult: name = config.get('name', 'World') # Example of using an environment variable for configuration (e.g., for API keys) secret_key = os.environ.get('MY_SECRET_KEY', 'default_secret') print(f"Executing MySimpleTask for {name} with secret: {secret_key[:4]}...") return MySimpleTaskResult(status='SUCCESS', message=f'Hello, {name}!') # Configure with actual environment variable or a placeholder for quick run os.environ['MY_SECRET_KEY'] = os.environ.get('MY_SECRET_KEY', 'some_default_value_for_testing') # 1. Instantiate the Executor executor = Executor() # 2. Define a task instance my_task = MySimpleTask() # 3. Define task configuration task_config = {"name": "DataHub User"} # 4. Execute the task print("\n--- Executing MySimpleTask ---") result = executor.execute_task(my_task, task_config) print(f"Task Result: {result.status}, Message: {result.message}") # Example with different config task_config_2 = {"name": "Acryl Team"} print("\n--- Executing MySimpleTask with different config ---") result_2 = executor.execute_task(my_task, task_config_2) print(f"Task Result: {result_2.status}, Message: {result_2.message}")
Debug
Known issues
gotchaAcryl Executor is primarily an internal library for the DataHub ecosystem. While available on PyPI, its public API (especially pre-1.0 versions like 0.x.x) may evolve rapidly with breaking changes that are not always explicitly documented for `acryl-executor` itself, but rather as part of broader DataHub releases.
fix
Always pin to exact versions (e.g., `acryl-executor==0.3.10`) and review DataHub's main release notes for related changes when upgrading. Be prepared to adapt custom task implementations.
affects: <1.0.0
breakingGiven `acryl-executor` is in its 0.x.x series, changes to `BaseTask` method signatures or `TaskResult` structure might occur in minor versions (e.g., `0.3.10` to `0.4.0`) without adhering to strict semantic versioning. This means a minor version bump could introduce breaking changes.
fix
Thoroughly test custom tasks against new `acryl-executor` versions before deploying. Consult the DataHub GitHub repository commit history for `acryl-executor` changes if experiencing unexpected behavior after an upgrade.
affects: <1.0.0
gotchaThe `Executor` provides synchronous task execution by default. For long-running or asynchronous tasks, `acryl-executor` is typically integrated with an external orchestration layer (e.g., DataHub Actions framework), which handles queuing, scheduling, and concurrency. Running `executor.execute_task()` directly will block the calling thread.
fix
For production scenarios requiring async or background execution, integrate `acryl-executor` within a suitable task runner like `datahub-actions` or a custom worker pool. Do not assume `Executor` handles concurrency internally.
affects: All
Upgrade
Version history
0.3.15latest on PyPI
Audit
Dependencies
pydanticrequiredUsed for data validation and settings management within tasks.
Agent activity
96 hits · last 30 days
node
18
claudebot
4
petalbot
3
ahrefsbot
3
amazonbot
1
Resources