paperap.models.config.config module
Configuration model for Paperless-NgX system settings.
This module provides the Config model class for interacting with the Paperless-NgX configuration API endpoint. It allows retrieving and modifying system-wide settings that control document processing, OCR behavior, and application appearance.
- class paperap.models.config.config.Config(**data)[source]
Bases:
StandardModel
Model representing Paperless-NgX system configuration settings.
This model provides access to system-wide configuration settings that control document processing, OCR behavior, and application appearance. These settings correspond to those available in the Paperless-NgX admin interface.
- user_args
Custom arguments passed to the OCR engine.
- Type:
str | None
- output_type
Default output format for OCR results (e.g., “pdfa”, “pdf”).
- Type:
str | None
- pages
Page range specification for OCR processing (e.g., “1,3-5”).
- Type:
str | None
- language
Default OCR language code (e.g., “eng”, “deu”).
- Type:
str | None
- mode
OCR processing mode (e.g., “skip”, “redo”, “force”).
- Type:
str | None
- skip_archive_file
Whether to skip creating archive files.
- Type:
bool | None
- image_dpi
DPI setting for image processing.
- Type:
int | None
- unpaper_clean
Whether to use unpaper for document cleaning.
- Type:
bool | None
- rotate_pages_threshold
Confidence threshold for automatic page rotation.
- Type:
int | None
- max_image_pixels
Maximum number of pixels to process in images.
- Type:
int | None
- color_conversion_strategy
Strategy for color conversion (e.g., “none”, “grayscale”).
- Type:
str | None
Examples
Retrieve current system configuration:
`python config = client.config.get() print(f"Current OCR language: {config.language}") `
Update system configuration:
`python config = client.config.get() config.language = "eng+deu" # Set OCR to use English and German config.deskew = True # Enable automatic document straightening config.save() `
- Parameters:
data (
Any
)
- user_args: str | None
- output_type: str | None
- pages: str | None
- language: str | None
- mode: str | None
- skip_archive_file: bool | None
- image_dpi: int | None
- unpaper_clean: bool | None
- deskew: bool
- rotate_pages: bool
- rotate_pages_threshold: int | None
- max_image_pixels: int | None
- color_conversion_strategy: str | None
- app_title: str
- app_logo: str
- class Meta(model)
Bases:
Meta
- Parameters:
model (type[_Self])
- blacklist_filtering_params: ClassVar[set[str]] = {}
- field_map: dict[str, str] = {}
- filtering_disabled: ClassVar[set[str]] = {}
- filtering_fields: ClassVar[set[str]] = {'_resource', 'app_logo', 'app_title', 'color_conversion_strategy', 'deskew', 'id', 'image_dpi', 'language', 'max_image_pixels', 'mode', 'output_type', 'pages', 'rotate_pages', 'rotate_pages_threshold', 'skip_archive_file', 'unpaper_clean', 'user_args'}
- read_only_fields: ClassVar[set[str]] = {'id'}
- supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': 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].