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 Distribution

scrybe_mermaid-0.1.0a5.tar.gz (44.4 kB view details)

Uploaded Source

Built Distributions

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

scrybe_mermaid-0.1.0a5-cp39-abi3-win_amd64.whl (188.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

scrybe_mermaid-0.1.0a5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (336.8 kB view details)

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

scrybe_mermaid-0.1.0a5-cp39-abi3-macosx_11_0_arm64.whl (295.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file scrybe_mermaid-0.1.0a5.tar.gz.

File metadata

  • Download URL: scrybe_mermaid-0.1.0a5.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scrybe_mermaid-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 e99f11e45a314239f8b05bd99b4b1063d1e92d27791f640387f2be81659cf81d
MD5 4f62e7a69de9f4236b8d8d617c02cd55
BLAKE2b-256 3a39538d2e75c8a8f3052fad2543990eef56ace36734305ac4dc9abfa5b7ebb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a5.tar.gz:

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.0a5-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 025a762d9f1394c494c62f7405ab9be75cc1ca9e79217ec76de19817a41d875a
MD5 cf2421268b998889aad77b7505a3bcd2
BLAKE2b-256 d2cdb7b9d2e0d96fe2ff25bb0473a319dd3b33dd4e60c4d6962138055d23a44f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a5-cp39-abi3-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.0a5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f653a1807ae06008bc7ced8e278f1eacf5f1ddfec90bb4b7bffd8e66eb6d833c
MD5 3821fca3048fc6fc0984ac8dee41dae4
BLAKE2b-256 04fdbf55b07efd0972002645ce0ae2137bdacbc10584c9dc923ccdad57d6a9e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a5-cp39-abi3-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.

File details

Details for the file scrybe_mermaid-0.1.0a5-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scrybe_mermaid-0.1.0a5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33b346131e96b3d5c42677287c05d8c147fdfde61afffa3ae741878d0240bcf7
MD5 8c4ec69b8c0b0fa29613425f5ad35be1
BLAKE2b-256 76709b0f0078109d2aa296b05ffe4d2f0008a61ef3135e85d6408b1dc9f934db

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrybe_mermaid-0.1.0a5-cp39-abi3-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.

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