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 Distribution

kymostudio_core-0.4.5.tar.gz (152.5 kB view details)

Uploaded Source

Built Distributions

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

kymostudio_core-0.4.5-cp310-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

kymostudio_core-0.4.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

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

kymostudio_core-0.4.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

kymostudio_core-0.4.5-cp310-abi3-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kymostudio_core-0.4.5-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.5.tar.gz.

File metadata

  • Download URL: kymostudio_core-0.4.5.tar.gz
  • Upload date:
  • Size: 152.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kymostudio_core-0.4.5.tar.gz
Algorithm Hash digest
SHA256 d9c8d4f8c2328034d55a2c4e7b7d810d97adae8af522c9df272b4cbebb128e81
MD5 db5f69d8a99988c707341c85e1ba4c57
BLAKE2b-256 98363b31e306133ae29bf94966739bbbfe2e312c36513ef5686dac285048ab6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.5.tar.gz:

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.5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f50553485ce9302a99764d410204d5d6e5ba115f1d06aa3093fa8731a0270b43
MD5 51725ab71bc613d0cca4cea2c8228bc2
BLAKE2b-256 ef5e30d00ff3eab4ac66adecc2d72eed6e52b0492958e9b3f5ed4f0cb075eda4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d44e16cddcc3c9f6f32ea1cb8bffbaf2ac00c4845e3b1e35972aabd72029c9b
MD5 7d84d4c564af150d66ce36068eea28ad
BLAKE2b-256 871ce7aa3070013b9b09a6955a6f93040681aacc1b018ac9471d935095c07cef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d45a2dc7ca5332d7997ebffaf92680af6982907094970e25d51d9134b97df633
MD5 112784810d0a2ba320063f192522c130
BLAKE2b-256 6146c2b25eed864a4cf306c4a5d66f3fc83220ebb23b4eb5b202ecd7bb5b7206

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5b33047d58ffdd4a193a70d4ca46e0199bb4af2854ba88a3c2fc56812eff8cc
MD5 42015c573eff3f4c51b21bb4d081d262
BLAKE2b-256 e319ae1aac8dfb5c14dbaf61260e9495a81f275efad494c537a56d87f8736d89

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.5-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bce789cde742558949e5e1e2821932093e62fd3c517e518f1a1d579cd39ab3be
MD5 215cea82f2b09b9473a074bbe2c12cce
BLAKE2b-256 442ce95ad2522288986bd6dccbf1ec8e5b032cc0fa0580f02cd0c6a08089a161

See more details on using hashes here.

Provenance

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