Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Introducing spreads: command-line workflow tool

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.
User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Introducing spreads: command-line workflow tool

Post by jbaiter » 05 Jan 2014, 17:00

I just released 0.4.2 to PyPi, so just run 'pip install --upgrade spreads' to get the latest version.

What has changed:
  • Fix for packaging issues
  • Small bugfix for older Tesseract versions, where the "--list-langs" option is not available
  • Small bugfix for terminals that don't support all UTF8 characters
spreads: Command-line workflow assistant

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Introducing spreads: command-line workflow tool

Post by jbaiter » 06 Jan 2014, 18:49

spomwii just notified me that the installation via "pip install spreads" currently installs 0.4.1, not 0.4.2.
To work around that, please download the tarball from here: https://pypi.python.org/pypi/spreads

Install it via "pip install spreads-v0.4.2.tar.gz" and you should be good!
spreads: Command-line workflow assistant

dtic
Posts: 462
Joined: 06 Mar 2010, 18:03

Re: Introducing spreads: command-line workflow tool

Post by dtic » 24 Jan 2014, 18:25

jbaiter, here is an idea. For books with only text a quicker workflow is possible by processing each image immediately after capture.

For that to work a tool that reliably autocrops whole pages is needed before scantailor. Scantailor-cli can thereafter clean the text and save the whole page ( --margins=0 --disable-content-detection --force-disable-page-detection --match-layout=false ), followed by the pdf tool.

Best case scenario: after the user captures the last page there is a pdf of the whole book only 20 or so seconds later.

I have experimented a little with this in Windows using some custom scripts (not spreads). The only obstacle is lack of fully reliable autocropping. But that should be possible to fix. Even a less than perfect tool with an autocrop fault rate of 1 in 100 pages might still give a quicker workflow even when counting time for browsing the output thumbnails and for manual reprocessing in a few cases.

shesgottageek
Posts: 10
Joined: 07 Sep 2010, 08:19

Re: Introducing spreads: command-line workflow tool

Post by shesgottageek » 30 Jan 2014, 21:35

Hi there and thank you for what looks like will be a terrific tool! I'm trying to install spreads on a Linux Mint (Cinnamon) VM and think that I'd gotten everything installed okay, but when I try to run "spread configure" I'm getting errors.

Here's the results of trying to run the install again, and then run the "spread configure" command in verbose mode. This is with the 0.4.2 version downloaded from git. Any ideas on what I should do next, and please know that I'm a Linux and Python newbie although running these commands, researching other stuff, I think I'm starting to catch on. :)

Code: Select all

(.spreads)adminuser@adminuser-VirtualBox ~/spreads $ sudo pip install -e .
Obtaining file:///home/adminuser/spreads
  Running setup.py egg_info for package from file:///home/adminuser/spreads
    [pbr] Reusing existing SOURCES.txt
Downloading/unpacking colorama<=0.2.5 (from spreads==v0.4.2.5.g41084d0)
  Downloading colorama-0.2.5.tar.gz
  Running setup.py egg_info for package colorama
    
Requirement already satisfied (use --upgrade to upgrade): pyusb>=1.0.0a3 in /usr/local/lib/python2.7/dist-packages (from spreads==v0.4.2.5.g41084d0)
Requirement already satisfied (use --upgrade to upgrade): PyYAML>=3.10 in /usr/local/lib/python2.7/dist-packages (from spreads==v0.4.2.5.g41084d0)
Requirement already satisfied (use --upgrade to upgrade): Wand>=0.3.1 in /usr/local/lib/python2.7/dist-packages (from spreads==v0.4.2.5.g41084d0)
Requirement already satisfied (use --upgrade to upgrade): stevedore>=0.9.1 in /usr/local/lib/python2.7/dist-packages (from spreads==v0.4.2.5.g41084d0)
Requirement already satisfied (use --upgrade to upgrade): futures>=2.1.4 in /usr/local/lib/python2.7/dist-packages (from spreads==v0.4.2.5.g41084d0)
Installing collected packages: colorama, spreads
  Found existing installation: colorama 0.2.7
    Uninstalling colorama:
      Successfully uninstalled colorama
  Running setup.py install for colorama
    
  Running setup.py develop for spreads
    Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
    /usr/bin/python -E -c pass
    TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
    [pbr] Reusing existing SOURCES.txt
    Creating /usr/local/lib/python2.7/dist-packages/spreads.egg-link (link to .)
    Adding spreads v0.4.2.5.g41084d0 to easy-install.pth file
    Installing spread script to /usr/local/bin
    
    Installed /home/adminuser/spreads
Successfully installed colorama spreads
Cleaning up...
(.spreads)adminuser@adminuser-VirtualBox ~/spreads $ spread --verbose configure
spreads encountered an error:
Traceback (most recent call last):
  File "/home/adminuser/spreads/spread", line 39, in <module>
    cli.main()
  File "/home/adminuser/spreads/spreads/cli.py", line 410, in main
    setup_plugin_config(config)
  File "/home/adminuser/spreads/spreads/plugin.py", line 336, in setup_plugin_config
    pluginmanager = get_pluginmanager(config)
  File "/home/adminuser/spreads/spreads/plugin.py", line 310, in get_pluginmanager
    name_order=True)
  File "/home/adminuser/.spreads/local/lib/python2.7/site-packages/stevedore/named.py", line 55, in __init__
    verify_requirements)
TypeError: _load_plugins() takes exactly 4 arguments (5 given)

(.spreads)adminuser@adminuser-VirtualBox ~/spreads $ 

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Introducing spreads: command-line workflow tool

Post by jbaiter » 03 Feb 2014, 06:14

That's due to an API change in one of the modules that I use. I have a fix ready but I still need to merge it into the master branch on GitHub, which will probably be in the next few days.
spreads: Command-line workflow assistant

shesgottageek
Posts: 10
Joined: 07 Sep 2010, 08:19

Re: Introducing spreads: command-line workflow tool

Post by shesgottageek » 03 Feb 2014, 20:15

Okay, thanks, jbaiter. I will be looking forward to it. :D

boredland
Posts: 42
Joined: 08 Jan 2014, 07:30
Number of books owned: 0
Country: Germany

Re: Introducing spreads: command-line workflow tool

Post by boredland » 18 Feb 2014, 22:08

I'm working on a little deployment kit:
https://github.com/boredland/spreadpi-upgrade

Simply create an executable script with the following content (or run that in your commandline):

Code: Select all

#!/bin/bash
echo "## Nothing fatal here. If updating."
git clone https://github.com/boredland/spreadpi-upgrade.git
echo "## Check for changes."
cd spreadpi-upgrade 
git pull
sudo ./mastershell
My idea is to use it for regular updates, but it should serve as deploment-script (install all depencies etc.) for all features of spreads. I tried it on an rpi and it worked. Feedback welcome..

User avatar
daniel_reetz
Posts: 2780
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: Introducing spreads: command-line workflow tool

Post by daniel_reetz » 19 Feb 2014, 01:36

So this script is designed to work with the stock Raspian images?

Can't wait to test this out myself! Thank you for all your software + troubleshooting + insight, boredland. Much appreciated.

boredland
Posts: 42
Joined: 08 Jan 2014, 07:30
Number of books owned: 0
Country: Germany

Re: Introducing spreads: command-line workflow tool

Post by boredland » 19 Feb 2014, 11:08

It should work on all debian-based systems. I tested it with pibang (http://pibanglinux.org/) and it works so far. Openbox has no desktop (what makes it fast) so I can't test the shortcuts (which are used for autostart too).
daniel_reetz wrote:So this script is designed to work with the stock Raspian images?
It should work better in that, than in my testing environment. It "should" (!) work in a Desktop-Setup of Debian e.g. Ubuntu, too.

PS. If you want autostart in openbox, here's how to http://openbox.org/wiki/Help:Autostart

Arche
Posts: 2
Joined: 09 Sep 2012, 20:08
E-book readers owned: 1
Number of books owned: 10000
Country: Eesti

Re: Introducing spreads: command-line workflow tool

Post by Arche » 19 Feb 2014, 11:16

Spreads looks amazing, good job!
One question though, has anybody done anything to get the canon EOS line running with it? My pair of EOS600's (Rebel T3i) is aching to get some use.. :)

And does it run under linux ARM versions? Ubuntu (studio)12.04 to be more precise..

Post Reply