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.
For the best experience, read the docs on the CAI Open Source SDK documentation website.
If you want to view the documentation in GitHub, see:
- Using the Python library
- Supported formats
- Configuring the SDK using
ContextandSettings - Using Builder intents to ensure spec-compliant manifests
- Using working stores and archvies
- Selectively constructing manifests by filtering actions and ingredients
- Diagram of public classes in the Python library and their relationships
- Release notes
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.pyshows how to read and verify an asset with a C2PA manifest.examples/sign.pyshows how to sign and verify an asset with a C2PA manifest.examples/training.pydemonstrates 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7db4be6df2720d1ed8efc29097e7c37caba02c6b9d58b860b710fa6134d723f
|
|
| MD5 |
2d3dd3f07728313e75472829acc561ec
|
|
| BLAKE2b-256 |
4979e2ff37b30e6432ca580eb16a3c4821d42fc56ba532c79a93a8be5724d280
|
Provenance
The following attestation bundles were made for c2pa_python-0.32.1.tar.gz:
Publisher:
build.yml on contentauth/c2pa-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1.tar.gz -
Subject digest:
e7db4be6df2720d1ed8efc29097e7c37caba02c6b9d58b860b710fa6134d723f - Sigstore transparency entry: 1258207057
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97651bb62db9fe50aa4ac8ac5953b9125bd25ee2379fe1ecd7abf25cce565771
|
|
| MD5 |
70c78f15851f93d2cbf3713c52e0156b
|
|
| BLAKE2b-256 |
3e791f9dd83f78944a97f80571f5d571ec38ab389c9d0312bf20c3e89fe37faf
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-win_amd64.whl -
Subject digest:
97651bb62db9fe50aa4ac8ac5953b9125bd25ee2379fe1ecd7abf25cce565771 - Sigstore transparency entry: 1258207151
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file c2pa_python-0.32.1-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: c2pa_python-0.32.1-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 16.9 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
774d88093114842d552eeafddf9e5c5d28baab38526ae1687398e333e3ec6481
|
|
| MD5 |
1bad9a17bd7c7e49798277ee75165362
|
|
| BLAKE2b-256 |
a59e9c6a2ad69b11a56dec229787d93ff3fb1a73b9f870eccd57fd5e10fac3ce
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-manylinux_2_28_x86_64.whl -
Subject digest:
774d88093114842d552eeafddf9e5c5d28baab38526ae1687398e333e3ec6481 - Sigstore transparency entry: 1258207108
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file c2pa_python-0.32.1-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: c2pa_python-0.32.1-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 16.0 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569ce6988063baa64bb17338dc92ee8058b021c69c3b57af1f7058b351b85052
|
|
| MD5 |
c4994a4f70546e0beff0e67222151539
|
|
| BLAKE2b-256 |
5a12b7bba585b4a6b725479e063fd24767b5680a876d09aea41c255b7f0ceb03
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-manylinux_2_28_aarch64.whl -
Subject digest:
569ce6988063baa64bb17338dc92ee8058b021c69c3b57af1f7058b351b85052 - Sigstore transparency entry: 1258207129
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file c2pa_python-0.32.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: c2pa_python-0.32.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 15.9 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc60221fe971b1c8d4b9599b70a772dbe40ceb4d66ecdb3121b9815cf708326
|
|
| MD5 |
9f3bb179a6136320a986a6f234eb98cd
|
|
| BLAKE2b-256 |
1506c09a6efbe030e411e14f2a0eb08345bfc5322ad832b45bc9728f5db72b22
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-macosx_11_0_arm64.whl -
Subject digest:
3fc60221fe971b1c8d4b9599b70a772dbe40ceb4d66ecdb3121b9815cf708326 - Sigstore transparency entry: 1258207118
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file c2pa_python-0.32.1-py3-none-macosx_10_9_x86_64.whl.
File metadata
- Download URL: c2pa_python-0.32.1-py3-none-macosx_10_9_x86_64.whl
- Upload date:
- Size: 16.4 MB
- Tags: Python 3, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2209e0c7c34ed6edb87ca12fbe69d2a481ced3adf3e801a10e1103e50accc141
|
|
| MD5 |
1ce36b6876b536c2bfb32e9e13ebbcbe
|
|
| BLAKE2b-256 |
34a705539e118b82971501c22fd15f23fba8c8f27d816c3b0d4eac6cd5ecfdbd
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-macosx_10_9_x86_64.whl -
Subject digest:
2209e0c7c34ed6edb87ca12fbe69d2a481ced3adf3e801a10e1103e50accc141 - Sigstore transparency entry: 1258207096
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file c2pa_python-0.32.1-py3-none-macosx_10_9_universal2.whl.
File metadata
- Download URL: c2pa_python-0.32.1-py3-none-macosx_10_9_universal2.whl
- Upload date:
- Size: 17.4 MB
- Tags: Python 3, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef6d34c885a8f026fe51d162bcbf579048ecdb450d1b78073842386c60712b98
|
|
| MD5 |
9147f1340be62f0f06a9b843600068ab
|
|
| BLAKE2b-256 |
b589b8b02f304cbf30beb08ae15c5086e194d3ee246355cf7ceb09cce609bf5a
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
c2pa_python-0.32.1-py3-none-macosx_10_9_universal2.whl -
Subject digest:
ef6d34c885a8f026fe51d162bcbf579048ecdb450d1b78073842386c60712b98 - Sigstore transparency entry: 1258207078
- Sigstore integration time:
-
Permalink:
contentauth/c2pa-python@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Branch / Tag:
refs/tags/v0.32.1 - Owner: https://github.com/contentauth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@a68d2014b8e12f80a9caa1329eb24ac7babefcd5 -
Trigger Event:
push
-
Statement type: