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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.3-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.3-py3-none-manylinux_2_28_aarch64.whl (16.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.32.3-py3-none-macosx_10_9_universal2.whl (17.4 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.32.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ef4c803698ac6ae0a494167c420c4b09402ee41cb7c9fc84e28a4beb08cbaaf9
MD5 aaa2647fbe8f39ddf54c9657ade369d9
BLAKE2b-256 a5aed529c30b7f0720d463f4c877da0315832afbac5d426a04a98bb6b3b5936a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 94.4 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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6aa109dd4b9891870d11d9ce4c851582babd70ab867b2a7393bd240724184df3
MD5 563d58fd205ce630b4a5499d8f76bf4a
BLAKE2b-256 ae7770787760d902ba3e4cfbd785572909f66152e906b21dc10b080762be769d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88fd6b2429dca769c81d0cc8eb4e35232c88f943a8455bd584b50708a447dc18
MD5 0976a40de616ccdcb8f1fef1408974ae
BLAKE2b-256 598c3012a8fbd1ce3baa4e3260a8e2203b1137c5b12da8ec0f9158f040cac60f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 60b375ad1f9d9115a0fa650e764297c4075b74120f12e0c5d67ffd06a95d12bd
MD5 86e233a5aa6a74d2380119a4e3451754
BLAKE2b-256 4c2fd2168ddb8646649b801d578eed895282e3107f18770ee1a484587fa4bccc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8feca97192c11785cdd20aff6d25b3b72973ac7bb4e695c7bfe8db62cd632c34
MD5 ad647713fcce99ddc12d963cf1bbe724
BLAKE2b-256 3997745d73d2e1c1a31cc5786dd1d5f14bf9d6e93506fd4e2617f2b015e25664

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.3-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0f971cd6b4b874002f9aaf6e7684e632222fd0d19beb4693ea3d0ed91bb3ff04
MD5 aa87d73221b8e282d1bf6d4299098dce
BLAKE2b-256 f6ecae9e6b814c824b8dd8442c954148873bdfd8e53e76f34a26593d6a73a724

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.3-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9c58de628bde9b305b66ce5ff3d84cf020a485ae09945f37161b3c48b82cc0c7
MD5 8eaceef635a3e29be21a70e4bb22fe11
BLAKE2b-256 e9139ddcbf1777b249b879f9f4135fc55bdd45a8a7b40cc75cca5008d63d01dd

See more details on using hashes here.

Provenance

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