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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

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

File metadata

  • Download URL: c2pa_python-0.32.6.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.6.tar.gz
Algorithm Hash digest
SHA256 3635ca07b5f74e5c4e8c04c300a4cb538181194c527d9f8db1330d0530db8919
MD5 2cd3a6ef8b272871e7b6ff97d1d6165e
BLAKE2b-256 a377bfc172545b84a0f00e1ef800442d56a1ff97be58fe890e46cd320952bd1c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.6-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.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 99f73e82c31f133c482aed6121e6a0841525776a5ce51a5040ac9ad1ec360ee7
MD5 b045d18b02aeb7f6aa26a919ebc46e62
BLAKE2b-256 f4ee9088cedddfe81dd9c060808d3972dac22764e5f2499e785383e10da85897

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bf57a0c6d4d67416ec75dd6923d8eaf26776798ec9293a323eb6405edce0039f
MD5 6d891e47163246ea228b9b82ae605aa9
BLAKE2b-256 81ef498ba0273c407c15161b829e8b381989e9980ea2817e6e377ca78e1b2890

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a7ddc8e95e93622f8b8d95ac8abef9dca148f5ac3064aee49b00962a0777cafb
MD5 70d8e1818144aca467c6f64558e8d0c1
BLAKE2b-256 1b89507be7a3ace8bfc6360c422fd865e32a3bfa6a4ea0b7e171cbf9a3c56c05

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b19f43eb9800bd1958100afd5e961e6d146c88317bc6a4d3da83e1dde3b8386
MD5 6ce87d33424bf3e98c45ca5208b3251e
BLAKE2b-256 d17546c4253c892a4cdd6d44b4263ab38d06733098cbad9dd706ac593a465e2d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.6-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4ed9d2f3391553d99bf4a04722f00bf5e257630f2389af28bbb29238509ecd96
MD5 6328eeb5c51a1e747a1ac71b0974a374
BLAKE2b-256 175568f1a2e8158aa28e24c55ec38893acd45335a30d7984c05f29fddc6385d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.6-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5bebb4c05333e74e44ada3b9287b32bcccd973ad60cbaa8c811f10c6c4b5ae62
MD5 c40337d178c94135eed4aff32f669253
BLAKE2b-256 c288c59bd7f30335d481332fc611204f8cb5b898e2865cf980747992f272588d

See more details on using hashes here.

Provenance

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