GIF handler for embedding and extracting XMP packets in Swarmauri runtimes.
Project description
swarmauri_xmp_gif
swarmauri_xmp_gif includes the GIFXMP handler that preserves XMP packets inside GIF89a application extensions using the canonical XMP Data identifier and XMP authentication code.
Features
- Registry native – extends
EmbedXmpBaseso managers such asEmbedXMPcan discover it through Swarmauri's dynamic registry. - Block aware – iterates GIF sub-blocks safely and terminates on sentinel bytes to avoid corrupting animations.
- Spec aligned – writes uncompressed UTF-8 payloads that match Adobe's guidance for GIF metadata.
Installation
# pip
pip install swarmauri_xmp_gif
# uv
uv add swarmauri_xmp_gif
Usage
from pathlib import Path
from swarmauri_xmp_gif import GIFXMP
handler = GIFXMP()
gif_path = Path("example.gif")
xmp_packet = """<x:xmpmeta xmlns:x='adobe:ns:meta/'><rdf:RDF>...</rdf:RDF></x:xmpmeta>"""
# Embed using an application extension block
updated_bytes = handler.write_xmp(gif_path.read_bytes(), xmp_packet)
gif_path.write_bytes(updated_bytes)
# Retrieve the RDF/XML payload
restored_xml = handler.read_xmp(updated_bytes)
print(restored_xml)
# Remove the extension again
clean_bytes = handler.remove_xmp(updated_bytes)
Why it works
- Standards-based – uses the XMP-defined App ID and Auth Code from Adobe's reference implementation.
- Chunk-aware – scans GIF sub-blocks safely, terminating on sentinel bytes and ignoring malformed payloads.
- Registry-native – inherits from
EmbedXmpBase, so managers only need to query the component registry.
Project Resources
- Source: https://github.com/swarmauri/swarmauri-sdk
- License: Apache 2.0
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 Distribution
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 swarmauri_xmp_gif-0.1.1.dev44.tar.gz.
File metadata
- Download URL: swarmauri_xmp_gif-0.1.1.dev44.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db7e2abf04ae22a16188aa037bd0ae3223b32731b1f6c3bc76f48121e4ef3b3b
|
|
| MD5 |
2428a404a023c52613b57bcd407732ac
|
|
| BLAKE2b-256 |
5faa947b8f6cd4f19ae1fd25df7436d6365000152e50636c6411b6d9d1810bcd
|
File details
Details for the file swarmauri_xmp_gif-0.1.1.dev44-py3-none-any.whl.
File metadata
- Download URL: swarmauri_xmp_gif-0.1.1.dev44-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197a1df94f4bbdb69d5c2a6fa46bf4fd87b0436ce78f476ee7a64fc19e5fb963
|
|
| MD5 |
de7eb2d2794d8300e3622b1494a5ddf2
|
|
| BLAKE2b-256 |
5c43a048e1c3cc41ac9e852f8a8c5544d0ff0a89e7ba5d45b6e961884e157805
|