Python wrapper for the scanline CLI scanner tool for macOS
Project description
Scanline Python Wrapper is a wrapper library for the scanline CLI tool.
Scanline is a CLI tool to scan documents on macOS through Apple’s Image Capture Core API.
Install
You should install the scanline tool first. Jut follow instructions from its README:
Then install scanline-python-wrapper from PyPI:
pip install scanline-python-wrapper
Usage
List scanners:
>>> import scanline_wrapper
>>> scanline_wrapper.list_scanners()
['HP Color LaserJet MFP M281fdw (035F4A)', 'My other scanner']
Scan a document:
>>> import scanline_wrapper
>>> scanline_wrapper.scan_flatbed("./out.tiff")
Scan a document (more options):
>>> import scanline_wrapper
>>> scanline_wrapper.scan_flatbed(
>>> "./out.jpg",
>>> scanner="HP Color LaserJet MFP M281fdw (035F4A)",
>>> page_size=scanline_wrapper.PageSize.LETTER, # A4, LEGAL or LETTER
>>> file_format=scanline_wrapper.FileFormat.JPEG, # AUTO, PDF, TIFF or JPEG
>>> color=scanline_wrapper.Color.COLOR, # COLOR or MONOCHROME
>>> resolution=150, # DPI
>>> )
Complete documentation:
Development
To run development commands, you must install Nox first:
pip install nox
Lint
To lint the code, run the following command:
nox -s lint
To fix codding style, run:
nox -s black_fix
Run tests
To run the tests, use:
nox -s test
You can use following commands to run the tests only on a certain Python version (the corresponding Python interpreter must be installed on your machine):
nox -s test-3.9 nox -s test-3.10 nox -s test-3.11 nox -s test-3.12 nox -s test-3.13
Build the documentation
To build the Sphinx documentation, run:
nox -s gendoc
License
This wrapper is licensed under the BSD 3 Clause license
The Scanline CLI tool is licensed under the MIT license
Changelog
[NEXT] (changes on master, but not released yet):
Nothing yet ;)
v1.0.1:
misc: Replaced setup.py by pyproject.toml (@flozz)
misc: Added Python 3.13, 3.14 support (@flozz)
misc!: Removed Python 3.8, 3.9 support (@flozz)
v1.0.0:
First release
feat: List available scanners
feat: Scan a document using a flatbed scanner
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
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 scanline_python_wrapper-1.0.1.tar.gz.
File metadata
- Download URL: scanline_python_wrapper-1.0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c12af183cd9bf501c3ca9fae4efc6f5a4d4a30ed76141c5cc473ed6b8238a778
|
|
| MD5 |
b71b4e9a7515b4484d2e8a3e6c965b92
|
|
| BLAKE2b-256 |
7aa78b401351e5b9b98f7ef2e90d04c57d72a0a4c47d135eeda3b7d6f92ca59b
|
File details
Details for the file scanline_python_wrapper-1.0.1-py3-none-any.whl.
File metadata
- Download URL: scanline_python_wrapper-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89a89e327fcc5a87ead59315b7b7ddc770b682fcc3f08a77905421e2e1370d3a
|
|
| MD5 |
89cdfd4b36898e22da1275d1735afbc3
|
|
| BLAKE2b-256 |
ec2771355e507e62bf8a151ee25a761104ac36684c4718ce438d530fc27ef235
|