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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

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

File metadata

  • Download URL: c2pa_python-0.32.7.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.7.tar.gz
Algorithm Hash digest
SHA256 4f239f136fd17fbd36a5ab9737c3227c287b0b1c87604e1095084e2ce1b1dd3e
MD5 48b2bc270a4aa4330b763868e8ebe2a6
BLAKE2b-256 3615c9e14489113d4325b7340bc46286055b10cd99f17ae9a4f0d745e6d3ef90

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.7-py3-none-win_amd64.whl
  • Upload date:
  • Size: 94.0 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.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 885f38c26739cf600108fcd21635b1280af7d46e1ac21dce7e6694ec28877b11
MD5 47dcba52787f69f9b1a3ff859bf7312c
BLAKE2b-256 8478ec54e746358ee712c4737d76ccad629acf713341f3c71c33e6fde5b41847

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.7-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f3f1756e0f7ff7f4ca578b016d9d786a6f99704e2d391feaa39fe34846929ef
MD5 4077445c4e9e6489e92c7611283e1998
BLAKE2b-256 d67e115e06c58d908da2e88f18f211888414ae0836cf6c026b5478c2a577c715

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.7-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7522c56785d3fcc9e3c68c0b3c58898b53431300a76c04aab85a7c98b818c15d
MD5 afef0fcb9be3225d23e0ee6c7ae4b19a
BLAKE2b-256 becde06644cff76d947e422e184a986ba832bb0f390218df1941608cc73d28bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cdd618098073e873d5a231565cc70732f54ca3ac5b4e7b85ae73fa32b9d0f522
MD5 f4a76f83635d919f1c9ba285b364e245
BLAKE2b-256 4087be34db69b888e1e0145b21e0ad50e80a852d8bd9e42be704fe315a2eb145

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.7-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c41b5a0f72d15651577e3f28440b164f82c77232818fa56986146dfc90f80e8e
MD5 73d228101e42c2ad25136098c7f691dc
BLAKE2b-256 fbc57122ba03421d16fa42605309d4adaa8e1c55b7cfbd1229b1047fccf831ed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.7-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7eae1344a49842d86c18a53e8761b420fb81478a1bac2443f2e577c76622b67c
MD5 aaeaac1d6a6a8d584e80a41a09bde019
BLAKE2b-256 2f102254b7df2f48d7c02ebcefc2cedb51cef911fa98c4da65a4ebb8895f2ddd

See more details on using hashes here.

Provenance

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