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.29.0.tar.gz (81.9 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.29.0-py3-none-win_amd64.whl (91.9 MB view details)

Uploaded Python 3Windows x86-64

c2pa_python-0.29.0-py3-none-manylinux_2_28_x86_64.whl (16.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

c2pa_python-0.29.0-py3-none-manylinux_2_28_aarch64.whl (15.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

c2pa_python-0.29.0-py3-none-macosx_11_0_arm64.whl (15.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

c2pa_python-0.29.0-py3-none-macosx_10_9_x86_64.whl (15.8 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

c2pa_python-0.29.0-py3-none-macosx_10_9_universal2.whl (16.2 MB view details)

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

File details

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

File metadata

  • Download URL: c2pa_python-0.29.0.tar.gz
  • Upload date:
  • Size: 81.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.29.0.tar.gz
Algorithm Hash digest
SHA256 93f72aa8e6b90636e0001a39eb2c3499ec64354452024673fff2a651a4e54cab
MD5 fd157bdedd7e815a78bd012382346d23
BLAKE2b-256 e7da9d64b05be6c63d23dee45036188fc8dd0f2c40de8adf9a113410c377bf04

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.29.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 91.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for c2pa_python-0.29.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 74ae14408d4ad71c59df4736acfeb5f39c2dfbb34b4a5d9897d7c4ba6f325e2d
MD5 5f27d6e830418317f64ec235d23a88f8
BLAKE2b-256 057895433d2f26ae4e0812a729785b545cfe047e84a769b88b01d2c32fd0541d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.29.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65be360b746cf93de0d53784224695494aa23eef5f3ca9173ef2a4059d5a61c3
MD5 140fb4e2e87f2e3831e1290a50d935ed
BLAKE2b-256 70fe214a269c59af93c5d1b42e27d06f0fd92dd46238b167e6b0f1ea8dcf2c81

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.29.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 29c9d7f1338854eb9b5749357ebc020737a588c22e0ae2f4cb75cecd798c15f4
MD5 366862b6761353f3b91611606b2fa098
BLAKE2b-256 8af8ca07745ef9d5bf76aa6a52cc6d4b4a43bd1b0172b60249b819788d01af62

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.29.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3bb39659e4262ceadaf4cdd0b42e72d54d31f3037c850cc9a67a599c303d56f
MD5 4c2259dd0547f598c01a44045953e6b5
BLAKE2b-256 415219a0a67c44cdfec4afbff761f6d9eb42f300efdde6cfb2e8a7c207964bd3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.29.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1ee0002950c18292c836ecba7b3cab74e2d4b13d06803323b3d0c0d38b68aafc
MD5 f51f6ea506574e956771b69d8fcd620e
BLAKE2b-256 979f4a80e57e6394d0d3d05822663afd1d3954105310796d15994e625953f3eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.29.0-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6e93ba7c5874d4d591c2a32357930734b33cfc9d1567571adaff2b25ad5c7318
MD5 ee911d129bf442ac31df83e34eff9f6f
BLAKE2b-256 88aa757c2f7b9a5f9e81f87f2ba6aa4e59b339ccf9e4f74dfed6f72a6856ff41

See more details on using hashes here.

Provenance

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