Skip to main content

Python library for developing and running workflows locally or on the OneCompute cloud platform

Project description

OneWorkflow

OneWorkflow is a Python library for creating and executing workflows on local machine or on the OneCompute cloud platform. This library simplifies the development and management of workflows, providing an easy-to-use interface for handling complex tasks efficiently.

Its rich features empower developers to build workflows that effortlessly handle complex tasks. Whether running workflows on a local machine or utilizing the power of the cloud, OneWorkflow ensures consistent and reliable execution.

This library allows developers to tap into its extensive range of capabilities, including advanced job management, data integration, error handling, and scalability. OneWorkflow simplifies the implementation of intricate workflows, allowing developers to focus on their core objectives while ensuring a smooth end-to-end user experience.

Usage/Examples

import asyncio

from dnv.onecompute.flowmodel import WorkUnit
from dnv.oneworkflow.composite_executable_command import (
    CompositeExecutableCommand as SequentialCmd,
)
from dnv.oneworkflow.oneworkflowclient import OneWorkflowClient
from dnv.oneworkflow.python_command import PythonCommand

# Create OneWorkflow Client
client = OneWorkflowClient(
    workspace_id="TestWorkflow",
    workspace_path=r"C:\MyWorkspace",
    application_id="ImproveWorkflowWorkerHost",
    executable_name="ImproveFlowWorker",
)

# Authenticate with Veracity
client.login()

# Upload Input Files
client.upload_files()

# Create Commands
pre_process_py_cmd = PythonCommand(filename="preprocessscript.py")
post_process_py_cmd = PythonCommand(filename="postprocessscript.py")
sequential_cmd = SequentialCmd(
    [pre_process_py_cmd, post_process_py_cmd], r"C:\LoadCase"
)

# Create Work Unit
work_unit = (
    WorkUnit(sequential_cmd)
    .input_directory(r"C:\LoadCase")
    .output_directory(r"C:\Results")
)

# Run Workflow
job_id = asyncio.run(client.run_workflow_async(work_unit))
assert job_id is not None, "Job Id is done"

# Download Results & Logs
client.download_job_logs(job_id)
asyncio.run(client.download_result_files_async(job_id))

License

MIT

Support

If you encounter any issues, have questions, or want to provide feedback, please get in touch with our support team at software.support@dnv.com. We are committed to continuously improving OneWorkflow and providing timely assistance to our users.

Project details


Download files

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

Source Distribution

dnv_oneworkflow-1.0.2.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

dnv_oneworkflow-1.0.2-py3-none-any.whl (72.3 kB view details)

Uploaded Python 3

File details

Details for the file dnv_oneworkflow-1.0.2.tar.gz.

File metadata

  • Download URL: dnv_oneworkflow-1.0.2.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.13

File hashes

Hashes for dnv_oneworkflow-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fb47e4b5484b42b5dbc749cb0f3b31d34fc0b8e9dcd1b7e012bc6418c8c5e4a1
MD5 9e47d3c7b4221df47c3fda1cdb64ccdb
BLAKE2b-256 1c8a384d55ba8f7d398d90a115916909ce876d9e0d885d4f1c067765eecd9239

See more details on using hashes here.

File details

Details for the file dnv_oneworkflow-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dnv_oneworkflow-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfc7164a7631758960a47fe9bd09bbe56462c1c2e91f47f5ab8bd1dc9e7a71a8
MD5 1170aa469bd50b41c199631ff97fca9e
BLAKE2b-256 0e3b379577895f21b439ec765791ba89b356fab428139d833706fdf9174a86d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page