Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test'
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 25, 2021
2 parents dd53d34 + 29b82cb commit bac0a9d
Show file tree
Hide file tree
Showing 18 changed files with 577 additions and 434 deletions.
7 changes: 7 additions & 0 deletions .prospector.yaml
@@ -1,5 +1,7 @@
---
strictness: veryhigh
doc-warnings: true
max-line-length: 110

ignore-paths:
- scan_to_paperless/process_schema.py
Expand All @@ -9,6 +11,11 @@ pep8:
disable:
- E203 # whitespace before ':'

pep257:
disable:
- D212 # Multi-line docstring summary should start at the first line
- D203 # 1 blank line required before class docstring (found 0), not compatible with Black

pylint:
disable:
- wrong-import-order
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -6,7 +6,7 @@ RUN \
apt install --assume-yes --no-install-recommends \
graphicsmagick pdftk-java \
tesseract-ocr tesseract-ocr-fra tesseract-ocr-deu tesseract-ocr-eng \
libimage-exiftool-perl software-properties-common python3-pip && \
libimage-exiftool-perl software-properties-common python3-pip ghostscript && \
apt clean && \
rm --recursive --force /var/lib/apt/lists/* /root/.cache /var/cache/*

Expand Down
12 changes: 6 additions & 6 deletions Pipfile
Expand Up @@ -4,19 +4,19 @@ verify_ssl = true
name = "pypi"

[packages]
numpy = "==1.21.2"
numpy = "==1.21.3"
scipy = "==1.7.1"
scikit-image = "==0.18.3"
opencv-python-headless = "==4.5.3.56"
deskew = "==0.10.33"
opencv-python-headless = "==4.5.4.58"
deskew = "==0.10.36"
jsonschema-gentypes = "==0.9.4"
"ruamel.yaml" = "==0.17.4"

[dev-packages]
prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.0.1"}
flake8 = "==3.8.4"
prospector = {extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "==1.5.1"}
flake8 = "==3.9.2"
pytest = "==6.2.5"
coverage = "==5.5"
coverage = "==6.0.2"
pytest-profiling = "==1.7.0"
argcomplete = "==1.12.3"

Expand Down
563 changes: 294 additions & 269 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/requirements.txt
@@ -1,2 +1,2 @@
c2cciutils==1.1.dev20210915084344
c2cciutils==1.1.dev20211022130135
jsonschema2md==0.2.1
10 changes: 5 additions & 5 deletions config.md
Expand Up @@ -13,17 +13,17 @@
- **`args`** *(object)*: Cannot contain additional properties.
- **`level`** *(['boolean', 'integer'])*: true: => do level on 15% - 85% (under 15 % will be black above 85% will be white), false: => 0% - 100%, <number>: => (0 + <number>)% - (100 - number)%.
- **`auto_level`** *(boolean)*: If no level specified, do auto level. Default: `False`.
- **`min_level`** *(integer)*: Min level if no level end no autolovel. Default: `15`.
- **`max_level`** *(integer)*: Max level if no level end no autolovel. Default: `15`.
- **`min_level`** *(integer)*: Min level if no level end no auto-level. Default: `15`.
- **`max_level`** *(integer)*: Max level if no level end no auto-level. Default: `15`.
- **`no_crop`** *(boolean)*: Don't do any crop. Default: `False`.
- **`margin_horizontal`** *(number)*: The horizontal margin used on autodetect content [mm]. Default: `9`.
- **`margin_vertical`** *(number)*: The vertical margin used on autodetect content [mm]. Default: `6`.
- **`margin_horizontal`** *(number)*: The horizontal margin used on auto-detect content [mm]. Default: `9`.
- **`margin_vertical`** *(number)*: The vertical margin used on auto-detect content [mm]. Default: `6`.
- **`dpi`** *(number)*: The DPI used to convert the mm to pixel. Default: `300`.
- **`sharpen`** *(boolean)*: Do the sharpen. Default: `False`.
- **`dither`** *(boolean)*: Do the dither. Default: `False`.
- **`tesseract`** *(boolean)*: Use tesseract to to an OCR on the document. Default: `False`.
- **`tesseract_lang`** *(string)*: The used language for tesseract. Default: `fra+eng`.
- **`assisted_split`** *(boolean)*: Do en assited split. Default: `False`.
- **`assisted_split`** *(boolean)*: Do en assisted split. Default: `False`.
- **`min_box_size_crop`** *(number)*: The minimum box size to find the content on witch one we will crop [mm]. Default: `3`.
- **`min_box_size_limit`** *(number)*: The minimum box size to find the limits based on content [mm]. Default: `10`.
- **`min_box_size_empty`** *(number)*: The minimum box size to find the content to determine if the page is empty [mm]. Default: `10`.
Expand Down
11 changes: 5 additions & 6 deletions process.md
Expand Up @@ -13,7 +13,7 @@
- **Items** *(string)*
- **`process_count`** *(integer)*: The step number.
- **`assisted_split`** *(array)*
- **Items** *(object)*: Assited split configuration. Cannot contain additional properties.
- **Items** *(object)*: Assisted split configuration. Cannot contain additional properties.
- **`source`** *(string)*
- **`destinations`** *(array)*
- **Items** *(['integer', 'string'])*
Expand All @@ -33,17 +33,16 @@
- **`traceback`** *(array)*
- **Items** *(string)*
- **`images_config`** *(object)*: Can contain additional properties.
- **`images_status`** *(object)*: Can contain additional properties.
## Definitions

- **`args`** *(object)*
- **`level`** *(['boolean', 'integer'])*: true: => do level on 15% - 85% (under 15 % will be black above 85% will be white), false: => 0% - 100%, <number>: => (0 + <number>)% - (100 - number)%.
- **`auto_level`** *(boolean)*: If no level specified, do auto level. Default: `False`.
- **`min_level`** *(integer)*: Min level if no level end no autolovel. Default: `15`.
- **`max_level`** *(integer)*: Max level if no level end no autolovel. Default: `15`.
- **`min_level`** *(integer)*: Min level if no level end no auto-level. Default: `15`.
- **`max_level`** *(integer)*: Max level if no level end no auto-level. Default: `15`.
- **`no_crop`** *(boolean)*: Don't do any crop. Default: `False`.
- **`margin_horizontal`** *(number)*: The horizontal margin used on autodetect content [mm]. Default: `9`.
- **`margin_vertical`** *(number)*: The vertical margin used on autodetect content [mm]. Default: `6`.
- **`margin_horizontal`** *(number)*: The horizontal margin used on auto-detect content [mm]. Default: `9`.
- **`margin_vertical`** *(number)*: The vertical margin used on auto-detect content [mm]. Default: `6`.
- **`dpi`** *(number)*: The DPI used to convert the mm to pixel. Default: `300`.
- **`sharpen`** *(boolean)*: Do the sharpen. Default: `False`.
- **`dither`** *(boolean)*: Do the dither. Default: `False`.
Expand Down
2 changes: 2 additions & 0 deletions scan_to_paperless/__init__.py
@@ -1,3 +1,4 @@
"""The scan to Paperless main module."""
import os.path
import sys
from typing import cast
Expand All @@ -22,6 +23,7 @@


def get_config(config_filename: str) -> stp_config.Configuration:
"""Get the configuration."""
if os.path.exists(config_filename):
yaml = YAML()
yaml.default_flow_style = False
Expand Down
10 changes: 5 additions & 5 deletions scan_to_paperless/config.py
Expand Up @@ -10,23 +10,23 @@
#
# default: False
"auto_level": bool,
# Min level if no level end no autolovel
# Min level if no level end no auto-level
#
# default: 15
"min_level": int,
# Max level if no level end no autolovel
# Max level if no level end no auto-level
#
# default: 15
"max_level": int,
# Don't do any crop
#
# default: False
"no_crop": bool,
# The horizontal margin used on autodetect content [mm]
# The horizontal margin used on auto-detect content [mm]
#
# default: 9
"margin_horizontal": Union[int, float],
# The vertical margin used on autodetect content [mm]
# The vertical margin used on auto-detect content [mm]
#
# default: 6
"margin_vertical": Union[int, float],
Expand All @@ -50,7 +50,7 @@
#
# default: fra+eng
"tesseract_lang": str,
# Do en assited split
# Do en assisted split
#
# default: False
"assisted_split": bool,
Expand Down
2 changes: 2 additions & 0 deletions scan_to_paperless/config_old.py
@@ -1,3 +1,5 @@
"""Config for old Python versions."""

from typing import Any, Dict

# Arguments
Expand Down
10 changes: 5 additions & 5 deletions scan_to_paperless/config_schema.json
Expand Up @@ -21,12 +21,12 @@
},
"min_level": {
"type": "integer",
"description": "Min level if no level end no autolovel",
"description": "Min level if no level end no auto-level",
"default": 15
},
"max_level": {
"type": "integer",
"description": "Max level if no level end no autolovel",
"description": "Max level if no level end no auto-level",
"default": 15
},
"no_crop": {
Expand All @@ -37,12 +37,12 @@
"margin_horizontal": {
"type": "number",
"default": 9,
"description": "The horizontal margin used on autodetect content [mm]"
"description": "The horizontal margin used on auto-detect content [mm]"
},
"margin_vertical": {
"type": "number",
"default": 6,
"description": "The vertical margin used on autodetect content [mm]"
"description": "The vertical margin used on auto-detect content [mm]"
},
"dpi": {
"type": "number",
Expand Down Expand Up @@ -72,7 +72,7 @@
"assisted_split": {
"type": "boolean",
"default": false,
"description": "Do en assited split"
"description": "Do en assisted split"
},
"min_box_size_crop": {
"type": "number",
Expand Down

0 comments on commit bac0a9d

Please sign in to comment.