pdftools
small collection of python scripts for pdf manipulation
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
small collection of python scripts for pdf manipulation
Basic Info
- Host: GitHub
- Owner: stlehmann
- License: mit
- Language: Python
- Default Branch: master
- Size: 95.7 KB
Statistics
- Stars: 94
- Watchers: 4
- Forks: 19
- Open Issues: 9
- Releases: 8
Metadata Files
README.md
pdftools
- Copyright (c) 2015 Stefan Lehmann
- License: MIT
- Description: Python-based command line tool for manipulating PDFs. It is based on the PyPdf2 package.
Features
- add, insert, remove and rotate pages
- split PDF files in multiple documents
- copy specific pages in a new document
- merge or zip PDF files into one document
Usage
pdftools adds some scripts to your existing Python installation that can be called via the command line. The description for each script is listed below.
pdftools
```
usage: pdftools [-h] [-V]
Python-based command line tool for manipulating PDFs. It is based on the PyPdf2 package.
optional arguments: -h, --help show this help message and exit -V, --version Print version number and exit (default: False)
Sub-commands:
Add
``` usage: pdftools add [-h] [-p PAGES [PAGES ...]] [-o OUTPUT] dest src
Add pages from a source file to an output PDF file
positional arguments: dest Destination PDF file src PDF source file
optional arguments:
-h, --help show this help message and exit
-p PAGES [PAGES ...], --pages PAGES [PAGES ...]
list of pages to add to the output. Examples: 5; 1-9;
1-; -9 (default: None)
-o OUTPUT, --output OUTPUT
Name of the output file. If None, the dest file will
be overwritten (default: None)
```
Copy
``` usage: pdftools copy [-h] [-o OUTPUT] [-p PAGES [PAGES ...]] [-y] src
Copy specific pages of a PDF file in a new file
positional arguments: src Source PDF containing pages to copy
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Name of the output file. If None, the dest file will
be overwritten (default: None)
-p PAGES [PAGES ...], --pages PAGES [PAGES ...]
list of pages to copy in the new file. Examples: "5 8
10": Pages 5, 8, 10; "1-9": Pages 1 to 9; "5-": Pages
from 5 to last page; "-9": Pages from beginning to 9
(default: 1)
```
Insert
``` usage: pdftools insert [-h] [-o OUTPUT] [-p PAGES [PAGES ...]] [-i INDEX] dest src
Insert pages of one file into another
positional arguments: dest Destination PDF file src Source PDF file
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Name of the output file. If None, the dest file will
be overwritten (default: None)
-p PAGES [PAGES ...], --pages PAGES [PAGES ...]
List of page numbers (start with 1) which will be
inserted. If None, all pages will be inserted
(default). Examples: 5; 1-9; 1-; -9 (default: None)
-i INDEX, --index INDEX
Page number (1-indexed) of destination file where the
pages will be inserted. If None they will be added at
the end of the file (default: None)
```
Remove
``` usage: pdftools remove [-h] [-o OUTPUT] src pages [pages ...]
Remove pages from a PDF file
positional arguments: src PDF source file pages List of pages to remove from file. Examples: 5; 1-9; 1-; -9
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Name of the output file. If None, the src file will
be overwritten (default: None)
```
Rotate
``` usage: pdftools rotate [-h] [-d {90,180,270}] [-c] [-p PAGES [PAGES ...]] [-o OUTPUT] src
Rotate the pages of a PDF file by a set number of degrees
positional arguments: src Source file
optional arguments: -h, --help show this help message and exit -d {90,180,270}, --degrees {90,180,270} Specify degrees value to rotate page(s) (default: 90) -c, --counter-clockwise Rotate pages counter-clockwise instead of clockwise, by default (default: False) -p PAGES [PAGES ...], --pages PAGES [PAGES ...] List of page numbers which will be rotated. If None, all pages will be rotated. Examples: 5; 1-9; 1-; -9 (default: None) -o OUTPUT, --output OUTPUT Output filename. If None, the source file will be overwritten (default: None) ```
Split
``` usage: pdftools split [-h] [-o OUTPUT] [-s STEPSIZE] [-q SEQUENCE [SEQUENCE ...]] src
Split a PDF file into multiple documents
positional arguments: src Source file to be split
optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT Output filenames. If None, will append page numbers to the input file name. (default: None) -s STEPSIZE, --stepsize STEPSIZE How many pages are packed in each output file (default: 1) -q SEQUENCE [SEQUENCE ...], --sequence SEQUENCE [SEQUENCE ...] Sequence of numbers describing how many pages to put in each outputfile (default: None) ```
Merge
``` usage: pdftools merge [-h] [-o OUTPUT] [-d] src [src ...]
Merge the pages of multiple input files into one output file
positional arguments: src List of input source files
optional arguments: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT Output filename (default: merged.pdf) -d, --delete Delete source files after merge (default: False) ```
Zip
``` usage: pdftools zip [-h] [-d] [-r] src1 src2 output
Python-like zipping (interleaving) the pages of two documents in one output file
positional arguments: src1 First source file src2 Second source file output Name of the output file
optional arguments: -h, --help show this help message and exit -d, --delete Delete source files after merge (default: False) -r, --revert Revert the pages of second input file (default: False) ```
Owner
- Name: Stefan Lehmann
- Login: stlehmann
- Kind: user
- Location: Leipzig, Germany
- Company: Kunststoff-Zentrum Leipzig
- Website: http://mrl33h.de
- Twitter: MrL33h
- Repositories: 120
- Profile: https://github.com/stlehmann
automation engineer, Python developer, hobby brewer
GitHub Events
Total
- Watch event: 3
- Fork event: 2
Last Year
- Watch event: 3
- Fork event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| MrLeeh | S****n@g****m | 44 |
| James Hawley | j****y@g****m | 22 |
| Stefan Lehmann | s****m@p****e | 13 |
| stiftcast | s****t@g****m | 7 |
| Stefan Lehmann | s****n@g****m | 5 |
| Christian | c****n@g****m | 2 |
| agricolab | r****e@g****e | 1 |
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 12
- Total pull requests: 10
- Average time to close issues: 8 months
- Average time to close pull requests: 2 months
- Total issue authors: 11
- Total pull request authors: 7
- Average comments per issue: 2.25
- Average comments per pull request: 1.2
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cjfp (2)
- jirmed (1)
- agricolab (1)
- ryukinix (1)
- g2boojum (1)
- SrikanthBhandary (1)
- stlehmann (1)
- MartinThoma (1)
- alexizmailov (1)
- sjvrijn (1)
- mfeif (1)
Pull Request Authors
- stiftcast (2)
- petermao (2)
- dependabot[bot] (2)
- jrhawley (1)
- agricolab (1)
- ChristianRinn (1)
- pmgagne (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,714 last-month
- Total dependent packages: 0
- Total dependent repositories: 9
- Total versions: 17
- Total maintainers: 1
pypi.org: pdftools
A collection of convenience scripts for PDF manipulation, based on the PyPdf2 package
- Homepage: https://github.com/stlehmann/pdftools
- Documentation: https://pdftools.readthedocs.io/
- License: MIT
-
Latest release: 2.0.2
published about 6 years ago
Rankings
Maintainers (1)
Dependencies
- PyPDF2 ==1.25.1
- PyPdf2 *