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.9-cp310-abi3-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

kymostudio_core-0.4.9-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.9-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.9-cp310-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kymostudio_core-0.4.9-cp310-abi3-macosx_10_12_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 004cb71486e3fbf836d98ee5d9cb7466aa254a4de06c23fc49eac9478a3b5118
MD5 62ddb5152ec0357a60d7954573de5362
BLAKE2b-256 43ad970945c0fbf9e63c43848c15a2b0dbc6305fbfb4c7a49975fdee67373caa

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.9-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.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a782b893f2302952aa98266c9927fa0c7f9c0d33db1b17bbf8e125d73684718b
MD5 d07b85347e4b005a2eb886206d282051
BLAKE2b-256 71862b4a4a7089e805ec8f803ec30be9aefd34ec97db1bee036723ec2488d9cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.9-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.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 917be96eebb90e275a3e07576d3f60f7859e2fc560b42ec668b04582cd0724ec
MD5 eea12db361e4182a91f5cf35482e78e4
BLAKE2b-256 cac0d3d6af8dff571aa3ae8680dfb9b95a2479010909a80ae783e1e52b14e485

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.9-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.9-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb72359c2071343c2e523651f64f615af5b1c25428c079d63d0c4b728c4d1d9e
MD5 48f186bef47f44fc93c6347f6a9d6115
BLAKE2b-256 e98061501c9736bb868f1646c6351e3e76482bc6f4810af694dbc2173ced266f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.9-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.9-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.9-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8fbf9d296cce8743ac4852660741cb24cf21ccd05cc72f78982f13573cec0ba0
MD5 3ba13054b22821ccd76eda16c1c484f5
BLAKE2b-256 7bfcafe9de22fce05d7a8d43513fb16674676b852b9e27fc20eb4462ce9f3b77

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.9-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