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.30.0.tar.gz (83.7 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.30.0-py3-none-win_amd64.whl (92.0 MB view details)

Uploaded Python 3Windows x86-64

c2pa_python-0.30.0-py3-none-manylinux_2_28_x86_64.whl (16.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.30.0-py3-none-manylinux_2_28_aarch64.whl (15.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.30.0-py3-none-macosx_11_0_arm64.whl (15.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.30.0-py3-none-macosx_10_9_x86_64.whl (15.8 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.30.0-py3-none-macosx_10_9_universal2.whl (16.2 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.30.0.tar.gz
  • Upload date:
  • Size: 83.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.30.0.tar.gz
Algorithm Hash digest
SHA256 8beba2f78d7d7698c77bc363d1d33b429e8547a1ae50d40764c1fb9b1873e429
MD5 9d0252233e210513700f75ade5e742a1
BLAKE2b-256 cc031afc531ae06e93c6932dec3b4092c95e6abbd03e156f74edb4c2fb2f35e0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.30.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 92.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.30.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ebe6cefd26ef9cc1f67cf86c2aafa7770ebb8bfbc3c7261d9a1d35c28896a1d4
MD5 1838eb60de40b80354b0492e59b8eb9a
BLAKE2b-256 ad0b3f920e5afb94d10a9c6131383722dc9d729d013ba0b98345d57e6c7a89eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.30.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a9bce29b44fb589fb0c72b836d1989d498bdd43d7d730505f93e009f062f5e0a
MD5 21887d5870fda0f798f985944ffdeb4d
BLAKE2b-256 4b0a9501bf13c447ef88cc079b5ec4835c7a68bf3ecdb114c7d45b1f2a6d5e66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.30.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 90bec2ce638d8c44926e3d169588db9b633b4650b4fb4ac8646ef335c34a2d5c
MD5 ee845a7e8832fa6ccee1689f05fe7cc7
BLAKE2b-256 af40e67f1becea296d48664eeec431474527386452264ca24c249eeadddd6e73

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.30.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1a1a9a92d115d4f2f06553358732cd98cbccb48ab4b07bf1368bd464b8c1679
MD5 5cd8707caac6c47a64372a272aea0a65
BLAKE2b-256 23366b22aa7343fcabeec015f600e61f36e097c888275160ebfe3647361ea255

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.30.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 12e322e7425c325860941d55f36d07844cb8decadc0f18015823742e2a9a003a
MD5 ce7e359892e93fcfa99cd76cb6bc1062
BLAKE2b-256 66800000be9aad70df4f7b81e6f47f2a4fe669a034d68766db3fd0bae13405c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.30.0-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c335c89a800e31302460cd1bb1538ed6dcff41605440202bbfdb4c5d985e4108
MD5 9df9f695bc85fb2b02c679410e40de5a
BLAKE2b-256 a9df9cf8c4a9272a30eea5316e6b947d7125ddcdfb4af4dc2d1ef4cc64825ef8

See more details on using hashes here.

Provenance

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