Metadata-Version: 2.4
Name: EmbeddedSigner
Version: 0.11.0.dev1
Summary: Embed XMP metadata and sign media assets using Swarmauri plugins.
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: xmp,signing,swarmauri,metadata,security,digital-rights-management,drm,license-rights,embedded-licensing,tamper-proofing,tamper-evidence,content-protection,png,gif,jpeg,svg,webp,tiff,pdf,mp4,digital-asset-security,metadata-signing,workflow-automation,plugin-orchestration,asyncio,plugin,digital-asset-workflows,cms,pkcs7,cades,jws,openpgp,pdf-signatures,xmldsig
Author: Jacob Stewart
Author-email: jacob@swarmauri.com
Requires-Python: >=3.10,<3.15
Classifier: Development Status :: 1 - Planning
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Framework :: AsyncIO
Classifier: Topic :: Security :: Cryptography
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Video
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: full
Provides-Extra: local
Provides-Extra: memory
Provides-Extra: signing-all
Provides-Extra: signing-cms
Provides-Extra: signing-jws
Provides-Extra: signing-openpgp
Provides-Extra: signing-pdf
Provides-Extra: signing-xmld
Provides-Extra: xmp-all
Provides-Extra: xmp-gif
Provides-Extra: xmp-jpeg
Provides-Extra: xmp-mp4
Provides-Extra: xmp-pdf
Provides-Extra: xmp-png
Provides-Extra: xmp-svg
Provides-Extra: xmp-tiff
Provides-Extra: xmp-webp
Requires-Dist: EmbedXMP
Requires-Dist: MediaSigner
Requires-Dist: swarmauri_base
Requires-Dist: swarmauri_core
Requires-Dist: swarmauri_keyprovider_inmemory ; extra == "full"
Requires-Dist: swarmauri_keyprovider_inmemory ; extra == "memory"
Requires-Dist: swarmauri_keyprovider_local ; extra == "full"
Requires-Dist: swarmauri_keyprovider_local ; extra == "local"
Requires-Dist: swarmauri_signing_cms ; extra == "full"
Requires-Dist: swarmauri_signing_cms ; extra == "signing-all"
Requires-Dist: swarmauri_signing_cms ; extra == "signing-cms"
Requires-Dist: swarmauri_signing_jws ; extra == "full"
Requires-Dist: swarmauri_signing_jws ; extra == "signing-all"
Requires-Dist: swarmauri_signing_jws ; extra == "signing-jws"
Requires-Dist: swarmauri_signing_openpgp ; extra == "full"
Requires-Dist: swarmauri_signing_openpgp ; extra == "signing-all"
Requires-Dist: swarmauri_signing_openpgp ; extra == "signing-openpgp"
Requires-Dist: swarmauri_signing_pdf ; extra == "full"
Requires-Dist: swarmauri_signing_pdf ; extra == "signing-all"
Requires-Dist: swarmauri_signing_pdf ; extra == "signing-pdf"
Requires-Dist: swarmauri_signing_xmld ; extra == "full"
Requires-Dist: swarmauri_signing_xmld ; extra == "signing-all"
Requires-Dist: swarmauri_signing_xmld ; extra == "signing-xmld"
Requires-Dist: swarmauri_xmp_gif ; extra == "full"
Requires-Dist: swarmauri_xmp_gif ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_gif ; extra == "xmp-gif"
Requires-Dist: swarmauri_xmp_jpeg ; extra == "full"
Requires-Dist: swarmauri_xmp_jpeg ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_jpeg ; extra == "xmp-jpeg"
Requires-Dist: swarmauri_xmp_mp4 ; extra == "full"
Requires-Dist: swarmauri_xmp_mp4 ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_mp4 ; extra == "xmp-mp4"
Requires-Dist: swarmauri_xmp_pdf ; extra == "full"
Requires-Dist: swarmauri_xmp_pdf ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_pdf ; extra == "xmp-pdf"
Requires-Dist: swarmauri_xmp_png ; extra == "full"
Requires-Dist: swarmauri_xmp_png ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_png ; extra == "xmp-png"
Requires-Dist: swarmauri_xmp_svg ; extra == "full"
Requires-Dist: swarmauri_xmp_svg ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_svg ; extra == "xmp-svg"
Requires-Dist: swarmauri_xmp_tiff ; extra == "full"
Requires-Dist: swarmauri_xmp_tiff ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_tiff ; extra == "xmp-tiff"
Requires-Dist: swarmauri_xmp_webp ; extra == "full"
Requires-Dist: swarmauri_xmp_webp ; extra == "xmp-all"
Requires-Dist: swarmauri_xmp_webp ; extra == "xmp-webp"
Project-URL: Changelog, https://github.com/swarmauri/swarmauri-sdk/releases
Project-URL: Documentation, https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/embedded_signer#readme
Project-URL: Discussions, https://github.com/orgs/swarmauri/discussions
Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
Project-URL: Issues, https://github.com/swarmauri/swarmauri-sdk/issues
Project-URL: Source, https://github.com/swarmauri/swarmauri-sdk/tree/main/pkgs/plugins/embedded_signer
Description-Content-Type: text/markdown

![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)

<p align="center">
    <a href="https://pepy.tech/project/EmbeddedSigner/">
        <img src="https://static.pepy.tech/badge/EmbeddedSigner/month" alt="PyPI - Downloads"/></a>
    <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/embedded_signer/">
        <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/embedded_signer.svg"/></a>
    <a href="https://pypi.org/project/EmbeddedSigner/">
        <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
    <a href="https://pypi.org/project/EmbeddedSigner/">
        <img src="https://img.shields.io/pypi/l/EmbeddedSigner" alt="PyPI - License"/></a>
    <a href="https://pypi.org/project/EmbeddedSigner/">
        <img src="https://img.shields.io/pypi/v/EmbeddedSigner?label=EmbeddedSigner&color=green" alt="PyPI - EmbeddedSigner"/></a>
    <a href="https://discord.gg/N4UpBuQv8T">
        <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>

# 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:

   ```bash
   uv pip install -e ".[dev]"
   ```

2. Format and lint code with `ruff`:

   ```bash
   uv run ruff format .
   uv run ruff check . --fix
   ```

3. Run the unit tests in isolation:

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

## Project Resources

- Source: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/embedded_signer>
- Documentation: <https://github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/plugins/embedded_signer#readme>
- Issues: <https://github.com/swarmauri/swarmauri-sdk/issues>
- Releases: <https://github.com/swarmauri/swarmauri-sdk/releases>
- Discussions: <https://github.com/orgs/swarmauri/discussions>

## License

EmbeddedSigner is released under the Apache 2.0 License. See the
[LICENSE](LICENSE) file for details.



