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

Uploaded Python 3Windows x86-64

c2pa_python-0.32.9-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.9-py3-none-manylinux_2_28_aarch64.whl (14.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

Uploaded Python 3macOS 10.9+ x86-64

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

File metadata

  • Download URL: c2pa_python-0.32.9.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.9.tar.gz
Algorithm Hash digest
SHA256 7342c155055a8731222250333b9aa6f9be4c4f96eb5e9d1d220f952b8624997b
MD5 98359c9668683a76f9fb311a642dcbba
BLAKE2b-256 9f3da952570393ae656485126e9d6e6fc7607caf24a5fc8efd06d43cf592908b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: c2pa_python-0.32.9-py3-none-win_amd64.whl
  • Upload date:
  • Size: 89.8 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.9-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 36c7ab9a1fb05ad9f72a6aacd5849e05050da5c487319b9812b7845542bd622c
MD5 5da2ea4d9ebd4461238bf1c38d22b8cc
BLAKE2b-256 084361ec9686840faa42bf542cdbf8f83ff91e15c557103e2bd09cdb8d40b167

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.9-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f373bce2448ca5b98132334ac0b93261d90484b5feea1faa534d351661fe0792
MD5 577d48fb78ae641edf88bbff2e082d2b
BLAKE2b-256 a34ffccc4818c046cf03fec7db83c075e06145bfdcf9e326da1b399a79b96ee6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.9-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a33a9962d94b193a5bf54bbc249419a9849df233810bc0076bcaeeb24e417c72
MD5 424581dc4929b2bf1c48339973c31b7c
BLAKE2b-256 e8dbe2a1f2c6faa232ea183318f5cbcc0defdf1edc7cb8f3b3e4fb5583241075

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.9-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4e577742cb17f4eb2fe61717014ac4abfc362dce551e1aa24f98e3c2b9fbf6e
MD5 cac8f2ea12b161727eafcb8d6db7d4ae
BLAKE2b-256 3eeca1c4c7024c401492c2bfdbd6596d53bae31cbec009f96d37da720755a661

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.9-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a101ac4fe7757dcbebfb82b71797be231af325b2526a993fbca8865fdea66a5c
MD5 5619071955b3a664f77ab85557f355c3
BLAKE2b-256 e7f3848caf9ce6465d82a5b1b38cac4ca53daa82d1938a063777467302ef828d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for c2pa_python-0.32.9-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 208e7d9be090df041281649f9f5a976ec5b0c09a3b7afeaf297652e6f69f4b06
MD5 e34ca8e87c9a3c766cc11f094c1bb25f
BLAKE2b-256 e9533b0be125dc4c9027d3da26618b5d77af1e3090b787c59570f401ef4a0206

See more details on using hashes here.

Provenance

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