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

API documentation is published at github.io/c2pa-python/api/c2pa.

Use the documentation version dropdown to choose a published release. The versions are selected in api-docs/versions.json; the first entry is the default at the existing documentation URL. Publishing a stable GitHub release automatically adds its tag as the default while retaining older versions.

To build documentation locally, see 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.

Metadata

Release files for c2pa-python 0.39.0

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.39.0
File Size Uploaded Provenance Actions
c2pa_python-0.39.0.tar.gz 141.3 kB With provenance Details for c2pa_python-0.39.0.tar.gz

Built distributions (wheels)

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

Total release size: 69.2 MB

Release files / c2pa_python-0.39.0.tar.gz

Download URL c2pa_python-0.39.0.tar.gz
Size 141.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8876a953fd0850b3333b1e668b309b780078c8b622743edd6c1b1a258e5a9886
BLAKE2b-256 checksum
How to use checksums
ac0af63310a1607de7b5155c1e52d2843b28fe28d5587b6efdde5efd0849ef15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL c2pa_python-0.39.0-py3-none-win_arm64.whl
Size 8.4 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
feb8e38d4147e102daf8cb08cc374ea182bee72a87c77b885a6db14a7415ca8f
BLAKE2b-256 checksum
How to use checksums
dcb70fb185a3da94589efe2250a726d1818ac945cff7f1ee27af66e068b2aa79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL c2pa_python-0.39.0-py3-none-win_amd64.whl
Size 9.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2f6f888afcd30c2303ec8d25406d3135e17900e809e7c825c50e270c6c475ce2
BLAKE2b-256 checksum
How to use checksums
e174b2db2251cf3f33570a9ddbd7112a821d8ce8bcf22bbc1bc57784c3d2b9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

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

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 Nov 12, 2026.

Transparency log

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

Download URL c2pa_python-0.39.0-py3-none-manylinux_2_28_aarch64.whl
Size 8.5 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4d07cd700b43589637eade7835cca1346ae16769910bbc638a3a59feb28f5815
BLAKE2b-256 checksum
How to use checksums
ca78a4aae516185d0f75661e7954f1f30ffe6c8ec24fa529f20810b762f7356a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL c2pa_python-0.39.0-py3-none-macosx_11_0_arm64.whl
Size 8.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aecb8093b4d3095f67d42d2f8c30874160d1259afad28ab6313e9a443c3ff03e
BLAKE2b-256 checksum
How to use checksums
f066acffa3bb6717c3bb160f04cf5a1b67b071533e1570f57adfd05a5b537910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

Download URL c2pa_python-0.39.0-py3-none-macosx_10_9_x86_64.whl
Size 8.7 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ca17147e208724713dc844305f1cdfc43e160a70671277bceefdb2799e533372
BLAKE2b-256 checksum
How to use checksums
33ad9faa2d14138e14d7939bd04b71aa352571f0f1ebfc25a25a19bf3568cfb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

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

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

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 Nov 12, 2026.

Transparency log

Security for c2pa-python 0.39.0

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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for c2pa_python-0.39.0.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.39.0 This release

8 release files Full provenance

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