Skip to main content

Scrybe Mermaid — standalone PNG iTXt codec (Rust-backed)

Project description

scrybe-mermaid

Standalone PNG iTXt codec: embeds and extracts Mermaid diagram source as invisible metadata inside a PNG file. Python on the outside, Rust on the inside.

What it does

Uses the PNG iTXt (international text) metadata chunk mechanism to store Mermaid diagram source alongside the rendered image. The PNG is fully valid and renders normally in any image viewer. The source text travels with the image and can be round-tripped without loss.

Codec format

  • Chunk key: scrybe-mermaid
  • Value: JSON { "source": "<mermaid source>", "sha256": "<hex>" }

The sha256 field is a SHA-256 digest of the source bytes for lightweight integrity verification.

Role in the architecture

scrybe-mermaid is a self-contained utility crate with no dependency on scrybe-core. It is used by scrybe-mcp-server (the embed/extract tools), scrybe-cli (scrybe mermaid embed/extract/verify), and the Tauri backend.

Key public types and entry points

Symbol Description
embed(png_bytes, source) -> Result<Vec<u8>> Inserts iTXt chunk; returns modified PNG bytes
extract(png_bytes) -> Result<MermaidPayload> Reads and parses the iTXt chunk
MermaidPayload source: String + sha256: String
MermaidError Error type covering missing chunk, malformed JSON, PNG decode failure

Build and test

cargo build -p scrybe-mermaid
cargo test -p scrybe-mermaid

Depends on the png crate for chunk-level PNG manipulation and base64 for encoding the iTXt payload. No external binaries required.

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.

scrybe_mermaid-0.1.0a4-cp311-cp311-win_amd64.whl (183.2 kB view details)

Uploaded CPython 3.11Windows x86-64

scrybe_mermaid-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl (290.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

scrybe_mermaid-0.1.0a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (331.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file scrybe_mermaid-0.1.0a4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd8b693d6a534f09ad78a5f1c604f3a234b0ea719e062ef95bf1ae9e58b03d0c
MD5 1d78679a441684a4d89a37063b5d6317
BLAKE2b-256 19d791f9adbe652a37d3b180756778390e9b5be07f56b8bd6ec537f34dc0a1d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a4-cp311-cp311-win_amd64.whl:

Publisher: release.yml on hartsock/scrybe

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

File details

Details for the file scrybe_mermaid-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28436a211b1b4061fb9a087c8f112a2c22631a0b37c0bf098f00385270c0711c
MD5 5b6430fde98d77768981f7f44ef9f3f1
BLAKE2b-256 4fa86847a8abd0d52e151ad12e6f8cb8d381c6759753d04d772ba8cec29b4522

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on hartsock/scrybe

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

File details

Details for the file scrybe_mermaid-0.1.0a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d46baf73c046010073b2ee760713e1bcf12fd229b96d4042b4c7bf0fce4b1fbb
MD5 e5213f9d88be161ba11110a019529356
BLAKE2b-256 89f75bc186a3310eed96bf0f7d0095f29788097e81840e693aa3fec2415a2774

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on hartsock/scrybe

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