Skip to main content

vcti-ywf-template

Template discovery, repository, and run-state management for the vcti-ywf workflow engine.

Overview

vcti-ywf-template is the template-management layer on top of the vcti-ywf YAML workflow engine. The engine loads and executes one workflow directory; this package manages a directory of templates around it: listing them as a catalog, reading and changing the files inside a template, and recording the state of each run. A template is a directory holding a workflow under source/ and its per-run state under runs/; a repository is a directory of templates, optionally cloned from a Git remote.

Install it when you are building a host application — a REST service, a desktop GUI, an editor extension — that lets users browse, upload or run workflow templates. To execute a known workflow headless, vcti-ywf alone is enough.

Installation

pip install vcti-ywf-template

In requirements.txt

vcti-ywf-template>=3.0.1

In pyproject.toml dependencies

dependencies = [
    "vcti-ywf-template>=3.0.1",
]

Quick Start

A template is a directory with a root workflow node named by source/.entrypoint. Write the smallest valid one, then open the directory that holds it as a repository:

from pathlib import Path

from vcti.ywf.template import TemplatesRepository, get_template_catalog

node = Path("templates/modal-analysis/source/main")
node.mkdir(parents=True)
(node.parent / ".entrypoint").write_text("main", encoding="utf-8")
(node / "about.yaml").write_text("title: Modal Analysis\n", encoding="utf-8")

# Point at an existing directory of templates, or pass remote_repo_url=
# to clone one on first use.
repo = TemplatesRepository(Path("templates"))

catalog = get_template_catalog(repo)
for manifest in catalog.root:
    title = manifest.metadata.title if manifest.metadata else "(no metadata)"
    print(manifest.id, "—", title)

Open a single template to reach its workflow nodes, files and runs:

template = repo.get_template("modal-analysis")
print(template.workflow_nodes.root_node)        # main

# Files are addressed by POSIX-style IDs relative to the template root.
print(template.files.resolve_path("source/main/about.yaml", must_be_file=True))

The package records the state of a run; launching the runner is the host application's job:

from vcti.ywf.template import RunState, RunStatusManager

run_id = template.runs.create_run()
template.runs.set_active_run(run_id)

status = RunStatusManager(template.runs.get_run_path(run_id))
status.update(state=RunState.RUNNING, pid=12345)
status.update(state=RunState.COMPLETED, pid=None)   # None clears the PID

print(template.runs.get_run_status(run_id).state)   # completed

Uploads are binary streams and downloads are descriptions, so the package needs no web framework:

import io

template.files.upload("notes.txt", io.BytesIO(b"hello"))

download = template.download()                 # the template as a .vyf archive
print(download.filename)                       # modal-analysis.vyf
archive_bytes = b"".join(download.chunks)      # runs/ is left out by default

With FastAPI, install the fastapi extra (pip install vcti-ywf-template[fastapi]) and use the adapter module vcti.ywf.template.fastapi to convert UploadFile and responses to and from these types. docs/patterns.md shows the routes, along with validating uploads, safe replacement, run tracking, and the pitfalls worth knowing.


Key API

Name What it is
TemplatesRepository A directory of templates: list, get, create from an uploaded ZIP, and clone or pull from a Git remote.
TemplateCatalog, get_template_catalog The manifests of every valid template in a repository, serialized as a JSON array.
TemplateManifest, get_template_manifest A template's ID and the metadata of its root workflow node.
Template One template directory: files, workflow_nodes and runs, plus download, duplicate, rename and delete.
TemplateFiles File operations confined to the template root: resolve, tree, upload, download, rename, duplicate, delete.
WorkflowNodes, ValidationProblem Read access to the workflow nodes under source/: the root node, its metadata and declared variables, and validate() for a full check.
TemplateRuns The run directories under runs/ and the active-run pointer.
FileDownload, ArchiveDownload What the download methods return: a file's path, or the chunks of a ZIP, with the name to send it under.
vcti.ywf.template.fastapi Optional adapter: download_response, upload_file, create_template_from_upload.
RunState, RunStatus, RunStatusManager The state of a run and its persistence in status.json.

Dependencies

  • vcti-ywf 5 — the workflow engine (vcti.ywf.engine) whose workflow directories this package manages.
  • vcti-archive — ZIP extraction for uploads and streaming ZIP downloads.
  • vcti-git 2 (with the pygit2 backend) — clone and pull for Git-backed repositories.
  • vcti-path — file-ID resolution and file-name validation.
  • vcti-short-uid — generated template and run IDs.
  • vcti-path-tree — the directory tree of a template's files.
  • pydantic — the manifest, catalog and run-status models.

Optional: fastapi, installed with the fastapi extra, for the adapter module only.


Documentation

If you want to… Read
Get started using the package Quick Start above
Build a host application: FastAPI routes, uploads, runs, pitfalls docs/patterns.md
Understand the layers, the on-disk layout and the package's boundaries docs/design.md
Navigate and understand the source docs/source-guide.md

Metadata

Release files for vcti-ywf-template 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcti-ywf-template 3.0.1
File Size Uploaded Provenance Actions
vcti_ywf_template-3.0.1.tar.gz 49.5 kB With provenance Details for vcti_ywf_template-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vcti-ywf-template 3.0.1
File Interpreter ABI Platform Actions
vcti_ywf_template-3.0.1-py3-none-any.whl Python 3 none any Details for vcti_ywf_template-3.0.1-py3-none-any.whl

Total release size: 78.0 kB

Release files / vcti_ywf_template-3.0.1.tar.gz

Download URL vcti_ywf_template-3.0.1.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e08bcb65c1999b8ee4c72230c5c1a5981008ee280e2b2c9ba81c96ad4ec3c79a
BLAKE2b-256 checksum
How to use checksums
60a7bb56f073f57bba250e4f0720bc5ebf04378a823943c0e25dcd2d849dd034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / vcti_ywf_template-3.0.1-py3-none-any.whl

Download URL vcti_ywf_template-3.0.1-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d29600061f17d15d9401d9cd767cf1296fc2a38612637571121e10f37e4149e
BLAKE2b-256 checksum
How to use checksums
ea7c0da07de105a0c457299ac5f16ca838e7b4ba1e151a383ce014fe34336154
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for vcti-ywf-template 3.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vcti_ywf_template-3.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page