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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.5-py3-none-manylinux_2_28_x86_64.whl (16.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.32.5-py3-none-manylinux_2_28_aarch64.whl (15.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.32.5-py3-none-macosx_11_0_arm64.whl (15.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.5-py3-none-macosx_10_9_x86_64.whl (16.3 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.5-py3-none-macosx_10_9_universal2.whl (17.3 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.32.5.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.5.tar.gz
Algorithm Hash digest
SHA256 6680c705432bba32dac3c342193e3dcba33cc124bdab56695845034a44a50490
MD5 a6a02a65fd2ff2f346d6c81187045ab6
BLAKE2b-256 2698b872fefe94581b8cc3388fbaca8f61ea17c3971ad5c06ca2101a67c0285d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 94.2 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.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 406e62bb331617a48aa446f4d4f539528e8acd3de449ffc6b51e72299ec5ae04
MD5 c94a3c08cadf9b9582e3c3d87878d456
BLAKE2b-256 36a02404593dc5218d6e4e6c7813f925d1099b3947316515e71ed2c070e4f7da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ae943acd37b3be663c53861552c76e3780b4370f5c9f771f1ae240f91e7fda7
MD5 3d14f2839c854ef7a0c9f839b392e906
BLAKE2b-256 e342f08b0b9a7ccfb517c82db33eb3f1a29bed40ecbcb79284259fd3d4018362

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b4c4002496fb8518ad9dfaa069d7a2117e30f10a36d9b87ea67628edc4c59385
MD5 0ae68efff0220983a847e45fade31aee
BLAKE2b-256 40ca039caec553f1fae1007f3060f185c3b18d38e7fc558ef4b6f17d7b111580

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a33d9e029c3889d794ea938466de2a295f08be718184e19eaa468c8fc332ab89
MD5 4e0581e3f56086120809fa559eababd5
BLAKE2b-256 ea1571bab441ce665d99a4e38bab21b20bf769c20e6a49c28f270888b25ab705

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.5-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a452d9937b6effaa3db95ca13b258bf9cbc411b2220e99fc12a8e10f2faa42c1
MD5 3c7c315ea975523ac575b768add94ecd
BLAKE2b-256 bdadcae3f6375431a43033673430e05855f098e21b28c64d14460c1992701634

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.5-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d1c35fd7e39468cd5a3e9db655d56bad552372b06240aba9e8ba944085ebf852
MD5 cc11971ab2e43d4866cc0e25ef1ee2e6
BLAKE2b-256 828c39b3b7d081ec29b7d04aafa8f782a776a6b9020e57e6e639a4205e171d1e

See more details on using hashes here.

Provenance

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