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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.12-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.12-py3-none-manylinux_2_28_aarch64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.12-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.12.tar.gz.

File metadata

  • Download URL: c2pa_python-0.32.12.tar.gz
  • Upload date:
  • Size: 84.0 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.12.tar.gz
Algorithm Hash digest
SHA256 643f3aabaebf0aea5f5456824893b6abed8c1a6360d8e615649c795990f1b081
MD5 70695b722f94a265d3814d2b79bcbd16
BLAKE2b-256 df7285a917943aecfdecb73abaaa7dc3404898ad980bdebf3e8141549e763d74

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6ed4e406d8e5ea119c279e2203535d3cdf8aff8d4e4bcd3ad5b162eacf8be4da
MD5 1bdc1dbb96cf1e06d9c75fe4cade2215
BLAKE2b-256 e2a7cb58265c8b2a8357c39af83551b11bcc80fce9841638ee859a1954f86887

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a8f4bcffa2c6f41a06e44589b6f901871e457540806a559d45a9c1ffc8e93f9
MD5 c881a916ab59bc4c0cc2b7a49ea2cffb
BLAKE2b-256 2a74bb5ea783f2b99531100148a6e1c399b6760ec57974dee5d9ef2afd299372

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 baee35779d42de28cef3d82ea6b97db7a96eca1ab11f37153d1d46260773ca4a
MD5 068cbbcc05f45cd753a281f2f9da0e8e
BLAKE2b-256 de9dc2979d5b1ed64a6ee36d3a3c2b04f089aba668be03a0297d32df8ee55ebb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b1162829c31e8abcb05cdcd8276b445698510cc145ff0f3d5ac71b6ca92a868
MD5 fc22ff2e1259b7f05edff7f2be092829
BLAKE2b-256 b4c9da4e78cf600ac82d9a56ae8f42cdf680b179f9d52009a446b274134f6190

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d4ddf78bd6b82850264083835b77582d9867591fdd6ac87945ad6c117fca1248
MD5 6c1ec399638a3f18b1753008c20fb622
BLAKE2b-256 acd5751e79549921d3d6d27decdc44cb4fd9816b2304cb468062e41a7a61acfc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.12-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 90c4ad51d3aeff851c1ebb0020aead095643c4091e238cf5d7d01704a0902f5e
MD5 274e8e453d0a0ad70efed63f5f927f50
BLAKE2b-256 0540fe987b05911f09f62118d59e19fa3f849f595f284bba465310f54b8c2401

See more details on using hashes here.

Provenance

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