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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.2-py3-none-manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.32.2-py3-none-manylinux_2_28_aarch64.whl (16.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.32.2-py3-none-macosx_11_0_arm64.whl (15.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.2-py3-none-macosx_10_9_x86_64.whl (16.4 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.2-py3-none-macosx_10_9_universal2.whl (17.4 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.32.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e50d7c07ebe30dffa6f466e6596e34bafaab14489fb4aac04f647edab249b3ce
MD5 3274ae07cdb56bd02bb7c97b7d3f6984
BLAKE2b-256 4fac799d5324c1540045d12f0ce698284e68188f5dd4ddead30bc98b8f691193

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.2-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

Hashes for c2pa_python-0.32.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9153bed3ead7ca32b6856b6e767eb526a783ff12207189ae265ea1da7c2c2797
MD5 829fbc78e1eb2aadfcad334edb3d4bbf
BLAKE2b-256 18a1f6408e796be1fc6d29417f02f12648d2b530f6bde3e0b7375756c92f5240

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 33d3dc9d05b91f1c03e04edfadd9fd943d3a0f39a7a9dbe53bd112d66838f585
MD5 561964ce885d7588353ef5c57c6cfd7e
BLAKE2b-256 03b8649274fcae70a26e811d5152eed957fb16451f5a08986ca6c1771124ee97

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ffbf49f4e9a3850f6a91e6aa9d168625b033c07c2d74482470053f760bc315d6
MD5 89b15aad94872763b88a7ad8410872b2
BLAKE2b-256 d017d9088c99220e9402e3b39d14da8ba9d557f2096002db84459ee03c6281cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1c7c17117d106cc60d1982164609749d9c03766adccd41ab52f9edcaa65e673
MD5 54b4689281f511fa2c284de9acc6c308
BLAKE2b-256 d32abfce2202468d9411e3de3415e87889963e6b6a72721914f14c6b5d439c34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.2-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8438b74ab0bba4b2afcce05c456d01b4d2f610aa72fe44033d4aaf4dc71594ce
MD5 d8f079ae81dd0f286c6a79206b503eee
BLAKE2b-256 caaf3dff7aa1229d0d8617d8ff20556fd26ab5cab9300282b063d40b5165e332

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.2-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f78888ef4c21630e74a3582136993cbcb0957b66d5692d23646e654b125a70be
MD5 8e6930226d24c9409969a55d9152029a
BLAKE2b-256 737d08d4fb5076f5f6cdd8604a980a6233b6bc64c19352cd9f4426ebe832b73c

See more details on using hashes here.

Provenance

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