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.1.0.tar.gz (59.0 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.1.0-cp314-cp314t-win_amd64.whl (60.7 kB view details)

Uploaded CPython 3.14tWindows x86-64

scanlib-1.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (214.7 kB view details)

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

scanlib-1.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (212.2 kB view details)

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

scanlib-1.1.0-cp314-cp314t-macosx_10_15_universal2.whl (65.3 kB view details)

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

scanlib-1.1.0-cp39-abi3-win_amd64.whl (60.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

scanlib-1.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (208.1 kB view details)

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

scanlib-1.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (205.0 kB view details)

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

scanlib-1.1.0-cp39-abi3-macosx_10_9_universal2.whl (64.6 kB view details)

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

File details

Details for the file scanlib-1.1.0.tar.gz.

File metadata

  • Download URL: scanlib-1.1.0.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scanlib-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c81d1536c6f816a8e7fc7636714ed3283fbf91d350afc5a174af7703e6a7bed3
MD5 957d2739cf576708f8c7a727ca214154
BLAKE2b-256 1595258dfecaa6400e6ba7b5279f3706fdb4cafa2ca17fb4e28497f04664ca51

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: scanlib-1.1.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 60.7 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.1.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5e4101e953022b1157339692afa749b43b4c3fe8386c804fb6dfbd7d9037a9eb
MD5 d33e6d0538bf71c485d3f7789a4a0bd4
BLAKE2b-256 6ba21841dba2951a93e4c2e9c6ec0301a5fab9275b92a8918918616857b7f1d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.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.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ab8e9cce265bcb11004f844972a6ea20773da02a979c970a09f4f0a8f37bc1c5
MD5 b80e2d2a3274326e10a5e4cc21a551ef
BLAKE2b-256 1e0fff8dde6c487fdfabec0074c2b65b1addcfafebca1dd070e083e70277b64f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scanlib-1.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4125dffcc021cbde3ad69e56f30aa3b3a765c1673743ae5d414d0749569e15dc
MD5 3adb04e9638d18b1e001545ddfee249c
BLAKE2b-256 e82b0eb0a2422035b16544558a58496a6db31e93d4a0c9fdf25f14e6b250cbe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp314-cp314t-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for scanlib-1.1.0-cp314-cp314t-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 85b598e78c6fb2d4beea9e60f5e3a6343828119494de8ff94b5d8ff842846f94
MD5 bd534d5424d9965c413655b6adc8c6ed
BLAKE2b-256 e8d9882541f2a78e7672e989a6de0693f053774d37f569c25e46723eb7be61fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: scanlib-1.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 60.0 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.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 206b3ac8d620ea90148ba1c86335f40c6b248c960e9c8df1af6ab983200fec7b
MD5 e4b52cfe036ac492d3a429a1e9c877dd
BLAKE2b-256 7816ca1cdcb9047648a2a3ce8f3ef75ae7ef9bf456827e0c544dbc7f1eeb5668

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.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.1.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e069fa9baf4d2eb294379a996efbfff9173daf961f05bdf3853d7a3b11baecc4
MD5 8b8be4374c97b0bc9ac535b56924f33f
BLAKE2b-256 9ebc098e1cbd259d25b282242b38e6fdd0b387336454d3d6be118f488b8f785e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scanlib-1.1.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 43086c1d63f59e2a3138984ccbf8305b5bb8deff11054959973c7d420f46e601
MD5 636246345796e091b49869d5fa78035b
BLAKE2b-256 5ce58f2c777719149dbf1fa9f0157d58e663b1ebe15cf913f396196562f10a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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.1.0-cp39-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for scanlib-1.1.0-cp39-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 63b19c361b90212b08c0c14c3256558020c71c39c04213dbb53b7fa6948530ee
MD5 143309d06d3fd2fafaa63c985e9159e6
BLAKE2b-256 86ba5a497655d581223311498cc900da77eff5b2a4001dd66a61908e717380b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for scanlib-1.1.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