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

Uploaded CPython 3.10+Windows x86-64

kymostudio_core-0.4.6-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.6-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.6-cp310-abi3-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kymostudio_core-0.4.6-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.6.tar.gz.

File metadata

  • Download URL: kymostudio_core-0.4.6.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.6.tar.gz
Algorithm Hash digest
SHA256 c0f7d49dc5a8bac44beef6f343bcc47a74268dd95ab800115b29871f15986921
MD5 60ec6d8fb8e47ee38843f6a259cfb4e8
BLAKE2b-256 e9ebd7fba782bd7c2d9b4a6458d65b965ac223da0fe5a91d0b96d0551e0ab325

See more details on using hashes here.

Provenance

The following attestation bundles were made for kymostudio_core-0.4.6.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.6-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for kymostudio_core-0.4.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 af202ea4f4bd0aecc55b9f1fc01c195417f66c8a298bc0fd2e5a59176f271134
MD5 2db2dd6df176cf52d9d46a298ec793ad
BLAKE2b-256 bd061e036540ff8aeb5129fa237da30248370556fd4b7aba8d4507647277e550

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f25257d2b67ffae4f3e73ea5d8c214a24518ccdc33a6572d45fc77399d7f1d9
MD5 9f79944d1e04c68859a8fb81165649dc
BLAKE2b-256 d1b7a5d40b23bce1620f5258a14c755f2c2ceee497593470814ba71e8f149f00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 03e1e70748f568f8b490918c105d14ce7e3318790576b66c0ec72fec83305be3
MD5 cdd8ea8e1a6acf32e781c65e2d24123f
BLAKE2b-256 a7c06617d482b1776dc14c854af51fbdebf921a09fa0ca1a3a2d0591f28b629a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f47d14d6e1b63fd28591d04faeff28a4d4343630d34f4ef61d3b933d969e49be
MD5 7b917705b3bd10a1958cec3cbd2ead94
BLAKE2b-256 9e52773cd9308c11895b8fc536d1af369a5e0e7976dd501eafc4f649d2390ac7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.6-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a5b0767f0bf487e767ac852e6179b16cbb0fd7b8e60fe798088d0efc30216fd4
MD5 281df4fc9a50ea5ea503a1787ad9a0de
BLAKE2b-256 56ef0d43ee23e849e66e882cf73fa0e8ff39841ed9d1585ef2430dca737b5658

See more details on using hashes here.

Provenance

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