Skip to main content

A multiplatform document scanning library for Python

Project description

scanlib

Tests Build & Publish Documentation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scanlib-1.0.0.tar.gz (49.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

scanlib-1.0.0-cp314-cp314t-win_amd64.whl (53.3 kB view details)

Uploaded CPython 3.14tWindows x86-64

scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (207.5 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (205.0 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl (58.1 kB view details)

Uploaded CPython 3.14tmacOS 10.15+ universal2 (ARM64, x86-64)

scanlib-1.0.0-cp39-abi3-win_amd64.whl (52.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (200.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (197.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl (57.3 kB view details)

Uploaded CPython 3.9+macOS 10.9+ universal2 (ARM64, x86-64)

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

Hashes for scanlib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 70d1e8cdbb8d8285c9a48b8164c44ea0ac78d61ef461f745f93ee0bee0267d8a
MD5 1e8266d4e39c1c3c1a55b6b62e62fdb1
BLAKE2b-256 96f706eaf757ae325cf31d2cfe5f9da517792ded953c74ad5826504a4a19b1d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.0.0.tar.gz:

Publisher: wheels.yml on amottola/scanlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for scanlib-1.0.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 75a8a574139856153b1de00849f2c5617134ba5bf47ebb19b4c01509059ecb39
MD5 0acf85f98cb91f3eb14f11d34d203e3c
BLAKE2b-256 4f2a2911798ff93a2eecf189cccf8d3a40ab5d95251fc19f611f992b9de9b117

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.0.0-cp314-cp314t-win_amd64.whl:

Publisher: wheels.yml on amottola/scanlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for scanlib-1.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 364f5a7a7bac854b5f0d4f6e3a6c865ad06395dc125c3f3076359bcc2d385075
MD5 25dd7955a451293e3fb1df1815e72a56
BLAKE2b-256 8d3424be54c2ed3ecfb30ed267381c0cd4ceef4f8d33e49ced430012dc2c127c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for scanlib-1.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 38c7a4506d0eb9ffc5f8413d7d0207d0bb5b5f957835831f24048ab6cdcccbff
MD5 9dc1a035c5ff820ee5c4ef7efef7dd67
BLAKE2b-256 976ed25e5a15842d9861231bc633c2d0735cbc9abf863b75ba1558a36d6cb3c2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for scanlib-1.0.0-cp314-cp314t-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 0a3b23e9983b6aeb8e386bc2559ff5b344bc7bc9b6dfc3b4df715368633b14e5
MD5 c848b16e5f1d9f040ff87a2e1f28b913
BLAKE2b-256 c836e8f1ed3907300ee335dc988101d67b50a271b30807bea0cd8eda46786a77

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for scanlib-1.0.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 840b8f8c05dfd49afede3c32930e2e4d31d9e46f847729147123e846d4ec7beb
MD5 b6027ea00c5f7dba1d3d68a20b4e3fdb
BLAKE2b-256 777163120c8ff8c6c00292ab058e319faed29e280ca83ecf44733851a883915e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.0.0-cp39-abi3-win_amd64.whl:

Publisher: wheels.yml on amottola/scanlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for scanlib-1.0.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c9bb4dbe33e386dd32049367ddb9959e76ccd22251a92059d170cdfb5953f4f2
MD5 014075bb9729f13fa16fade1eb333546
BLAKE2b-256 1fadb21a0a4e511177ff31a0d1af4aac08c0bba968ecb0b9d3d5152214c9695b

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

File hashes

Hashes for scanlib-1.0.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e4fe58b130f949f21f78d8adb0a1acf661ddc1999d262561bf476704d49f5acb
MD5 3f0a20f2b6abd17cff91f6d3e016aa73
BLAKE2b-256 5f445534ea138ef19c2da3a7fccc946c6faf8953ed755fd5e5b9e6c52956d2a7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for scanlib-1.0.0-cp39-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ed493f9db37e94f67597b31d0af9576650b3f07835537c5e835653864f390aaa
MD5 dd866e96aaf8f275dbf55b4d35cb3b8b
BLAKE2b-256 73035169d268ec263d1f2336aebe25f6be4395965cd1348596a98f85c6c12604

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page