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.11.tar.gz (83.8 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.11-py3-none-win_amd64.whl (89.8 MB view details)

Uploaded Python 3Windows x86-64

c2pa_python-0.32.11-py3-none-manylinux_2_28_x86_64.whl (15.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.32.11-py3-none-manylinux_2_28_aarch64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.32.11-py3-none-macosx_11_0_arm64.whl (14.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.11-py3-none-macosx_10_9_x86_64.whl (15.0 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.11-py3-none-macosx_10_9_universal2.whl (16.5 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.32.11.tar.gz
  • Upload date:
  • Size: 83.8 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.11.tar.gz
Algorithm Hash digest
SHA256 e81f7339c90314cfdf86efee322582cdf53898e20ecc6993ca997efbfb53d583
MD5 d8ed535f0e0c1b7ff55e2b1179abbe8c
BLAKE2b-256 05c58729ccdb7090206fc36977fba79304494398639b58c18c63f60dff4633d7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0f2cfb670a1f09c3cbe21596f10dc7cbcf96df7466c04aaf73e76846bc8cf424
MD5 fe545999db62c138ea9247f499199d74
BLAKE2b-256 71a4824835a595eab5fe9be07e6bd624ebb40b09f7fb329e510f44fb151a4fcb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e6e1f44c2679a816bf4119b32cf218edcbc587fe877fcef781ac92acff236e6e
MD5 6256629ebaf4c5c0408581dba73abc4b
BLAKE2b-256 d84386c9e0cf6372756bfed291630695a6efa76bb272b75ca9c894f464b43786

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 15c068bc20d57438f39399a68dd8774b9dc104448d8e373073b74fe6cb7dffc4
MD5 caae8b0b014ec27f9f7b7f23575d71d4
BLAKE2b-256 7bd4293588004d45b85d7a5f9cc08779fecb43c212a6c1a556475bb446dd9665

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04276c954ef9710120a23acb6825a55f93e755452763c08bdef676ad9131ceaf
MD5 2a04f1a590d321ba88eb816befcd9cbc
BLAKE2b-256 ec6dc305feb97e31663ce1bab44ab0d2952c51623e0d971a515a8ee14a147574

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f7d3c145ea30bf10ff1f6328851b041458f4ef423fec0795e74dae788fa30b1f
MD5 2fddd652d2073532a5f7102a4fcf62f4
BLAKE2b-256 432c3b7551e607293e9fcda26bec09d9da73fd19bdd8b02d79373aabd295c796

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.11-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ec904c227e457bf7d124af79b89017713690586d084069000893b370da5552f7
MD5 66bfc4c78485de655451d588e3441635
BLAKE2b-256 a7a6af57602355ef599d502680039486347ca9e2bfe3580d2c8cc4dc3d883225

See more details on using hashes here.

Provenance

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