Skip to main content

wia_scan 0.4.2

Project description

wia_scan

wia_scan

A simple utility for using document scanners that support Windows Image Acquisition (WIA) and is easy to install. If your scanner works using Windows Fax and Scan, there is a good chance it will work with this python script. This package allows you to create your own efficient scanning loop, or use the one the one already provided.

Use cases:

  • You have a flatbed scanner and you need to scan a lot of documents, thus you don't want to use Windows Fax and Scan tool as it can introduce quite some overhead. This utility allows you to only press a few keystrokes inbetween scans, while you may need to turn the page or change the paper since you don't have an automatic feeding scanner like I don't.
  • Support scanners in your own application on Windows using a simple Python dependency

Alternatives: Existing WIA libraries, but to my surprise the ones I found required quite old versions of Python, which I didn't want since I wanted to combine the scanning process with some modern Python packages.

Installation

pip install wia_scan

Alternative: From Source

Download this source and install flit uisng pip install flit and run the following command from the source folder

flit install

Usage

Command Line Interface

wia_scan <version>

Usage:
  wia_scan list_devices [-v]
  wia_scan single_side [-v]
  wia_scan many_flatbed [-v]
  wia_scan --help

Options:
  -h --help            Show this screen.
  --version            Show version.
  -v --verbose         Verbose output

Library Usage - Custom Loop

Example: Scan many single sided documents from the same scanner while waiting for a single key press between scans:

import os
from wia_scan import *

print_function = print
device_manager = get_device_manager()
device_identifier = prompt_choose_device(device_manager=device_manager, print_function=print_function)
device = connect_device(device_manager=device_manager,
                        device_identifier=device_identifier, print_function=print_function)
for i in range(1000000):
    os.system("pause")
    wia_image = scan_side(device=device, settings=DEFAULT_SCAN_SETTINGS,
                        print_function=print_function)
    wia_image.SaveFile(f'{i}.jpeg')

License

wia_scan is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wia_scan-0.4.2.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

wia_scan-0.4.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file wia_scan-0.4.2.tar.gz.

File metadata

  • Download URL: wia_scan-0.4.2.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for wia_scan-0.4.2.tar.gz
Algorithm Hash digest
SHA256 33b342c72157d9e7f3414d65da2e591e4a535b5b75b62e3f9459d2a019423e52
MD5 818361dd386d8836449db8207e1c27af
BLAKE2b-256 10647378e0621fe686a6b9e8673e54f32e3ff87e7cbee1ca635e622e46da33fb

See more details on using hashes here.

File details

Details for the file wia_scan-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: wia_scan-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for wia_scan-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b5d7dcf2dd5bc44066970ffa4dcfdfb1f8291f71b5df64e26fc42bad3b85ce0f
MD5 b83f7cea09a70b52b4b65c51b1fea6ff
BLAKE2b-256 f6699dfd510377b364e0fe6b13590d350dfb67c8141770425382ceacac6b1741

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page