Skip to main content

wia_scan 0.4.0

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.

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.
  • Support scanners 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
  wia_scan single_side
  wia_scan many_flatbed
  wia_scan --help

Options:
  -h --help                      Show this screen.
  --version                      Show version.

Library Usage - Custom Loop

Example: Scan 10 single sided documents from the same scanner:

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(10):
    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.0.tar.gz (28.7 kB view hashes)

Uploaded Source

Built Distribution

wia_scan-0.4.0-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

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