[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch v2 1/3] gnu: Add python-pypdf2.
From: |
Hartmut Goebel |
Subject: |
[Patch v2 1/3] gnu: Add python-pypdf2. |
Date: |
Wed, 9 Nov 2016 23:39:11 +0100 |
* gnu/packages/pdf.scm(python-pypdf2, python2-pypdf2): New variables.
---
gnu/packages/pdf.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index ee33e3c..e243006 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -784,3 +784,48 @@ the framebuffer.")
(description "@command{pdf2svg} is a simple command-line PDF to SVG
converter using the Poppler and Cairo libraries.")
(license license:gpl2+)))
+
+(define-public python-pypdf2
+ (package
+ (name "python-pypdf2")
+ (version "1.26.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyPDF2" version))
+ (sha256
+ (base32
+ "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f)) ; tests fail in Python 3 (due to str vs bytes)
+ (home-page "http://mstamy2.github.com/PyPDF2")
+ (synopsis "Pure Python PDF toolkit")
+ (description "A pure Python library built as a PDF toolkit. It is capable
+of:
+
address@hidden
address@hidden extracting document information (title, author, …)
address@hidden splitting documents page by page
address@hidden merging documents page by page
address@hidden cropping pages
address@hidden merging multiple pages into a single page
address@hidden encrypting and decrypting PDF files
address@hidden and more!
address@hidden enumerate
+
+By being pure Python, it should run on any Python platform without any
+dependencies on external libraries. It can also work entirely on StringIO
+objects rather than file streams, allowing for PDF manipulation in memory. It
+is therefore a useful tool for websites that manage or manipulate PDFs.")
+ (license license:bsd-3)))
+
+(define-public python2-pypdf2
+ (package
+ (inherit (package-with-python2 python-pypdf2))
+ (arguments
+ `(#:python ,python-2
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))))
--
2.7.4