Skip to main content

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

Building from local c2pa-rs sources

Using a virtual environment with local builds

The make targets honor an active virtualenv. Create a virtual environment ./.venv and activate it before running them so commands use the project interpreter rather than the global Python interpreter:

make create-venv && source .venv/bin/activate

Build steps

By default the build downloads a prebuilt native library from a c2pa-rs release. To test the Python bindings against a local, unreleased c2pa-rs checkout, you can instead build the native library from source.

Prerequisites:

Point C2PA_RS_PATH at your c2pa-rs checkout and run the build-from-source target:

export C2PA_RS_PATH=/path/to/c2pa-rs
make build-from-source C2PA_RS_PATH=$C2PA_RS_PATH

This does a clean build of the c2pa-c-ffi crate (with the file_io feature, which the Python wrapper requires), stages the resulting library under both artifacts/ and src/c2pa/libs/, and installs the package in editable mode, replacing any prebuilt artifacts from make download-native-artifacts. By default, the build uses the release profile; to build the debug profile instead, pass EXTRA_BUILD_ARGS="--debug":

make build-from-source C2PA_RS_PATH=$C2PA_RS_PATH EXTRA_BUILD_ARGS="--debug"

Note on targets for macOS

On macOS this produces a universal (arm64+x86_64) library by default, which requires both Rust targets:

rustup target add aarch64-apple-darwin x86_64-apple-darwin

To build a single-architecture library instead, set C2PA_LIBS_PLATFORM to a specific platform (for example aarch64-apple-darwin).

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.

Release files for c2pa-python 0.37.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for c2pa-python 0.37.9
File Size Uploaded
c2pa_python-0.37.9.tar.gz 113.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for c2pa-python 0.37.9
File
c2pa_python-0.37.9-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
c2pa_python-0.37.9-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
c2pa_python-0.37.9-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
c2pa_python-0.37.9-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
c2pa_python-0.37.9-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
c2pa_python-0.37.9-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details
c2pa_python-0.37.9-py3-none-macosx_10_9_universal2.whl Python 3 none macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 243.5 MB

Release files / c2pa_python-0.37.9.tar.gz

Download URL c2pa_python-0.37.9.tar.gz
Size 113.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f2a89b04fe05d6a274f7ad4e27ba2ffd4a94f10ececea6d0fe471bfb18976dc
BLAKE2b-256 checksum
How to use checksums
a9eb4a4dc35535a059bed9c888a8a747265cd11810a2fed3a65adc7608754a5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-win_arm64.whl

Download URL c2pa_python-0.37.9-py3-none-win_arm64.whl
Size 83.9 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
01a9d4b8df8d5190cbd566245528a3023cab6e19798ddfe2a934d0faf572962d
BLAKE2b-256 checksum
How to use checksums
1a3d26b24770758a9b475e9decf550198bb27875a8f54841471752dd6c8ecae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-win_amd64.whl

Download URL c2pa_python-0.37.9-py3-none-win_amd64.whl
Size 86.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c68fa9eaf02cfedcb2801dd7c7bd40caad4bd8f58a47d1906243591878964f66
BLAKE2b-256 checksum
How to use checksums
820e288784b6f6fb1872ced97c666c8891cc3679046f8ce16014098da3baddaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-manylinux_2_28_x86_64.whl

Download URL c2pa_python-0.37.9-py3-none-manylinux_2_28_x86_64.whl
Size 14.7 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e62f85575b9b0fdb2b076554c8015091ce847f6e8200ae4c86ce6d7a5cda0bf6
BLAKE2b-256 checksum
How to use checksums
abfa463cef71cdbe0e869d5f4b9acf76e88950988ef014cb69897bc4c6fd3321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-manylinux_2_28_aarch64.whl

Download URL c2pa_python-0.37.9-py3-none-manylinux_2_28_aarch64.whl
Size 14.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
80d77bbf2ac3d9def936881ebe1b1b9f4876dcb2a423e4b26d6be1bb9fbbd67f
BLAKE2b-256 checksum
How to use checksums
f1f9543dd6e2c8eca854748fa9ac2e2750083a73f95782b6ad7a54079e33e127
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-macosx_11_0_arm64.whl

Download URL c2pa_python-0.37.9-py3-none-macosx_11_0_arm64.whl
Size 13.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cf0a1143c5ad969b9699471a5135e4902f85847d5f6fa1248dc47a9278b66636
BLAKE2b-256 checksum
How to use checksums
37c2aabf506904c73d7b8543bf8770acd7bdd331cbbafcc2cc4eae11383b98f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-macosx_10_9_x86_64.whl

Download URL c2pa_python-0.37.9-py3-none-macosx_10_9_x86_64.whl
Size 14.2 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
0e918fdabc591b709e265d8841e18b60870187f195352a32a39b5a6f7c5cb7f9
BLAKE2b-256 checksum
How to use checksums
28161fbea8b2578ce7a6a75aa1124206fe3c0e3d7252a299f8d9639f0c156e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / c2pa_python-0.37.9-py3-none-macosx_10_9_universal2.whl

Download URL c2pa_python-0.37.9-py3-none-macosx_10_9_universal2.whl
Size 16.1 MB
Tags Python 3 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
7cfc09018f467357f5b85af81bc57e84ff7417cdc5b10791d1eecbcf8c537326
BLAKE2b-256 checksum
How to use checksums
ab021977ee7634eac3c2d771e8b29b56c4bbe0de13243f2621c6ee8fd03cac7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.37.9 This release

8 release files

0.37.8

8 release files

0.37.7

8 release files

0.37.6

8 release files

0.37.2

8 release files

0.37.1

8 release files

0.37.0

8 release files

0.36.0

8 release files

0.35.2

8 release files

0.35.1

8 release files

0.35.0

8 release files

0.34.0

8 release files

0.32.9

7 release files

0.32.8

7 release files

0.32.7

7 release files

0.32.4

7 release files

0.32.3

7 release files

0.30.0

7 release files

0.29.0

7 release files

0.28.0

7 release files

0.27.1

7 release files

0.27.0

7 release files

0.23.1

7 release files

0.23.0

7 release files

0.22.0

7 release files

0.21.0

7 release files

0.18.0

5 release files

0.17.0

5 release files

0.16.0

5 release files

0.15.0

5 release files

0.14.0

5 release files

0.13.0

5 release files

0.12.1

5 release files

0.12.0

5 release files

0.11.1

5 release files

0.11.0

5 release files

0.10.0

4 release files

0.9.0

6 release files

0.8.3

1 release file

0.8.0

6 release files

0.6.1

7 release files

0.6.0

7 release files

0.5.3

7 release files

0.5.2

7 release files

0.5.1

7 release files

0.5.0

7 release files

0.4.0

7 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page