Package Details: stapler 1.0.0-4

Git Clone URL: https://aur.archlinux.org/stapler.git (read-only, click to copy)
Package Base: stapler
Description: A small utility making use of the pypdf library to provide a (somewhat) lighter alternative to pdftk
Upstream URL: https://github.com/hellerbarde/stapler
Licenses: BSD
Conflicts: stapler-git
Submitter: biginoz
Maintainer: PhCl
Last Packager: PhCl
Votes: 90
Popularity: 0.071047
First Submitted: 2010-08-26 17:32 (UTC)
Last Updated: 2020-08-27 11:31 (UTC)

Pinned Comments

PhCl commented on 2020-12-09 17:08 (UTC)

As python 3.8 was replaced by python 3.9, you could run into the following error:

Traceback (most recent call last):
  File "/usr/bin/stapler", line 5, in <module>
    from staplelib import main
ModuleNotFoundError: No module named 'staplelib'

To solve it, rebuild "python-pypdf2" and then "stapler". Then the directories for Python 3.9 should exist.

Latest Comments

m040601 commented on 2021-07-20 15:39 (UTC) (edited on 2021-07-21 18:11 (UTC) by m040601)

This is a very usefull tool and apparently gets a lot of votes too. Thanks to everyone involved in providing these very usefull python pdf tools.

Stapler doesnt get many github commits (last one are from more than one year ago). And it can be a lot of trouble work to maintain the PKGBUILD due to the dependency on python-pypdf2.

Just want to chime in and suggest an alternative than may also be interesting to the same maintainers and users of this PKGBUILD.

captn3m0/pystitcher: pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative markdown file as input

  • It seems polished and provides the same stapling/stiching functionality.

  • also published on pypi

  • it dependes not on pypdf2, but pypd3

Pypdf3 seems better maintained. sfneal/PyPDF3: A utility to read and write PDFs with Python , which is also on pypi . https://pypi.org/project/PyPDF3/

Pypdf3 is already on AUR, https://aur.archlinux.org/packages/python-pypdf3

Pypdf2 last commits are from 2018.

I did a quick test and it seems to work as it says on the can:

It seems to work perfectly with:

pipx install pystitcher

or

python -m venv testing_pystitcher

cd ./testing_pystitcher

source bin/activate

pip install pypdf3

pip install pystitcher


PhCl commented on 2020-12-09 17:08 (UTC)

As python 3.8 was replaced by python 3.9, you could run into the following error:

Traceback (most recent call last):
  File "/usr/bin/stapler", line 5, in <module>
    from staplelib import main
ModuleNotFoundError: No module named 'staplelib'

To solve it, rebuild "python-pypdf2" and then "stapler". Then the directories for Python 3.9 should exist.

PhCl commented on 2020-08-27 11:33 (UTC)

@ganymede: Thanks, added makedepends "python-pip". @rcrath: Not sure how it can happen, but I changed it to "rm -f" for now, so it should ignore the error if "/usr/bin/pdf-stapler" does not exist.

rcrath commented on 2020-08-24 21:22 (UTC)

update fails with

Installing collected packages: stapler
Successfully installed stapler-1.0.0
rm: cannot remove '/run/media/rich/8TbSeagate/yay/stapler/pkg/stapler/usr/bin/pdf-stapler': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...
error making: %!s(func() string=0x55b0858a3410)

ganymede commented on 2020-08-22 18:07 (UTC)

Thanks for the change. It introduces a dependency on pip, so please add 'python-pip' to makedepends (this package is only optional for python, therefore it's not necessarily installed).

PhCl commented on 2020-08-19 19:25 (UTC)

Alright, unless someone can bring up a good reason against it, I'll change it on the weekend.

pigmonkey commented on 2020-08-18 19:05 (UTC)

I also do not have a strong preference, but the stapler-git structure feels slightly more appropriate to me.

PhCl commented on 2020-08-18 18:49 (UTC)

@m040601 Hi, I adopted the project, so I can only speculate for the reasons of choosing /opt. According to https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories, /opt should be used for "Large self-contained packages".

It is not large, but arguably self-contained. Or is it a use case to use the library, not just the executable? (I only use the /usr/bin/stapler executable.)

I don't have a strong opinion for either way. As m040601 pointed out, the stapler-git shows how it can be done, so it should not be hard. If it is a better structure, I can change it.

m040601 commented on 2020-08-16 11:10 (UTC) (edited on 2020-08-16 11:16 (UTC) by m040601)

Why does it install to /opt ?

$ pacman -Ql stapler

stapler /opt/
stapler /opt/stapler/
stapler /opt/stapler/CONTRIBUTORS
stapler /opt/stapler/LICENSE
stapler /opt/stapler/MANIFEST.in
stapler /opt/stapler/README.rst
stapler /opt/stapler/TODO
stapler /opt/stapler/poetry.lock
stapler /opt/stapler/pyproject.toml
stapler /opt/stapler/staplelib/
stapler /opt/stapler/staplelib/__init__.py
stapler /opt/stapler/staplelib/commands.py
stapler /opt/stapler/staplelib/iohelper.py
stapler /opt/stapler/staplelib/stapler.py
stapler /opt/stapler/staplelib/testfiles/
stapler /opt/stapler/staplelib/testfiles/1page.pdf
stapler /opt/stapler/staplelib/testfiles/5page.pdf
stapler /opt/stapler/staplelib/tests.py
stapler /opt/stapler/stapler
stapler /opt/stapler/tox.ini
stapler /usr/
stapler /usr/bin/
stapler /usr/bin/stapler

staple-git doesnt do this, https://aur.archlinux.org/packages/stapler-git Everything goes nicely into /usr/bin, /usr/share, /usr/lib/python..

PhCl commented on 2020-03-10 21:56 (UTC)

@Storm You're right! Thanks, I added it.

Storm commented on 2020-03-09 22:45 (UTC)

Seems like it's also missing a dep to "more-itertools" (available in community).

PhCl commented on 2020-01-17 00:31 (UTC)

@cg505 Thanks, I added git.

cg505 commented on 2020-01-17 00:11 (UTC)

@PhCl Please add git as a makedepends.

PhCl commented on 2020-01-12 16:20 (UTC)

As there is no official release, I changed it now to the last Git tag (master from Dec 15 2019), so Python 2 support is no longer needed. If there is a new release, that hack should be reverted.

In my quick test, the master version works but I cannot claim that I tested all paths.

oriba commented on 2019-12-03 11:11 (UTC)

@m040601, ok. You might start with a list of needed minimal features...

m040601 commented on 2019-12-03 08:52 (UTC) (edited on 2019-12-03 08:54 (UTC) by m040601)

@PhcI

Thanks for your work and attention to this issue.

.......QUOTE: although personally I would prefer an official release......

Yes, I also agree. Went to the stapler github repo, and on a second thought, not yet 100% convinced of that project ability to release. Let's wait.

m040601 commented on 2019-12-03 08:49 (UTC) (edited on 2019-12-03 09:01 (UTC) by m040601)

@oriba:

......QUOTE:it would make sense to have a list of features that really are needed as a minimal replacement for stapler (or pdftk)........

Could not agree more with you. A solid and reliable pdf tool that does this job is a must.

...... QUOTE: I started writing some pdf-tools for myself a while ago,....I might put them on github or so.....

Please do. I'd be happy to provide feedback help with docs etc... (no dev skills)

By the way, apropos PDF tooling, theres the Talk page, https://wiki.archlinux.org/index.php/Talk:PDF,_PS_and_DjVu on the excelent Arch Wiki PDF et al tools overview page

oriba commented on 2019-11-28 00:09 (UTC)

@m040601: oh, relly, they did it? Stapler undead?

oriba commented on 2019-11-28 00:05 (UTC)

In my eyes, the stapler-project is dead. Tried to contact the developer regarding some issues, and the release-numbering was one of the issues. Since months no answer. I started writing some pdf-tools for myself a while ago, nevertheless using stapler quite often. But maybe I will switch to my own tools completely one day. If other people would be interested, I might put them on github or so. But it would make sense to have a list of features that really are needed as a minimal replacement for stapler (or pdftk). At the moment I'm not sure what the current status of stapler is - which possibilities it offers, because I did not checked the current development version of it. Also the syntax of the commands maybe could be better. A Python3-release for Stapler is asked for by different peoples over months. So... a list of minimal commands might encourage me to write a new tool (or set of tools) for pdf-manipulation. Some kind of task-list for the Xmas holidays ;-)

PhCl commented on 2019-11-27 21:18 (UTC)

I'm adopting the package now (unless someone else wants?). The release policy on upstream is a bit confusing, 0.3.2 is indeed newer than 0.4, but both are extremely outdated (2015). Python 3 compatibility came recently, but is only on head. I would wait a bit for the discussion here: https://github.com/hellerbarde/stapler/issues/51 Ideally, there will be an official release to which we can update. Otherwise, bypassing the release and switching to a Git commit would be a temporary workaround, although personally I would prefer an official release.

m040601 commented on 2019-11-23 23:02 (UTC)

Please remove the python2 dependency. Not needed anymore:

https://github.com/hellerbarde/stapler/pull/55 This makes stapler Python 3 compatible while keeping compatibility with Python 2.7,

oriba commented on 2019-06-19 00:12 (UTC)

If looking on github, release 0.3.2 came after 0.4. Don't know why. But it seems to be more recent code, even though it also is old. Could you check, if the 0.3.2 is really newer and if so, could you please update the AUR-package?

Maxr commented on 2015-05-26 11:38 (UTC)

md5sums is wrong. Should be cdcde78931514816a39822952a34a05b

stratosmacker commented on 2015-04-06 22:14 (UTC)

decimal.InvalidOperation: Invalid literal for Decimal: '0.0000-11728996' Is what happens on any "stapler cat" command for me

bjo commented on 2014-06-03 05:41 (UTC)

Amazing. No setup.py.

bjo commented on 2014-06-03 04:37 (UTC)

Thanks for the hint, I will update it.

luukko commented on 2014-06-03 04:34 (UTC)

There appears to be a maintained fork at https://github.com/fwenzel/stapler

olebowle commented on 2012-10-24 17:46 (UTC)

Please update the dependency to python2-pypdf.

biginoz commented on 2011-07-01 19:50 (UTC)

Excuse-me, i put the file on good way! :)

Maxr commented on 2011-07-01 06:17 (UTC)

I'm getting 404 when trying to download.

biginoz commented on 2010-12-07 17:55 (UTC)

updated

firecat53 commented on 2010-10-26 17:49 (UTC)

Needs update for python2.