Skip to main content

Type 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/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)
wasm-pack build --target web --out-dir pkg --out-name kymostudio_core \
  -- --no-default-features --features wasm
#   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.3.tar.gz (77.1 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.3-cp310-abi3-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

kymostudio_core-0.4.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view details)

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

kymostudio_core-0.4.3-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.3-cp310-abi3-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

kymostudio_core-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file kymostudio_core-0.4.3.tar.gz.

File metadata

  • Download URL: kymostudio_core-0.4.3.tar.gz
  • Upload date:
  • Size: 77.1 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.3.tar.gz
Algorithm Hash digest
SHA256 49169b0bd434dc780417913e7d829894197149457b141e107ec86428d9750a80
MD5 3ada18e905674aa7efa4ddf141c9847d
BLAKE2b-256 577123509370052b7661cd123d839da966a885f3943e764588d650c0c93af9a3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6fecbea95725dbaef613f50b1cd48e2cb29a522ceb69412a68d2b0750bbc3b7e
MD5 b1cb4d1012ad51ffb37e1eee32e636c6
BLAKE2b-256 c4d21e910c34f96a0414554ec6b03b28e8593fe230bf10c3f796d67db71fdb51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c8bf127c0e9f5fbd6e062431a196abefbac29f8f95d3fb36f762cb17188895d
MD5 f13a2f4d785c25e620ae75b4f72abf81
BLAKE2b-256 3fe9a149f93abfe87f7c3be68cfd1059f2406577eeea5dea372dab9031bced4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d410f05d78d06aa9245d0af822cdd033ecf470f659d51526e55f7915f564782
MD5 613bd1b0991fc68aea197820f1144526
BLAKE2b-256 c02194734eb3d35046ae707b36a745cb93350c96fabc6e45b0e48e3ecab28857

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87e9d48ecc1a931589bdad36afd7073c71a0a6aa4833a737ba17f2e3fc93e762
MD5 b6b2c5602a9b14bafc4d383876118db5
BLAKE2b-256 dc5cf35cde6c579a41cd6615812e21ce03adfd330687894acf08e39fcc25207c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kymostudio_core-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ae15bb09d83091c0677ed7c55ca9b59999935fbefd173c4f149991e7f241a230
MD5 c92ebec254c39c1b48ea9d334f50370f
BLAKE2b-256 9f776de708dd94e1ffb90c1337663cc12981e56b15207f74eae628d384e406d6

See more details on using hashes here.

Provenance

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