Skip to main content

Python wrapper for the scanline CLI scanner tool for macOS

Project description

Github Discord PYPI Version Build Status Black License

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.8
nox -s test-3.9
nox -s test-3.10
nox -s test-3.11
nox -s test-3.12

Build the documentation

To build the Sphinx documentation, run:

nox -s gendoc

License

Changelog

  • [NEXT] (changes on master, but not released yet):

    • Nothing yet ;)

  • v1.0.0:

    • First release

    • feat: List available scanners

    • feat: Scan a document using a flatbed scanner

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

scanline-python-wrapper-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

scanline_python_wrapper-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file scanline-python-wrapper-1.0.0.tar.gz.

File metadata

File hashes

Hashes for scanline-python-wrapper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e1a0ad73225fef7444e61c87395fe2394f68bd7edb89a0dc7a1503d6fb6311a
MD5 4106c80be83d76d2322af1c9639f9776
BLAKE2b-256 8f1267194e53e899049e109b982a4ca60e8ff11b7db87238f37bc28d880a174a

See more details on using hashes here.

File details

Details for the file scanline_python_wrapper-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scanline_python_wrapper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05d0607b5e0f0211654dc321970cb7fbe208e1e8b5d5b9b3185ec61b958ab504
MD5 b4ef18acd1a99c0d8b4b676ead84ce12
BLAKE2b-256 295fae3b855950c8b4640e050610cecbc2280f68883e110cc3b31612fb363ec0

See more details on using hashes here.

Supported by

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