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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.10-py3-none-manylinux_2_28_x86_64.whl (15.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.32.10-py3-none-macosx_10_9_x86_64.whl (15.1 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.10-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.10.tar.gz.

File metadata

  • Download URL: c2pa_python-0.32.10.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.10.tar.gz
Algorithm Hash digest
SHA256 820fc0ea474491677dd1d9e51e63230265263293f42b5d309b088957a91820b6
MD5 d9070d51f3102137f6957e4c05b7230e
BLAKE2b-256 72973662820c96e88410ec33e95528d3c880aa7dce519ab760b7712c865e42d4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 589b89ed543bc8d17ffa932ff4c1bc2f3e77de65bf56393f5c278ffbe3b819d1
MD5 599342cc955fb4ebb36514be8d6240d4
BLAKE2b-256 632bf1472092f2177d166ac8fce64fdb42c09b39ff62cba2da1d500a08744fc1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 21e6d7b0bf788142a15beeadaadc787792138376ffc44afd106bdfd6ea08dab3
MD5 d8b394639cd4df29f2fb9bfb21be7112
BLAKE2b-256 f394c06f2faa3155ec5a986b2d833ed215b50c865d6d936b86605c8fda02fc8a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 15a7e0bea8424f75a2755ca0ad2024fde5aae9d1fdc9f2aafae05df29cde2ce9
MD5 ddae116ac77a07dd16f652c15dea6c3a
BLAKE2b-256 9e52d3db11cc442eb4d2ba2ff56e99ab2e50e24d3c36b32e121238783b908339

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10e1776de22fef978cc3b09248f402bd81af58da53a1bf665d70dcb2328e0f55
MD5 24a8a472934b2fbc04dbdc3fb02f4603
BLAKE2b-256 9107f40c4a2135e2221f75a26a83c249554a7ed18a8eab57a593ca3f46ad1332

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f5eecc7d8c68a67220a174170927996d4793270679ee89b324a5b9c0fd5c7973
MD5 1f4015e45a0d690e0067493da71d6040
BLAKE2b-256 47861dbde438e608795e70dc2c6610e4d63b9a626a5a56966249695261bde5ab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.10-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9be5e6a2112a820f3dba84e969b2eb4889ab3027ff6d857b16c41fc0f36dc8a2
MD5 957d1b2d55f10f1373d32e9b9b41c35a
BLAKE2b-256 0f2226772408965228bc4af67a76bf7b260c09b4ca577c9f93c0395ee31268c8

See more details on using hashes here.

Provenance

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