{"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,"search_vec":"'-1.0':15 'authent':9,30 'bind':4 'c2pa':1,7,23,28 'cai':11,35 'content':8,29 'initi':10 'librari':12 'manifest':24 'media':26,31 'month':16 'pre':14 'proven':27,32 'provid':18 'python':2,3 'releas':17 'sign':19,33 'v0.32.6':13 'verif':21,34","created_at":"2026-05-09T05:51:15.181775+00:00","updated_at":"2026-05-09T05:51:15.181775+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://contentauthenticity.org","github":"https://github.com/contentauth/c2pa-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/c2pa-python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}