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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.4-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.4-py3-none-manylinux_2_28_aarch64.whl (15.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.4-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.4.tar.gz.

File metadata

  • Download URL: c2pa_python-0.32.4.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.4.tar.gz
Algorithm Hash digest
SHA256 c22e30a18578a65db3fb3f5104573a4d5ffe6f789ab2f926f7f498f37c2bdd30
MD5 f8a7f9643d2e0f9fd0473eeb3358ffe7
BLAKE2b-256 43c51bc8d0bb8e4cfe7368abd4cb84dd4f84a0c70633e5201719b166a7a027ad

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.4-py3-none-win_amd64.whl
  • Upload date:
  • Size: 94.5 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.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 395b5fddebfca542e9c6dadcb13c9b0b3f43b2b1583f388cc2f382dc25d61817
MD5 e6d632638b45f673a54dd05e9f2c8c78
BLAKE2b-256 3de598e721b7e0a2d57bfa294259527719e5c7bbb7b945366d57b433e6fcf7de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a98a594cf79655e3f29987f40bcc5a601de382d352a567bba6601cd4a5322c56
MD5 3f6148a5cadb07568145860c70e23767
BLAKE2b-256 873f73fc990eaadb2551f44beeb3bc56e18afec2e49c6eccc912bdf1168bcac3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ad7f4c0246af7c36c33ef4ebba4593a3a7fbcf3d1f7461a55201d0116e2bc271
MD5 5ce29bf5cc134bfa224fe3246fc9f0b1
BLAKE2b-256 874bc225e3e089cd346b5957267cc459f0654f9a2a086786a520df74cdbb9e5a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8bc1537fe33cd04b707e3aa201d80527a61a4025da598e9c844ab39f9bdbf53
MD5 6fe1fcd5476f5fa5d83f2185ddf9dd2d
BLAKE2b-256 7568637db1d0e5d560f6acce24d6155764bbfbf068e937c62c4c6975335e1c2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.4-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5ac04f244cb4287d7972ef1fe55717ee38672931f84678a631978a0bcb90d904
MD5 7420a22b1f381bc8daeaad843f9a4008
BLAKE2b-256 7ded40e542af5df3281bd6c7529ccf5ad9c805fe352d9346713ff9d7b330fa7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.4-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b847ccf61baa140dc15374bfaf79fbb2920a6e5549352433f93c499779d47757
MD5 51c677c65c684ef78c227bcde7d52355
BLAKE2b-256 e4b96e33e1c920f5f41928457000b3c89d79b6292acd795274865439cda6d3d4

See more details on using hashes here.

Provenance

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