Skip to content
wuanPublic

About

Simple script to create pdf files from a SANE compatible scanner with document feeder

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

PyPi-Package Quality gate status Lines of code Coverage Duplicated lines Maintainability Rating OpenSSF Scorecard

simple script to create pdf files from a scanner with document feeder

Examples

scan double sided pages to pdf

Example:

scan-pdf --resolution 100 --duplex test.pdf

supported options

> scan-pdf -h
usage: scan-pdf [-h] [--resolution RESOLUTION] [--flatbed] [-d] [--duplex] [--color-mode {bw,gray,color}] [--threshold THRESHOLD] [--color-depth COLOR_DEPTH] [--paper-format {A4,A5}] [--paper-left PAPER_LEFT] [--paper-top PAPER_TOP]
                [--paper-height PAPER_HEIGHT] [--paper-width PAPER_WIDTH]
                output_file_name

Produce PDF from Scanner with document-feeder

positional arguments:
  output_file_name      name of the produced output file

optional arguments:
  -h, --help            show this help message and exit
  --resolution RESOLUTION
                        scan resolution DPI (default: 300)
  --flatbed             scan only one page from flatbed glass
  -d                    enable debug output
  --duplex              scan both sides of document
  --color-mode {bw,gray,color}
                        default: gray
  --threshold THRESHOLD
                        disabled by default
  --color-depth COLOR_DEPTH
  --paper-format {A3,A4,A5,A6,A7}
                        default: A4
  --paper-left PAPER_LEFT
                        override left offset
  --paper-top PAPER_TOP
                        override top offset
  --paper-height PAPER_HEIGHT
                        override paper height
  --paper-width PAPER_WIDTH
                        override paper width

Mutation testing

The project uses mutmut for mutation testing. For terminology, benefits and risks see docs/mutation-testing.md. Run it locally with:

uv run mutmut run

This executes the test suite against injected mutants and prints a progress summary of killed and surviving mutants. List survivors with uv run mutmut results and inspect one with uv run mutmut show <name> (or browse them interactively with uv run mutmut browse). mutmut needs fork, so on Windows run it inside WSL.

The baseline is zero surviving mutants, and it is enforced. scripts/mutation_check.py clears the mutants/ cache, runs mutmut and fails if any mutant survives or has no covering test. It runs:

  • as the mutmut pre-commit hook whenever Python files are committed (a full run takes a few seconds; bypass it once with SKIP=mutmut git commit)
  • in the Mutation testing job of the Build workflow, which also uploads mutants/mutmut-cicd-stats.json as an artifact

About

Simple script to create pdf files from a SANE compatible scanner with document feeder

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages