wia_scan 0.4.0
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wia_scan-0.4.0.tar.gz
.
File metadata
- Download URL: wia_scan-0.4.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58f8a7d57edf73b0ab242213ea9388b9fa8a096d830efbd760113861658adeac |
|
MD5 | 0b1ca8795aa149c6fedc6b60ce4b688a |
|
BLAKE2b-256 | 31e36ce3e6bf7858bbddd20f3627fb28482746f27a5d828493b5ed73b9afe45a |
File details
Details for the file wia_scan-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: wia_scan-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 387d41766863c711e7ed7650e33eeee805b061976cb657f5a7eb1cbbff174cdd |
|
MD5 | a5eecc4229766151a864a52304faf8d2 |
|
BLAKE2b-256 | d6cf712dea0fc09d96afa585899d6db504c7f50bbf437638c2ed4c980c168a5d |