Skip to main content

Protocol Drawing Studio

Draw scientific diagrams with code, then edit their vectors in your browser. The browser editor uses SVGEdit; the embedded assistant uses the original shared ai-ify package. Python serves the complete editor locally. Node.js is not required to open, edit, insert library images, save, or publish an agent revision.

Install and open

python -m pip install protocol-drawing-studio
protocol-drawing drawing.svg

Run protocol-drawing without a filename to start a blank drawing. The command reuses one local server and opens the user's default browser. Use protocol-drawing-server --port 3017 for a foreground server.

Requires Python 3.11 or later. Windows is the verified desktop platform; Linux and macOS use portable paths and launch logic but are not yet desktop-tested. The package provides a Windows command launcher; a standalone desktop installer and Explorer file association are separate distribution work.

Manual editing

Select objects on the canvas or in the Objects tree. Delete/Backspace removes selected objects; arrows move them and Shift makes larger movements. Native undo and redo cover edits, inserted components, layout and attached arrows. Ungroup splits artwork into editable parts. The Components view can insert an image into the current editor, or open it as a separate drawing.

Save working copy creates a new SVG under the user's application-data directory; it never overwrites an opened original. Unsaved recovery, named styles and favourite images are stored in that browser. Interface preferences follow the browser origin rather than an account.

Generate drawings in Python

from pathlib import Path
from protocol_drawing.library import components, compose

matches = components('pipette')
svg = compose([{'component': matches[0]['id'], 'x': 100, 'y': 100, 'width': 200}])
Path('drawing.svg').write_text(svg, encoding='utf-8')

components(query) returns catalogue metadata including exact IDs and licences. compose gives each instance independent vector IDs and retains attribution inside a non-visible description. Agents can create arbitrary SVG paths, text and groups; using a library image is optional. Keep text editable and concise. SVG exports must be self-contained vectors, not scripts, embedded raster images or external resources. Do not remove attribution when editing borrowed artwork.

Register newly made artwork for local reuse:

from protocol_drawing.library import register_component
register_component('my-vector.svg', id='user.pipette', title='My pipette', tags=['pipette'])

Local components appear in the editor's library and in components(query). They live exclusively in user data. To revise a frozen component, register a new ID. Supply the attribution argument with the original creator/source/licence when registering borrowed artwork; registering does not change its licence.

Assistant and marked feedback

The assistant panel, provider selection, conversation and browser command bridge come from the separately maintained ai-ify dependency. AI use additionally requires a configured supported provider/agent command and its own authentication; installing the editor does not supply an AI account. Manual editing works without one. See ai-ify for provider setup.

Draw feedback marks over the picture, add a concise request, then send it through the shared panel. Background mode works from the exact manually edited snapshot. An agent writes a candidate into the supplied candidate directory and calls drawing.publish. The preview applies it only if the working revision still matches; concurrent user edits are preserved. Marks remain outside the saved SVG. Live commands also require the current revision.

The assistant can discover images using protocol_drawing.library.components or the editor's /api/components endpoint, and compose vectors with the Python API. For optional React/Remotion authoring, set PROTOCOL_DRAWING_REMOTION to a separate compatible project containing tools/draw.tsx, with Node.js and its dependencies installed. Such a project is not part of this distribution.

Library and licences

The public catalogue contains selected downloaded BioIcons and Health Icons artwork. Every included record has an allowed individual licence, source URL, creator, original source hash and recorded modifications. Full licence texts and per-image attribution ship with the package. The Components view displays the credits; inserted SVG groups retain them as non-visible descriptions.

This distribution contains no private experiment figures, custom reusable components, agreed templates, output folders or local scene projects. Images larger than the editor's 5 MiB limit, unsupported vectors, and records outside the release licence policy are excluded by the preparation script. See THIRD_PARTY_NOTICES.md.

Original editor code: MIT, Copyright 2026 Brancaccio Lab. Third-party images and vendor code retain their own licences; MIT does not replace those terms.

Storage and troubleshooting

State and working files use the user's application-data directory, never the installed package. Set PROTOCOL_DRAWING_STATE to override it. Server logs are written there. Close the originating editor before using its Components tab; an orphaned library tab cannot insert into a closed editor.

The server listens only on this computer. If startup fails, inspect desktop-server.log in the state directory. A unavailable AI provider does not require reinstalling the editor; configure it through ai-ify.

Release development

The browser files are prepared from the maintained editor, not a second fork. Run the parent project's tools/prepare_public_package.py to synchronise the explicit source allowlist and licensed catalogue. Build wheels and source archives with python -m build; check metadata with python -m twine check dist/*. Test a wheel in an isolated environment outside the source checkout.

Metadata

Release files for protocol-drawing-studio 0.1.0

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

Source distribution (sdist)

Source distribution for protocol-drawing-studio 0.1.0
File Size Uploaded
protocol_drawing_studio-0.1.0.tar.gz 92.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for protocol-drawing-studio 0.1.0
File Interpreter ABI Platform
protocol_drawing_studio-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 188.6 MB

Release files / protocol_drawing_studio-0.1.0.tar.gz

Download URL protocol_drawing_studio-0.1.0.tar.gz
Size 92.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5db400dacaa9697c72e000983afdd8051fe97782c513fab98733d98397640328
BLAKE2b-256 checksum
How to use checksums
4469b0ffb6f796b946e8ddda1baa76dbea2c0dc2a7d901c42bd487ffb5428136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / protocol_drawing_studio-0.1.0-py3-none-any.whl

Download URL protocol_drawing_studio-0.1.0-py3-none-any.whl
Size 96.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6168bbe38ac289698f16696087b0df4edd6a6c0b13a8ffef4dc1130020e8a65d
BLAKE2b-256 checksum
How to use checksums
69397043e9020959b9b8ca2d0d6dff1633619194e7c36d1a9eeab205606096eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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