pyScanLib
An combination of Twain and SANE API
Requirements:
Python 2.*
SANE API for Linux
Twain Lib for Win32
Functions:
pyScanLib() - Main Class
getScanners() - Return Scanner with Name
setScanners(scannerName)
setDPI(dpi)
setScanArea(left,top,width,height) - For scanning selected Area size in Inches
setPixelType(“color”) - bw (Black & White), gray and color
scan() - Start Scanning
closeScanner() - Unselect selected scanner
close() - Destory connected API Class
Special Function:
pixelToInch(pixel) - Convert Pixel(s) to Inch(es) using DPI from setDPI() or default 200
cmToInch(cm) - Convert Centimeter(s) to Inch(es)
inchTomm(inch) - Convert Inch(es) to Millimeter(s)
mmToInch(mm) - Convert Millimeter(s) to Inch(es)
Example:
from pyScanLib import pyScanLib
loadScanner = pyScanLib()
scanners = loadScanner.getScanners()
loadScanner.setScanner(scanners[0])
loadScanner.setDPI(300)
loadScanner.setScanArea(width=512,height=512) #(left,top,width,height)
loadScanner.setPixelType("color") #bw/gray/color
PIL = loadScanner.scan()
PIL.save("scanImage.jpg")
loadScanner.closeScanner() # unselect selected scanner in setScanners()
loadScanner.close() # Destory whole class
Detail Example:
Check exampleUsage.py in repo
Notice:
Not tested on Linux however work perfect on Windows.
Used in:
License:
pyScanLib uses BSD 2-Clause License.
Metadata
Release files for pyScanLib v1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyScanLib-v1.0.zip | 5.2 kB | Without provenance | Details for pyScanLib-v1.0.zip |
Release files / pyScanLib-v1.0.zip
| Download URL | pyScanLib-v1.0.zip |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2fe2ea0f15928d920b9db14053025c919efa733d020ae03a737c71dba96c8146
|
|
BLAKE2b-256 checksum How to use checksums |
0d6021bafdf89d927b41dcba185ae3b60a4dcae55a30f247447179847abebbcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyScanLib v1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.