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

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.1.5.dev1.tar.gz (12.0 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.1.5.dev1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: embeddedsigner-0.1.5.dev1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.1.5.dev1.tar.gz
Algorithm Hash digest
SHA256 21ce1eb8ecb61e96913aa4cc70596b2e6d059374aed103f9bec58862923b09e2
MD5 e69bff6a5b2c9991f2434da6fed479ce
BLAKE2b-256 5d314a586535c08b55b10f736c97ea86ac445ffe469646ac0e193a4e3b275ce2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: embeddedsigner-0.1.5.dev1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.1.5.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 29eebd09a6321be6d4cf4f9d6e9e57e26f2524dcea8700ea0fb8de26fbd966bc
MD5 b2003df00d06928b219e40adbb25917f
BLAKE2b-256 17cde158ee7bdf0e6ce4a6315ac372816f31b497aae6784ab1878cce2156cbec

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