Skip to main content

Python bindings for the C2PA Content Authenticity Initiative (CAI) library

Project description

C2PA Python library

The c2pa-python repository provides a Python library that can:

  • Read and validate C2PA manifest data from media files in supported formats.
  • Create and sign manifest data, and attach it to media files in supported formats.

Features:

  • Create and sign C2PA manifests using various signing algorithms.
  • Verify C2PA manifests and extract metadata.
  • Add assertions and ingredients to assets.
  • Examples and unit tests to demonstrate usage.

Prerequisites

This library requires Python version 3.10+.

Package installation

Install the c2pa-python package from PyPI by running:

pip install c2pa-python

To use the module in Python code, import the module like this:

import c2pa

Examples

See the examples directory for some helpful examples:

  • examples/read.py shows how to read and verify an asset with a C2PA manifest.
  • examples/sign.py shows how to sign and verify an asset with a C2PA manifest.
  • examples/training.py demonstrates how to add a "Do Not Train" assertion to an asset and verify it.

API reference documentation

Documentation is published at github.io/c2pa-python/api/c2pa.

To build documentation locally, refer to this section in Contributing to the project.

Contributing

Contributions are welcome! For more information, see Contributing to the project.

License

This project is licensed under the Apache License 2.0 and the MIT License. See the LICENSE-MIT and LICENSE-APACHE files 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

c2pa_python-0.32.0.tar.gz (83.6 kB view details)

Uploaded Source

Built Distributions

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

c2pa_python-0.32.0-py3-none-win_amd64.whl (95.4 MB view details)

Uploaded Python 3Windows x86-64

c2pa_python-0.32.0-py3-none-manylinux_2_28_x86_64.whl (16.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.32.0-py3-none-manylinux_2_28_aarch64.whl (16.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.32.0-py3-none-macosx_11_0_arm64.whl (15.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.0-py3-none-macosx_10_9_x86_64.whl (16.4 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.0-py3-none-macosx_10_9_universal2.whl (17.4 MB view details)

Uploaded Python 3macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file c2pa_python-0.32.0.tar.gz.

File metadata

  • Download URL: c2pa_python-0.32.0.tar.gz
  • Upload date:
  • Size: 83.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.32.0.tar.gz
Algorithm Hash digest
SHA256 43bf1afeb11e9a1635c78a7a89a77a9e333149f58e0a3d80dbb0f3f433c5bb38
MD5 493a32ffc6b1e1fc2d93d47368030451
BLAKE2b-256 129731bd2089109b8228e649b92003363b6821f462eb7bbb78165aaa2a67e4e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0.tar.gz:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: c2pa_python-0.32.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 95.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.32.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2cf3b49a6f54992e10f05f2a916467080680413d86f3e7e0708469eb1f409912
MD5 7221ff4d0c08ecc9027b6d3f8b44a01e
BLAKE2b-256 c913f91315631177fad0965e182b1eac73653e54138f5284e83b21e33d08676f

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-win_amd64.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c807b7b5cef3f60d333c17223b4a0b50c4093307462532fa881bef9bb55730ed
MD5 29006208790df24e946d4b6b7f3e19d8
BLAKE2b-256 aacac900a942f84dbcad35554b6988e311b16eff352bb8b53931f66ce7b996ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4650c38615e4bc7410d521e1fb92c3442e0cf2ad590ef24c464a6f6565a32962
MD5 72f50cf6a2a829b24c08176b85b589a1
BLAKE2b-256 131b5251fc549446e8cbbf0b5495654fab7c520875d082f65f1655e9f92e1e82

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-manylinux_2_28_aarch64.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ad0669b186da509a515ae9f8051bd9c2563ecc1c2603f5ed9baff8ff7fc0f74
MD5 aafac0f3bfddbd2693a947f0109f681c
BLAKE2b-256 381d2da4fd65f0444d7ec339c320ac1a8b330c2131472a83343dfe72b58104ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4a88792c548a5c0ea29adb3e3d36c45e067d3dc53eb7f79c51ac76574b50e540
MD5 be99942f2707b39b6277e9d7014eb5ce
BLAKE2b-256 0f6139c59bb8209cec8c3f8145fab46a6a7b0913dcf7505864d746bb13ca7697

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-macosx_10_9_x86_64.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file c2pa_python-0.32.0-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.0-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bfe9a587ddb45f946df99439f5076841e45b63eda304b30abae92ea4a9c20e39
MD5 beff929a2101c3531529046f5be57b8e
BLAKE2b-256 d27055091b79414a3778417cfae399f569073810af79fe80946b2762d6ae8305

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.0-py3-none-macosx_10_9_universal2.whl:

Publisher: build.yml on contentauth/c2pa-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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