Skip to main content

Prompt it. See it appear. Watch it animate. (Core)

Project description

kymostudio-core (Rust)

The pure-Rust core for kymostudio: an SVG → PNG/PDF rasterizer (built on resvg / svg2pdf) and the shared diagram engine. No browser, no headless Chrome, no C/Cairo/Skia system dependencies.

The engine half parses diagram-as-code into kymo's model, lays it out, and serializes to the .kymo.json interchange format the Python/JS front-ends consume — written once in Rust instead of duplicated per language. First subsystem: Mermaid flowchart import (mermaid_to_kymojson). See docs/specs/format-mermaid/.

One core crate, compiled to three targets from a single source via feature flags — so the Rust CLI, the Python package, and the JS/browser playground all share the exact same resvg engine (resvg is CSS-class-aware, the reason the project avoids cairosvg):

Target Feature Build tool Consumer
Native lib system-fonts (default) cargo kymostudio CLI crate
Python extension (abi3) python maturin → wheel packages/python
wasm (browser + Node) wasm wasm-pack → pkg packages/js, website playground

Core functions: svg_to_png(svg: &[u8], scale: f32) and svg_to_pdf(svg: &[u8]) (rasterizer), plus mermaid_to_kymojson(src: &str) (engine). Each binding (src/python.rs, src/wasm.rs) is a thin façade.

CLI — kymo

The kymo command-line tool lives in the sibling kymostudio crate (a thin front-end over this core). Install it with cargo install kymostudio.

Build each target

# Native lib + tests
cargo test

# The `kymo` CLI (sibling crate)
cargo build --release --manifest-path ../kymostudio/Cargo.toml   # -> ../kymostudio/target/release/kymo

# Python wheel (abi3, one wheel for CPython ≥ 3.10)
maturin build --release --out dist        # -> dist/kymostudio_core-*-abi3-*.whl
#   import _kymostudio_core; _kymostudio_core.svg_to_png(svg_bytes, scale)

# wasm (browser + Node) — system-fonts OFF (no fs/mmap on wasm).
# Plain `wasm` is the LEAN module (no svgToPng/svgToPdf — 0.9 MB vs 6.1 MB raw);
# add `pdf` for the full surface the npm/vscode artifacts ship.
wasm-pack build --target web --out-dir pkg --out-name kymostudio_core \
  -- --no-default-features --features wasm,pdf
#   import { svgToPng } from './pkg/kymostudio_core.js'

CI builds and smoke-tests all of the above across Linux/macOS/Windows — see .github/workflows/rust.yml.

Library use (Rust)

let svg = std::fs::read("in.svg")?;
let png: Vec<u8> = kymostudio_core::svg_to_png(&svg, 1.0)?;
std::fs::write("out.png", png)?;

The version is kept in lockstep with the rest of the monorepo (Cargo.tomlversion).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kymostudio_core-0.4.10-cp310-abi3-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

kymostudio_core-0.4.10-cp310-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kymostudio_core-0.4.10-cp310-abi3-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file kymostudio_core-0.4.10-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.10-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fdbc5c2508a85a53e328b1f1e2d8f9bc4f65c38ff4ef2bb2eb410e2bda7e64d7
MD5 8d63bc0f00fffce4e785709efbe861a3
BLAKE2b-256 ccef0b296e1b0760fdcfaad02a38cca4b455c0beab68d24830cb4eec13c5c580

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.10-cp310-abi3-win_amd64.whl:

Publisher: release-crate.yml on kymostudio/kymostudio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfcac4e19b4af96dc677daa4406df7333917a2a68e76f5c62033a86829c44211
MD5 dfcdb4ba6da927be0e39c9e656a87313
BLAKE2b-256 16ebc3187916718f86c0c975116e5231351a62a2e508a839f3c1afe892ea3afe

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-crate.yml on kymostudio/kymostudio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db836712b75e7a4f8544062c4765e899e6b9657ff9b9652ba508d7c69e310025
MD5 5f32a41fa4f248eaa52497a47fddc523
BLAKE2b-256 23c2149313ba1b41e2d5fd6fd82a123b11c07996e83c6dace062ca4080d5fcbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-crate.yml on kymostudio/kymostudio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kymostudio_core-0.4.10-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.10-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3254d9d8569bb472d339fbfaf840b14c3d60682e495c640a58e74e014ed1e49
MD5 128b8bbf67f47b2ab24a6c20bd5cc874
BLAKE2b-256 e1e02a527c0c653e32694cec42c974191befb328ead46b147155326dc6731bc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.10-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release-crate.yml on kymostudio/kymostudio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kymostudio_core-0.4.10-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.10-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4d3ad8c93ebd29f8369b0c3d58d4d726af7ead3144c1e883c4dbce4c48d982ab
MD5 217569be5c9ab71d888bdd1585c059c7
BLAKE2b-256 618ac9bfb8f2fbe8f6c02997660ac7e16dd94b835571aba91f123e2e3c720a00

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.10-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release-crate.yml on kymostudio/kymostudio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page