Skip to main content

PNG handler for embedding and extracting XMP packets in Swarmauri runtimes.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_xmp_png


swarmauri_xmp_png

swarmauri_xmp_png packages the production-grade PNGXMP handler. It reads, writes, and removes XMP packets stored in uncompressed iTXt chunks that follow Adobe's keyword guidance, making it immediately compatible with downstream asset pipelines.

Features

  • Registry-ready – inherits from EmbedXmpBase so Swarmauri's dynamic registry can auto-discover the handler.
  • Spec compliant – emits iTXt chunks with the XML:com.adobe.xmp keyword and UTF-8 payloads.
  • Safety guards_ensure_xml performs a minimal RDF/XML check before embedding metadata.

Installation

Choose the tool that matches your workflow:

# pip
pip install swarmauri_xmp_png

# uv
uv add swarmauri_xmp_png

Usage

from pathlib import Path

from swarmauri_xmp_png import PNGXMP

handler = PNGXMP()
image_path = Path("example.png")
xmp_packet = """<x:xmpmeta xmlns:x='adobe:ns:meta/'><rdf:RDF>...</rdf:RDF></x:xmpmeta>"""

# Embed an XMP packet
updated_bytes = handler.write_xmp(image_path.read_bytes(), xmp_packet)
image_path.write_bytes(updated_bytes)

# Verify the packet can be recovered
restored_xml = handler.read_xmp(updated_bytes)
print(restored_xml)

# Remove XMP if necessary
clean_bytes = handler.remove_xmp(updated_bytes)

Why it works

  • Dynamic discovery – the handler is automatically registered with DynamicBase consumers via inheritance.
  • Standards alignment – PNG metadata lives in an iTXt chunk per ISO 16684 guidance.
  • Predictable behavior – read/write/remove flows mirror each other so pipelines remain idempotent.

Project Resources

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

swarmauri_xmp_png-0.1.1.dev39.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_xmp_png-0.1.1.dev39-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_xmp_png-0.1.1.dev39.tar.gz.

File metadata

  • Download URL: swarmauri_xmp_png-0.1.1.dev39.tar.gz
  • Upload date:
  • Size: 3.4 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

Hashes for swarmauri_xmp_png-0.1.1.dev39.tar.gz
Algorithm Hash digest
SHA256 5a2adcf6dde15c443039743149af53ad7d9c6c3885a020403cc8a17f210e6118
MD5 8e3a90e76ae8911e98926a7e4fe87b28
BLAKE2b-256 a69dd318ec5bba60786f7b45440cb59ae50ba7fc06ba7f8d6d54736b69103fa1

See more details on using hashes here.

File details

Details for the file swarmauri_xmp_png-0.1.1.dev39-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_xmp_png-0.1.1.dev39-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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

Hashes for swarmauri_xmp_png-0.1.1.dev39-py3-none-any.whl
Algorithm Hash digest
SHA256 80a9faa0252f6e1b719b89e9d4e6f9910f0dfa36f9159c021bb54e46a374807f
MD5 37a8e5be8734bdd58ff2c9e93952175b
BLAKE2b-256 942a375f16c27dc343db71c45204b9c7c8d2b7fede79c206c148f8a3dcea56cf

See more details on using hashes here.

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