vitruvian-tool-kit
Write a tool for the Vitruvian Mac app in
Python. A tool is a folder with a vitruvian-tool.json and a program; the app
starts the program and talks to it over its standard input and output. This
kit is that conversation: you say what each command does, and call the app
from inside a command as an ordinary function call.
from vitruvian_tool_kit import Tool
tool = Tool(version="0.1.0")
@tool.command("hello")
def hello(app):
app.notify.hud(icon="hand.wave", message="Hello")
tool.run()
- One call per message.
app.notify.hud(...),app.clipboard.read_text(),app.storage.get(key=...): each is one request of the protocol, named as the protocol names it. The app may refuse any of them; the call then raisesRefusal. RaiseCommandRefused("why")to refuse a command yourself. - Synchronous, on one thread. A call to the app waits for its answer, ten
seconds at most. A handler must not be
async. - A tool can draw. With
"protocol": "2"andpanelsin its manifest,tool.panel("counter", on_open=..., on_event=...)says what a panel shows and what each thing the person does gives; a page istree(heading("Counter"), button("add", "Add one")), one function a kind of block. The handle sends a page unprompted withrenderand sets the tool's badge withbadge. - A status, and a choice.
app.status("busy", text=..., icon=...)sets the small mark the app draws on the closed island, for a tool whose manifest declarescontributes.status.choice(id, value, options)is a pop-up menu on a page. Both are newer than protocol 2 itself:app.supports(Feature.CHOICE)says whether this app has one. On an app from before themapp.statussends nothing and returns False, and achoiceis drawn as its fallback text, so send afieldthere instead. - A few words with the status.
app.status("busy", activity="3")puts a few words beside the mark, andsince=datetime.now(timezone.utc)a count of seconds the app keeps. The manifest's status says"activity": true. An app before 3.50 does not haveFeature.STATUS_ACTIVITY; the status is sent to it without them. - Chips, sections and help.
chips(id, options, title=...)is a list of options, eachUIChipOption(value=..., title=..., on=...), any number of them on at once; turning one is the eventchange, andevent.valuesholds the value of every option then on.heading(text, section=True)starts a section of the page, andhelp=...ontoggle,field,choiceandchipsis a line under the control. An app withoutFeature.CHIPSdraws chips as their fallback text, so send atogglefor each option there; an app withoutFeature.SECTIONSignoressectionandhelp, so send the help as atextthere. - A notice.
app.show_notice(title, icon=..., detail=..., system=True)shows a line in the island, and withsystem=Truea macOS notification too. It needsnotifyinuses. An app withoutFeature.NOTICEgets the title asnotify/hudinstead. - A slot. A tool whose manifest declares
contributes.slotis told where its slot is: settool.on_slot = lambda app, slot: ....app.dock_to_slot()asks the app to show the slot; to an app withoutFeature.SLOTit sends nothing and returns False. - A folder setting.
"picker": "folder"on a text preference adds a Choose… button that picks a folder. An app withoutFeature.FOLDER_PICKERdraws a plain field. - Never
print. Standard output is the link to the app. Write to standard error, or callapp.log(message=...).
Shipping it
The app starts a tool with Apple's python3 (/usr/bin/python3, Python
3.9), which has none of your packages. So the kit goes inside the tool's
folder, and the program finds it there:
python3 -m pip install --target lib vitruvian-tool-kit
import os, sys
HERE = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(HERE, "..", "lib"))
vitruvian-tool init --template python-kit writes a tool set up this way.
The kit needs nothing but the standard library and Python 3.9 or later.
The whole guide, the protocol and the other kits are in the SDK. MIT licence.
Metadata
Release files for vitruvian-tool-kit 1.9.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 |
|---|---|---|---|---|
| vitruvian_tool_kit-1.9.0.tar.gz | 44.9 kB | With provenance | Details for vitruvian_tool_kit-1.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vitruvian_tool_kit-1.9.0-py3-none-any.whl | Python 3 | none | any | Details for vitruvian_tool_kit-1.9.0-py3-none-any.whl |
Total release size: 88.4 kB
Release files / vitruvian_tool_kit-1.9.0.tar.gz
| Download URL | vitruvian_tool_kit-1.9.0.tar.gz |
|---|---|
| Size | 44.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cec0c7e7999b9b65cd058b8a89f4d77cc74dfb84b7d8f7d6415feecf27e3890
|
|
BLAKE2b-256 checksum How to use checksums |
a94d05e36cf5d16b2bcbe9e386a89a21f8692d88f3642d7d17c8823395616b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Oct 22, 2026.
Transparency logRelease files / vitruvian_tool_kit-1.9.0-py3-none-any.whl
| Download URL | vitruvian_tool_kit-1.9.0-py3-none-any.whl |
|---|---|
| Size | 43.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6e336da422da7fd9231c7fdb9a5847dccd8870683b380eb99f4a6f04adb05f0
|
|
BLAKE2b-256 checksum How to use checksums |
05e5ecc0ece7dca795f2d93a06ecdad98f9863b278823ff6d2a38df72855d622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
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 Oct 22, 2026.
Transparency logSecurity for vitruvian-tool-kit 1.9.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 vitruvian_tool_kit-1.9.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 Oct 22, 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.