Skip to main content

wia_scan 0.4.1

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 [-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 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.1.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

wia_scan-0.4.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wia_scan-0.4.1.tar.gz
Algorithm Hash digest
SHA256 15eae0a46852281f17f38d31c0a494eba8f698796124ac81d1771fc1d3e82f34
MD5 df998c6773eabe9d48333c75083e0469
BLAKE2b-256 e6190d89ea1c56a8a2218651b382952c6d0bcd4868cc380925be537528c838a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wia_scan-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f99804de62f563c23db5a6b37c99b2faa6a88f8d76aace510cd7d04732a99578
MD5 c1cbe40c35968eb1a44a0108cff8ed76
BLAKE2b-256 de3539a4e31c3a52fb49650afd7480e6533fe96141954f6d524d51864f989e11

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