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.7

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.7
File Size Uploaded
c2pa_python-0.37.7.tar.gz 113.0 kB Details

Built distributions (wheels)

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

Total release size: 243.6 MB

Release files / c2pa_python-0.37.7.tar.gz

Download URL c2pa_python-0.37.7.tar.gz
Size 113.0 kB
Tags Source
SHA-256 checksum
How to use checksums
66114c3bc6b073249cb33043e491cf292e052ff770c1aefaed66a5ca2d8aaa0c
BLAKE2b-256 checksum
How to use checksums
5874291b19f26fe628ca6bf001be741dfe634f8689756cf8495499e02ab2f631
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-py3-none-win_arm64.whl
Size 83.9 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
a0980f7d94459a2569c0338af9cdd5b7301ded6578eab2701ed61f8590d3fca4
BLAKE2b-256 checksum
How to use checksums
be304e95f1a9be67bb66690cde0b6143f8761d294d67919cf99016850d7963d7
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-py3-none-win_amd64.whl
Size 86.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8054383a53d50dd86197f391bb2e91871284eaecf94410e6d3050803d02fd5e3
BLAKE2b-256 checksum
How to use checksums
3a0e86d47b5dba0a960bac3225e16f7aaa202ea894efed683801a9b99fc33092
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-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
36bb8eff8904869d8fdf00f6aabe7ba41389d3dbffba02bae324c690450019c2
BLAKE2b-256 checksum
How to use checksums
76c2983bcdc449e2c4384f0a7299859ec578365c54a2c3ca42030724ab21751e
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-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
c6b2e2b4cb7571e4b8ee76b6f9c472c44aa5650702207db06057d03a14ca2fd2
BLAKE2b-256 checksum
How to use checksums
dca69a4eafdcc836694542eaa3bade9e994248fa777ae4c0eac2bc4f1f199121
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-py3-none-macosx_11_0_arm64.whl
Size 13.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dae0e1177919a2b89b8d951d525421b35d67b21bc38049d544dbcfd881555a44
BLAKE2b-256 checksum
How to use checksums
c0c22c8a58a88488b30f9f96454eee26f815622cfca00b965d60b7a639c7d94d
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-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
d2ee0682f00c3a361d6401a6d2ae249bf953c2375c6945e5ebcf3cbd8022e8e4
BLAKE2b-256 checksum
How to use checksums
516950dea7bcbfd68ce7f6734735a1fb9e80ac15498520946a2ff1598d7fef5b
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 Aug 13, 2026.

Transparency log

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

Download URL c2pa_python-0.37.7-py3-none-macosx_10_9_universal2.whl
Size 16.2 MB
Tags Python 3 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
fde655c31e31015b1474a06f85728e878258e1fe7f2fff6cf4924e4985479da9
BLAKE2b-256 checksum
How to use checksums
cfeebe1b567bd85563ee72f7826df23c1fa13886f086b58714dda9bb2f9491a7
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 Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.37.8

8 release files

This release

0.37.7 This release

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