Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ewokscore

Pipeline Code style: black License Coverage Docs PyPI

ewokscore provides an API to define workflows and implement tasks in ewoks.

Install

pip install ewokscore[test]

Test

pytest --pyargs ewokscore.tests

Getting started

from ewokscore.task import Task
from ewokscore import execute_graph


# Implement a workflow task
class SumTask(
    Task, input_names=["a"], optional_input_names=["b"], output_names=["result"]
):
    def run(self):
        result = self.inputs.a
        if self.inputs.b:
            result += self.inputs.b
        self.outputs.result = result


# Define a workflow with default inputs
graph = {"id": "testworkflow", "schema_version": "1.1"}
nodes = [
    {
        "id": "task1",
        "task_type": "class",
        "task_identifier": "__main__.SumTask",
        "default_inputs": [{"name": "a", "value": 1}],
    },
    {
        "id": "task2",
        "task_type": "class",
        "task_identifier": "__main__.SumTask",
        "default_inputs": [{"name": "b", "value": 1}],
    },
    {
        "id": "task3",
        "task_type": "class",
        "task_identifier": "__main__.SumTask",
        "default_inputs": [{"name": "b", "value": 1}],
    },
]
links = [
    {
        "source": "task1",
        "target": "task2",
        "data_mapping": [{"source_output": "result", "target_input": "a"}],
    },
    {
        "source": "task2",
        "target": "task3",
        "data_mapping": [{"source_output": "result", "target_input": "a"}],
    },
]
workflow = {"graph": graph, "nodes": nodes, "links": links}

# Define task inputs
inputs = [{"id": "task1", "name": "a", "value": 10}]

# Execute a workflow (use a proper Ewoks task scheduler in production)
varinfo = {"root_uri": "/tmp/myresults"}  # optionally save all task outputs
result = execute_graph(workflow, varinfo=varinfo, inputs=inputs)
print(result)

Documentation

https://ewokscore.readthedocs.io/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ewokscore-5.1.0rc2.tar.gz (103.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ewokscore-5.1.0rc2-py3-none-any.whl (146.8 kB view details)

Uploaded Python 3

File details

Details for the file ewokscore-5.1.0rc2.tar.gz.

File metadata

  • Download URL: ewokscore-5.1.0rc2.tar.gz
  • Upload date:
  • Size: 103.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ewokscore-5.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 dbf89c0cd54f59a8036d927a8acb6b70dfc3e422eedb3552c04e5f83ff74856b
MD5 a056bb154a53509f11d15d7341fc7999
BLAKE2b-256 a1deb8b43a94e001ffd32b3f6a9c330334947f62a981040a5d77a945c3671db1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ewokscore-5.1.0rc2.tar.gz:

Publisher: release.yml on ewoks-kit/ewokscore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ewokscore-5.1.0rc2-py3-none-any.whl.

File metadata

  • Download URL: ewokscore-5.1.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 146.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ewokscore-5.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b285bd9614f9f712705eb8946fc68d0cc30b21daa06c40cf6bafc857ec002ed
MD5 450abe520d0f695ea499604620191ec7
BLAKE2b-256 8fa1e82dc4d719ae3508f29889444dc45fabca2fee40e32c690c6da221818a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ewokscore-5.1.0rc2-py3-none-any.whl:

Publisher: release.yml on ewoks-kit/ewokscore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page