{"id":27630,"library":"c2pa-python","title":"C2PA Python","description":"Python bindings for the C2PA Content Authenticity Initiative (CAI) library (v0.32.6, pre-1.0, monthly releases). Provides signing and verification of C2PA manifests for media provenance.","status":"active","version":"0.32.6","language":"python","source_language":"en","source_url":"https://github.com/contentauth/c2pa-python","tags":["C2PA","content authenticity","media provenance","signing","verification","CAI"],"install":[{"cmd":"pip install c2pa-python","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"core class for reading C2PA manifests","symbol":"Reader","correct":"from c2pa import Reader"},{"note":"used to configure signing (keys and certs)","symbol":"SignerInfo","correct":"from c2pa import SignerInfo"},{"note":"used to create and sign manifests","symbol":"Builder","correct":"from c2pa import Builder"}],"quickstart":{"code":"import os\nfrom c2pa import Reader, Builder, SignerInfo\n# Verify an image's C2PA manifest\nreader = Reader.from_file('test_image.jpg')\nprint(reader.json())\n# Sign an image\nsigner = SignerInfo.from_settings({\n    'alg': 'es256',\n    'private_key': os.environ.get('C2PA_PRIVATE_KEY', ''),\n    'sign_cert': os.environ.get('C2PA_SIGN_CERT', '')\n})\nbuilder = Builder(signer)\nmanifest = {'claim_generator': 'my_app/1.0'}\noutput = builder.sign('input.jpg', 'output.jpg', manifest)\nprint(output)\n","lang":"python","description":"Verify C2PA manifest from file, then create and sign a new manifest using environment variables for credentials."},"warnings":[{"fix":"Use `SignerInfo.from_settings({'alg': 'es256', 'private_key': '...', 'sign_cert': '...'})`.","message":"The `SignerInfo` API changed in v0.30.0: old `from_certs` removed, use `from_settings` with `private_key` and `sign_cert` keys.","severity":"breaking","affected_versions":"<0.30.0"},{"fix":"Replace `Reader.from_buffer(data)` with `Reader.from_bytes(data)`.","message":"`Reader.from_buffer` is deprecated in v0.32.0; use `Reader.from_bytes` instead.","severity":"deprecated","affected_versions":">=0.32.0"},{"fix":"Include the full certificate chain in the `sign_cert` value (PEM).","message":"The `Builder` requires the full chain of intermediate CA certificates in `sign_cert`; missing intermediates causes a validation error on verification.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Provide the full cert chain in `sign_cert` and ensure the private key matches the leaf certificate.","cause":"The signer certificate chain is incomplete or the private key does not match the certificate.","error":"c2pa.ValidationException: InvalidSignature"},{"fix":"Run `pip install c2pa-python` and verify Python version >=3.10.","cause":"The c2pa-python package is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'c2pa'"},{"fix":"Use `Reader.from_file('image.jpg')` with a string file path.","cause":"Using `Reader.from_file` without a path string, or passing a file object.","error":"TypeError: from_file() missing required positional argument: 'path'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}