Skip to content

load_settings not exported in __init__.py #216

Description

@brandonrule11

Description

The load_settings function exists in c2pa.py but is not exported in __init__.py, making it inaccessible via c2pa.load_settings().

Steps to reproduce

import c2pa
c2pa.load_settings({"trust": {"trust_anchors": "..."}})

Results in:

AttributeError: module 'c2pa' has no attribute 'load_settings'

Workaround

Import directly from the submodule:

from c2pa.c2pa import load_settings

Expected behavior

load_settings should be exported in __init__.py alongside the other public functions like Builder, Reader, etc.

Version

c2pa-python 0.27.1

Suggested fix

Add load_settings to the imports and __all__ in src/c2pa/__init__.py:

from .c2pa import (
    Builder,
    C2paError,
    Reader,
    C2paSigningAlg,
    C2paSignerInfo,
    Signer,
    Stream,
    sdk_version,
    read_ingredient_file,
    load_settings,  # Add this
)

__all__ = [
    'Builder',
    'C2paError',
    'Reader',
    'C2paSigningAlg',
    'C2paSignerInfo',
    'Signer',
    'Stream',
    'sdk_version',
    'read_ingredient_file',
    'load_settings',  # Add this
]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions