paperap.plugins.base module


METADATA:

File: base.py

Project: paperap

Created: 2025-03-04

Version: 0.0.8

Author: Jess Mann Email: jess@jmann.me

Copyright (c) 2025 Jess Mann


LAST MODIFIED:

2025-03-04 By Jess Mann

class paperap.plugins.base.ConfigType[source]

Bases: TypedDict

type: NotRequired[type]
description: NotRequired[str]
required: NotRequired[bool]
class paperap.plugins.base.Plugin(**kwargs)[source]

Bases: BaseModel, ABC

Base class for all plugins.

Parameters:

kwargs (Any)

name: ClassVar[str]
description: ClassVar[str] = 'No description provided'
version: ClassVar[str] = '0.0.1'
manager: PluginManager
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'from_attributes': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

__init__(**kwargs)[source]

Initialize the plugin.

Parameters:

**kwargs (Any) – Plugin-specific configuration.

property client: PaperlessClient
abstractmethod setup()[source]

Register signal handlers and perform other initialization tasks.

Return type:

None

abstractmethod teardown()[source]

Clean up resources when the plugin is disabled or the application exits.

Return type:

None

classmethod get_config_schema()[source]

Get the configuration schema for this plugin.

Return type:

dict[str, ConfigType]

Returns:

A dictionary describing the expected configuration parameters.

Examples

>>> return {
>>>     "test_dir": {
>>>         "type": str,
>>>         "description": "Directory to save test data files",
>>>         "required": False,
>>>     }
>>> }