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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrybe_mermaid-0.1.1rc1.tar.gz.
File metadata
- Download URL: scrybe_mermaid-0.1.1rc1.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
086a50b83e58de9d5a2c31fc5f559957da229d6aedf85a701c16deeca3ff8836
|
|
| MD5 |
1190af051d219c7a389ca7035a141b98
|
|
| BLAKE2b-256 |
eddc731718fc41c68aa33d47700b82ab9aeb0ac87f73f7905c4d9479528fd672
|
Provenance
The following attestation bundles were made for scrybe_mermaid-0.1.1rc1.tar.gz:
Publisher:
release.yml on hartsock/scrybe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrybe_mermaid-0.1.1rc1.tar.gz -
Subject digest:
086a50b83e58de9d5a2c31fc5f559957da229d6aedf85a701c16deeca3ff8836 - Sigstore transparency entry: 1487158547
- Sigstore integration time:
-
Permalink:
hartsock/scrybe@b24b121358da16a5b660173f219a33a5f424d031 -
Branch / Tag:
refs/heads/release/v0.1.1 - Owner: https://github.com/hartsock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b24b121358da16a5b660173f219a33a5f424d031 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scrybe_mermaid-0.1.1rc1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: scrybe_mermaid-0.1.1rc1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 188.8 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25cfd5e5e258eb980b7dd57636ad521c362dfc37e8618bfbfc3190cb2fd1fc32
|
|
| MD5 |
c8f54341d8085456c4a8c29c4f0a6968
|
|
| BLAKE2b-256 |
7309a6c0eb1d570e754142102f0deb565676ebe0236035ddf5f8cde3eef32eab
|
Provenance
The following attestation bundles were made for scrybe_mermaid-0.1.1rc1-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on hartsock/scrybe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrybe_mermaid-0.1.1rc1-cp39-abi3-win_amd64.whl -
Subject digest:
25cfd5e5e258eb980b7dd57636ad521c362dfc37e8618bfbfc3190cb2fd1fc32 - Sigstore transparency entry: 1487158603
- Sigstore integration time:
-
Permalink:
hartsock/scrybe@b24b121358da16a5b660173f219a33a5f424d031 -
Branch / Tag:
refs/heads/release/v0.1.1 - Owner: https://github.com/hartsock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b24b121358da16a5b660173f219a33a5f424d031 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scrybe_mermaid-0.1.1rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: scrybe_mermaid-0.1.1rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 336.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
804f95976e287122b4bc9017a48fcd49e074bc656dd9e5f257ac8d3d72888aad
|
|
| MD5 |
205a5c39dadb9271294356af40466e2a
|
|
| BLAKE2b-256 |
69d6013d8761f227d7d8c2fb89ddc1103863e748f9bf6535ec8dd44a1eb83e1b
|
Provenance
The following attestation bundles were made for scrybe_mermaid-0.1.1rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on hartsock/scrybe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrybe_mermaid-0.1.1rc1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
804f95976e287122b4bc9017a48fcd49e074bc656dd9e5f257ac8d3d72888aad - Sigstore transparency entry: 1487158735
- Sigstore integration time:
-
Permalink:
hartsock/scrybe@b24b121358da16a5b660173f219a33a5f424d031 -
Branch / Tag:
refs/heads/release/v0.1.1 - Owner: https://github.com/hartsock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b24b121358da16a5b660173f219a33a5f424d031 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scrybe_mermaid-0.1.1rc1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: scrybe_mermaid-0.1.1rc1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 295.0 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f825c498af48c04f01a1edb80f0958a26615af35138b93f055a4e44fcdd210c
|
|
| MD5 |
0926120af8a3f9a2b8f76f19c13586ae
|
|
| BLAKE2b-256 |
511dce86d32e9f2dacd5373610902520381c694459bc4fe2769fcec2c323f687
|
Provenance
The following attestation bundles were made for scrybe_mermaid-0.1.1rc1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on hartsock/scrybe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrybe_mermaid-0.1.1rc1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
6f825c498af48c04f01a1edb80f0958a26615af35138b93f055a4e44fcdd210c - Sigstore transparency entry: 1487158669
- Sigstore integration time:
-
Permalink:
hartsock/scrybe@b24b121358da16a5b660173f219a33a5f424d031 -
Branch / Tag:
refs/heads/release/v0.1.1 - Owner: https://github.com/hartsock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b24b121358da16a5b660173f219a33a5f424d031 -
Trigger Event:
push
-
Statement type: