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.1.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.1-py3-none-win_amd64.whl (95.3 MB view details)

Uploaded Python 3Windows x86-64

c2pa_python-0.32.1-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.1-py3-none-manylinux_2_28_aarch64.whl (16.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for c2pa_python-0.32.1.tar.gz
Algorithm Hash digest
SHA256 e7db4be6df2720d1ed8efc29097e7c37caba02c6b9d58b860b710fa6134d723f
MD5 2d3dd3f07728313e75472829acc561ec
BLAKE2b-256 4979e2ff37b30e6432ca580eb16a3c4821d42fc56ba532c79a93a8be5724d280

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1.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.1-py3-none-win_amd64.whl.

File metadata

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

File hashes

Hashes for c2pa_python-0.32.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 97651bb62db9fe50aa4ac8ac5953b9125bd25ee2379fe1ecd7abf25cce565771
MD5 70c78f15851f93d2cbf3713c52e0156b
BLAKE2b-256 3e791f9dd83f78944a97f80571f5d571ec38ab389c9d0312bf20c3e89fe37faf

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 774d88093114842d552eeafddf9e5c5d28baab38526ae1687398e333e3ec6481
MD5 1bad9a17bd7c7e49798277ee75165362
BLAKE2b-256 a59e9c6a2ad69b11a56dec229787d93ff3fb1a73b9f870eccd57fd5e10fac3ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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.1-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 569ce6988063baa64bb17338dc92ee8058b021c69c3b57af1f7058b351b85052
MD5 c4994a4f70546e0beff0e67222151539
BLAKE2b-256 5a12b7bba585b4a6b725479e063fd24767b5680a876d09aea41c255b7f0ceb03

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fc60221fe971b1c8d4b9599b70a772dbe40ceb4d66ecdb3121b9815cf708326
MD5 9f3bb179a6136320a986a6f234eb98cd
BLAKE2b-256 1506c09a6efbe030e411e14f2a0eb08345bfc5322ad832b45bc9728f5db72b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2209e0c7c34ed6edb87ca12fbe69d2a481ced3adf3e801a10e1103e50accc141
MD5 1ce36b6876b536c2bfb32e9e13ebbcbe
BLAKE2b-256 34a705539e118b82971501c22fd15f23fba8c8f27d816c3b0d4eac6cd5ecfdbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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.1-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for c2pa_python-0.32.1-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ef6d34c885a8f026fe51d162bcbf579048ecdb450d1b78073842386c60712b98
MD5 9147f1340be62f0f06a9b843600068ab
BLAKE2b-256 b589b8b02f304cbf30beb08ae15c5086e194d3ee246355cf7ceb09cce609bf5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for c2pa_python-0.32.1-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