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
🙌 Export Workflows as YAML files
[New!] Export your workflows into YAML files as well. Simply pass in the workflow object from a GetWorkflow response. See export_example.py for how to do that.
from yaml2workflow.exporter.workflow import Exporter
with Exporter(response.workflow) as e:
e.parse()
e.export("export_example.yml")
🚀 Installation
Simply enter
pip install yaml2workflow
💪 Usage
- Create a YAML file to define your workflow. Gather the model IDs and model version IDs from Clarifai. See parse_example.yml for a full, filled in template.
- Import the library and use it directly in your code as follows:
from yaml2workflow.parser.workflow import parse
workflows = parse('parse_example.yml', stub=stub, metadata=metadata)
post_workflows_response = stub.PostWorkflows(
service_pb2.PostWorkflowsRequest(
workflows=workflows
),
metadata=metadata
)
See parse_example.py for the full example.
🎉 Done! You've now unlocked more human-readble and more maintable workflows.
Metadata
Release files for yaml2workflow 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yaml2workflow-0.2.4.tar.gz | 9.3 kB | Without provenance | Details for yaml2workflow-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yaml2workflow-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for yaml2workflow-0.2.4-py3-none-any.whl |
Total release size: 19.6 kB
Release files / yaml2workflow-0.2.4.tar.gz
| Download URL | yaml2workflow-0.2.4.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5686627a897c0e8cb460ce2810bb2a27bc287eda2bffaad1077fe6fa2236937
|
|
BLAKE2b-256 checksum How to use checksums |
f47af0cad4f139ec407ce768eff3a7d370d7cef06a5a60ea417d6d7893e04c15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / yaml2workflow-0.2.4-py3-none-any.whl
| Download URL | yaml2workflow-0.2.4-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01131c34e6ef43d696d055b4b8e9f812d1e2a4db481155b919c0fe0d302fa5a5
|
|
BLAKE2b-256 checksum How to use checksums |
541fee7e3b971b2a12382aa1d39a2ff1ccb92db1af9b58a2f5773cf32d394133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for yaml2workflow 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.