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.1.2.tar.gz (59.3 kB view details)

Uploaded Source

Built Distribution

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

dnv_oneworkflow-1.1.2-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dnv_oneworkflow-1.1.2.tar.gz
Algorithm Hash digest
SHA256 fc763bdf4ba17cb62b188b3750bbaf293bc0d970213f823fe893e8d6805c0dcb
MD5 5d0f3284ab01b08e64b76ce17b5a9ff8
BLAKE2b-256 29bf197b7e39fbc7fe4335255073b32fd2ed4b37718d9c5aa6fbcf1b9844fb08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dnv_oneworkflow-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b23c6564647227f132a506c0a7515b966a1f38c62a209cba142f31c663ca0b
MD5 41605a2984ce064ba3c67fb1cc45481d
BLAKE2b-256 1411c6584a3c7d03e129ab3d23eb7b0772c0987601991152db974cc2acf8aee8

See more details on using hashes here.

Supported by

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