Skip to main content

Manage and create Clarifai workflows with yaml files

Project description

yaml2workflow

Clarifai workflows are powerful tools. Building them via the API is a sure way to automate this process, especially if you have many nodes and branches.

Taking inspiration from Kubernetes Helm Charts and AWS Cloud Formation templates, yaml2workflow is designed to make automating the creation and managing the definition of workflows easier and more transparent.

🙌 Define Workflows as YAML files

Much clearer and more human-readable definitions without distractors. Also, by storing the workflow definitions as a file, you can now use version control for your future automations! Winning.

# A single node workflow
workflow:
  id: test-wf-1
  nodes:
    - id: detector
      model:
          model_id: face-detection
          model_version_id: 45fb9a671625463fa646c3523a3087d5

🚀 Installation

Simply enter

pip install yaml2workflow

💪 Usage

  1. Create a YAML file to define your workflow. Gather the model IDs and model version IDs from Clarifai. See example.yml for a full, filled in template.
  2. Import the library and use it directly in your code as follows:
from yaml2workflow.parser import parse

workflows = parse('example.yml')

post_workflows_response = stub.PostWorkflows(
    service_pb2.PostWorkflowsRequest(
        workflows=workflows
    ),
    metadata=metadata
)

See example.py for the full example.

🎉 Done! You've now unlocked more human-readble and more maintable workflows.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

yaml2workflow-0.2.1-py2.py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 2 Python 3

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