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>=2.0.0
In pyproject.toml dependencies
dependencies = [
"vcti-ywf-template>=2.0.0",
]
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-ywf5 — the workflow engine (vcti.ywf.engine) whose workflow directories this package manages.vcti-archive— ZIP extraction for uploads and streaming ZIP downloads.vcti-git2 (with thepygit2backend) — 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 2.0.0
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 |
|---|---|---|---|---|
| vcti_ywf_template-2.0.0.tar.gz | 47.7 kB | With provenance | Details for vcti_ywf_template-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vcti_ywf_template-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for vcti_ywf_template-2.0.0-py3-none-any.whl |
Total release size: 75.6 kB
Release files / vcti_ywf_template-2.0.0.tar.gz
| Download URL | vcti_ywf_template-2.0.0.tar.gz |
|---|---|
| Size | 47.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f50a244a1fd02a3d27c6beb80bd7e48502c230276e57fe46735e30c8fd5e18b
|
|
BLAKE2b-256 checksum How to use checksums |
6fff0a3344aa650daaa66a7b5ffd2529a3d33a10f07dd25e3ca78770ffaf4145
|
| 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 logRelease files / vcti_ywf_template-2.0.0-py3-none-any.whl
| Download URL | vcti_ywf_template-2.0.0-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
008bd99fd0105a6955fffcf9887d2d54b4a3b7c038bf45f62b42c53435b64979
|
|
BLAKE2b-256 checksum How to use checksums |
e511ce2c4de12025f4f30c71ac6fbe807e5920c6428193620c81a1647fd86f63
|
| 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 logSecurity for vcti-ywf-template 2.0.0
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.
Attestation for vcti_ywf_template-2.0.0.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 logA 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.