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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.8-py3-none-manylinux_2_28_x86_64.whl (15.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.32.8-py3-none-manylinux_2_28_aarch64.whl (14.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.32.8-py3-none-macosx_11_0_arm64.whl (14.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.8-py3-none-macosx_10_9_x86_64.whl (15.3 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.8-py3-none-macosx_10_9_universal2.whl (16.6 MB view details)

Uploaded Python 3macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file c2pa_python-0.32.8.tar.gz.

File metadata

  • Download URL: c2pa_python-0.32.8.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.8.tar.gz
Algorithm Hash digest
SHA256 b3b8a47ee5a4e522220c1ca7048ad89a861a8836bb0688d9a8033edda1031b13
MD5 12304d29916971f7e678a4847d86c823
BLAKE2b-256 86300e643ac3d7ae4739df5f5aee012c8e97f8ffbc49d32f9cb0481c08434c90

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.8-py3-none-win_amd64.whl
  • Upload date:
  • Size: 90.1 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.8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 24341f704ae2d555bb138d27a4b203db2d2ac651187f9c87bfd4392d102991d6
MD5 2904359f2c7781953cccdf0c38477aec
BLAKE2b-256 5742e519dc95de4b90992d336b5b5a8f8dc708cb3f1c6918ac2904d3c0b600e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.8-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0caf8c4870cc1dd5b86b08c51aa4e6a51551bc6064a6548cad330ed4e2f0053a
MD5 ee70fe7d392723f6b284df62ac7f3518
BLAKE2b-256 25bf74798980589a305f0820b3acce2f2debb3a9252e276b2fb4386d2c9042fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.8-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 45361638e60976d8c66eab4c0809ea2ce2dfe2b3274910384c779486b971df4a
MD5 7289711a7ab69cc4c91d366927b5555c
BLAKE2b-256 ceabf290ff1497640ccaf5b6bfe3da0ed9436c81342a36624f53a36d42dee9c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.8-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6885607b426edc368a052515d95cfab742cbf9260ae8163a3625ec8374edaac7
MD5 ed932a129c261435df1a5b4c033e8e37
BLAKE2b-256 8a44599f33f4d0fa95e3d02eca5deb76ce68a4269913c6b2ab0b6cdd09ab3fa4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.8-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7304f5dfa83067cf78be1518e7875dd149b11591f84e00c7a00f77b634487ade
MD5 be7b6d111dcc246851c28fc25f1fd69f
BLAKE2b-256 44dce3ef63b6438aa30168b0de0f3c5c5b16f9dc02fd911b5e7798c5a601c146

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.8-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c17fb671f8d41e6fd700e3dbf8871c20dbe55cc934d32cdaf93198cfa15d9604
MD5 c33fc587d9322fd618c3f7bad3cde3d7
BLAKE2b-256 1b3d4763ce7ce3c61c9ba816cf2c9ae0f99903ea23193ad007045be388a5a6d9

See more details on using hashes here.

Provenance

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