Skip to main content

Embed XMP metadata and sign media assets using Swarmauri plugins.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - EmbeddedSigner Discord

Embed metadata into a file and write it back in place.

signer.embed_file("image.png", xmp_xml)

Read embedded metadata without materialising the bytes in memory.

print(signer.read_xmp_file("image.png"))

Remove metadata and persist the stripped bytes to a new path.

signer.remove_xmp_file("image.png", write_back=True)

Sign file contents without manual IO boilerplate.

signatures = asyncio.run( signer.sign_file( "image.png", fmt="JWSSigner", key="LocalKeyProvider://img-key", attached=True, ) )


### Command line interface

Installing the package exposes an `embedded-signer` executable that wraps the
most common workflows:

```bash
# Embed metadata from a file into an image in place.
embedded-signer embed example.png --xmp-file metadata.xmp

# Read metadata to stdout (non-zero exit if none is embedded).
embedded-signer read example.png

# Remove metadata and write the result to a new file.
embedded-signer remove example.png --output clean.png

# Sign using a key reference exposed by a provider plugin.
embedded-signer sign example.png --format JWSSigner --key-ref local://img-key

# Embed and sign in one step, writing signatures to JSON.
embedded-signer embed-sign example.png \
  --xmp-file metadata.xmp \
  --format JWSSigner \
  --key-ref local://img-key \
  --signature-output signatures.json

Development

  1. Install development dependencies:

    uv pip install -e ".[dev]"
    
  2. Format and lint code with ruff:

    uv run ruff format .
    uv run ruff check . --fix
    
  3. Run the unit tests in isolation:

    uv run --package EmbeddedSigner --directory plugins/embedded_signer pytest
    

Project Resources

License

EmbeddedSigner is released under the Apache 2.0 License. See the LICENSE file for details.

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

embeddedsigner-0.11.0.dev1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

embeddedsigner-0.11.0.dev1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file embeddedsigner-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: embeddedsigner-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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 embeddedsigner-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 a9f2c2fb325f0032e855e73e0bab58839a9ebaa815e5b35ed3c090a779abd6de
MD5 dd6936a1bf99a85d863a9734d3c140f0
BLAKE2b-256 eb8f4c2e0f4aa5254017d10979798e02bc384e668d91b25513043f21c69c6192

See more details on using hashes here.

File details

Details for the file embeddedsigner-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: embeddedsigner-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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 embeddedsigner-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 b946293a5c5e492fa756ea1358265078ecd0354841ac21f93a4e17e56ab34d66
MD5 e5d0232eca1018eeb3bc938f17ad2f6f
BLAKE2b-256 5820636e208fc6e10202c25a87ca7d695276845f5628efd9d191e772d4d89be3

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