A multiplatform document scanning library for Python
Project description
scanlib
A multiplatform document scanning library for Python with platform-native scanning backends and minimal dependencies.
Features
- Cross-platform — unified API across Windows (WIA 2.0), macOS (ImageCaptureCore), and Linux (SANE)
- Output to PDF — assemble scanned pages into a PDF and control page encoding (JPEG or PNG)
- Minimal dependencies — no external image or PDF processing libraries; JPEG uses platform-native encoders, PNG uses stdlib
zlib, PDF assembly uses only the standard library - Multi-page scanning — automatic document feeder support and flatbed multi-page with a simple callback
- Page-level control — preview, rotate, reorder, and encode individual pages as JPEG or PNG before assembling the final PDF
- Thread-safe — call from any thread; backend threading is handled internally
- Progress & cancellation — monitor scan progress and abort mid-scan via callback
Installation
pip install scanlib
Python 3.9+. Pre-built wheels available for all major platforms. On Linux, libsane and libjpeg-turbo are required at runtime (apt install libsane-dev libturbojpeg0-dev); on other platforms, no additional dependencies are required.
Quick Start
import scanlib
scanners = scanlib.list_scanners()
with scanners[0] as scanner:
doc = scanner.scan()
with open("output.pdf", "wb") as f:
f.write(doc.data)
Documentation
Full documentation is available at python-scanlib.readthedocs.io.
About
Created by Angelo Mottola, with the help of Claude Code.
This project was started to fill a void in the Python scanning ecosystem, which I found to be very much fragmented. It is also my first experiment in heavily AI-assisted software development (I still hesitate to use the term "vibe" coding), where I mostly did code review and direction.
License
MIT
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scanlib-1.0.0.tar.gz.
File metadata
- Download URL: scanlib-1.0.0.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d1e8cdbb8d8285c9a48b8164c44ea0ac78d61ef461f745f93ee0bee0267d8a
|
|
| MD5 |
1e8266d4e39c1c3c1a55b6b62e62fdb1
|
|
| BLAKE2b-256 |
96f706eaf757ae325cf31d2cfe5f9da517792ded953c74ad5826504a4a19b1d3
|
Provenance
The following attestation bundles were made for scanlib-1.0.0.tar.gz:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0.tar.gz -
Subject digest:
70d1e8cdbb8d8285c9a48b8164c44ea0ac78d61ef461f745f93ee0bee0267d8a - Sigstore transparency entry: 1092982704
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp314-cp314t-win_amd64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp314-cp314t-win_amd64.whl
- Upload date:
- Size: 53.3 kB
- Tags: CPython 3.14t, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a8a574139856153b1de00849f2c5617134ba5bf47ebb19b4c01509059ecb39
|
|
| MD5 |
0acf85f98cb91f3eb14f11d34d203e3c
|
|
| BLAKE2b-256 |
4f2a2911798ff93a2eecf189cccf8d3a40ab5d95251fc19f611f992b9de9b117
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp314-cp314t-win_amd64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp314-cp314t-win_amd64.whl -
Subject digest:
75a8a574139856153b1de00849f2c5617134ba5bf47ebb19b4c01509059ecb39 - Sigstore transparency entry: 1092982883
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 207.5 kB
- Tags: CPython 3.14t, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364f5a7a7bac854b5f0d4f6e3a6c865ad06395dc125c3f3076359bcc2d385075
|
|
| MD5 |
25dd7955a451293e3fb1df1815e72a56
|
|
| BLAKE2b-256 |
8d3424be54c2ed3ecfb30ed267381c0cd4ceef4f8d33e49ced430012dc2c127c
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
364f5a7a7bac854b5f0d4f6e3a6c865ad06395dc125c3f3076359bcc2d385075 - Sigstore transparency entry: 1092983036
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 205.0 kB
- Tags: CPython 3.14t, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c7a4506d0eb9ffc5f8413d7d0207d0bb5b5f957835831f24048ab6cdcccbff
|
|
| MD5 |
9dc1a035c5ff820ee5c4ef7efef7dd67
|
|
| BLAKE2b-256 |
976ed25e5a15842d9861231bc633c2d0735cbc9abf863b75ba1558a36d6cb3c2
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
38c7a4506d0eb9ffc5f8413d7d0207d0bb5b5f957835831f24048ab6cdcccbff - Sigstore transparency entry: 1092982943
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl.
File metadata
- Download URL: scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl
- Upload date:
- Size: 58.1 kB
- Tags: CPython 3.14t, macOS 10.15+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a3b23e9983b6aeb8e386bc2559ff5b344bc7bc9b6dfc3b4df715368633b14e5
|
|
| MD5 |
c848b16e5f1d9f040ff87a2e1f28b913
|
|
| BLAKE2b-256 |
c836e8f1ed3907300ee335dc988101d67b50a271b30807bea0cd8eda46786a77
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl -
Subject digest:
0a3b23e9983b6aeb8e386bc2559ff5b344bc7bc9b6dfc3b4df715368633b14e5 - Sigstore transparency entry: 1092982745
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 52.7 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
840b8f8c05dfd49afede3c32930e2e4d31d9e46f847729147123e846d4ec7beb
|
|
| MD5 |
b6027ea00c5f7dba1d3d68a20b4e3fdb
|
|
| BLAKE2b-256 |
777163120c8ff8c6c00292ab058e319faed29e280ca83ecf44733851a883915e
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp39-abi3-win_amd64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp39-abi3-win_amd64.whl -
Subject digest:
840b8f8c05dfd49afede3c32930e2e4d31d9e46f847729147123e846d4ec7beb - Sigstore transparency entry: 1092982791
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 200.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9bb4dbe33e386dd32049367ddb9959e76ccd22251a92059d170cdfb5953f4f2
|
|
| MD5 |
014075bb9729f13fa16fade1eb333546
|
|
| BLAKE2b-256 |
1fadb21a0a4e511177ff31a0d1af4aac08c0bba968ecb0b9d3d5152214c9695b
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
c9bb4dbe33e386dd32049367ddb9959e76ccd22251a92059d170cdfb5953f4f2 - Sigstore transparency entry: 1092983081
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 197.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4fe58b130f949f21f78d8adb0a1acf661ddc1999d262561bf476704d49f5acb
|
|
| MD5 |
3f0a20f2b6abd17cff91f6d3e016aa73
|
|
| BLAKE2b-256 |
5f445534ea138ef19c2da3a7fccc946c6faf8953ed755fd5e5b9e6c52956d2a7
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
e4fe58b130f949f21f78d8adb0a1acf661ddc1999d262561bf476704d49f5acb - Sigstore transparency entry: 1092982832
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl.
File metadata
- Download URL: scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl
- Upload date:
- Size: 57.3 kB
- Tags: CPython 3.9+, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed493f9db37e94f67597b31d0af9576650b3f07835537c5e835653864f390aaa
|
|
| MD5 |
dd866e96aaf8f275dbf55b4d35cb3b8b
|
|
| BLAKE2b-256 |
73035169d268ec263d1f2336aebe25f6be4395965cd1348596a98f85c6c12604
|
Provenance
The following attestation bundles were made for scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl:
Publisher:
wheels.yml on amottola/scanlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl -
Subject digest:
ed493f9db37e94f67597b31d0af9576650b3f07835537c5e835653864f390aaa - Sigstore transparency entry: 1092982997
- Sigstore integration time:
-
Permalink:
amottola/scanlib@1ece94e6f34faa311f90e14b536be70f88609955 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/amottola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@1ece94e6f34faa311f90e14b536be70f88609955 -
Trigger Event:
push
-
Statement type: