• Stars
    star
    389
  • Rank 109,763 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

pystitcher

PyPI Version Repository License GitHub branch checks status Codecov

pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a markdown file. It is written in pure python and uses PyPDF3 for reading and writing PDF files.

Installation

You can install it easily using pipx:

pipx install pystitcher

The Wiki has Alternative Installation Instructions.

Description

pystitcher is a command line tool, with very few cli options:

usage: pystitcher [-h] [--version] [-v] [--cleanup | --no-cleanup] spine.md output.pdf

Stitch PDF files together

positional arguments:
  spine.md              Input markdown file
  output.pdf            Output PDF file

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         log more things
  --cleanup, --no-cleanup
                        Delete temporary files (default: True)

Given this input:

existing_bookmarks: remove
title: Complete Guide to the Personal Data Protection Bill
author: Medianama
keywords: privacy, surveillance, personal data protection
subject: Personal Data Protection Bill
# A Complete Guide to the Personal Data Protection Bill

- [Cover](cover.pdf)

# The Bills

- [Personal Data Protection Bill, 2019](https://example.com/2019-bill.pdf)
- [Personal Data Protection Bill, 2018](https://example.com/2018-bill.pdf)

# Other key reading material

- [Srikrishna Committee Report](2.a.pdf)
- [Dvara Research's Personal Data Protection Bill](2.b.pdf)
- [MP Shashi Tharoor's Data Protection Bill](2.c.pdf)
- [MP Jay Panda's Data Protection Bill](2.d.pdf)
- [SaveOurPrivacy.in bill](2.e.pdf)
- [TRAI recommendations on privacy](2.f1.pdf)
- [Comments on TRAI recommendations on privacy](2.f2.pdf)

Will generate a PDF with proper bookmarks:

https://i.imgur.com/qPVpZGt.png

And the correct metadata:

Title:          Complete Guide to the Personal Data Protection Bill
Subject:        Personal Data Protection Bill
Keywords:       privacy, surveillance, personal data protection
Author:         Medianama
Creator:        pystitcher/1.0.0
Producer:       pystitcher/1.0.0

Configuration options can be specified with Meta data at the top of the file.

Option Notes
fit Default fit of the bookmark. Can be overwritten per bookmark See wiki for more details.
author PDF Author
keywords PDF Keywords
subject PDF Subject
title PDF Title. If left unspecified, first Heading (h1) in the document is used.
existing_bookmarks What to do with existing bookmarks in individual files. Options are keep, flatten, and remove. See docs for more details.

Additionally, PDF links specified in markdown can have attributes to alter the PDFs before merging. The below attribute will rotate the second PDF file by 90 degrees clockwise before merging:

[Part 1](1.pdf)
[Part 2](2.pdf){: rotate="90"}

And the below attribute will merge only pages 2 to 5, both inclusive, from the second PDF file:

[Part 1](1.pdf)
[Part 2](2.pdf){: start=2 end=5}

The list of available attributes are:

Attribute Notes
rotate Rotate the PDF. Valid values are 90, 180, 270
start Start page number for PDF page selection
end End page number for PDF page selection

Documentation

Additional documentation is maintained on the project wiki on GitHub.

More Repositories

1

google-sre-ebook

Google SRE Book Generator (EPUB/MOBI/PDF).
Shell
1,208
star
2

ideas

🚀 Ideas for everyone under a CC licence. Feel free to use. I'll send you a postcard if you build anything on this list.
418
star
3

boardgame-research

List of research around modern boardgames.
XSLT
357
star
4

ifttt-webhook

♻️ A webhook middleware for the ifttt.com service
PHP
302
star
5

hackertray

ℹ️ HackerTray is a minimalist Hacker News app for Linux
Python
248
star
6

hello-cloudflare

A public letter to Cloudflare to fix their snoopy vendor
242
star
7

plaintext-everything

📝 A list of tools and articles helpful for keeping everything under plaintext.
118
star
8

the-joy-of-software-development

📘 A book for Software Developers who want to expand their knowledge. Encompassing various languages, tools, frameworks and technologies, it aims to improve your understanding of Software Development.
Shell
96
star
9

nebula

Source Code for the Home Server setup.
HCL
56
star
10

constitution

Constitution of India, in plain text (with git history)
40
star
11

cosmere-books

Script to build EPUB/MOBI/PDF versions of various books by Brandon Sanderson
HTML
39
star
12

jqaas

jq as a service
PHP
32
star
13

indiapost-tracker

India Post tracker API
Python
31
star
14

sanskari-proxy

A proxy for security researchers outside India to access Indian government websites without resorting to shady VPNs.
29
star
15

potion

Potion is github-pages compatible editor for jekyll blogs.
JavaScript
26
star
16

security-engineering-ebook

Script to generate a combined PDF for the Security Engineering 3rd edition book from the publicly available chapters under review.
Shell
25
star
17

Scripts

🏃 I keep lots of small scripts in the ~/scripts directory. Added it to path as well
Perl
20
star
18

india-isin-data

International Securities Identification Numbers for various Indian Securities
Shell
20
star
19

dotfiles

My dotfiles, managed using GNU stow
Perl
20
star
20

codechef

Codechef Problems viewer with an offline copy of all practice problems from codechef
PHP
20
star
21

amon

amon is a hacking tool for maintaining access to accounts using oauth tokens, instead of passwords.
Ruby
17
star
22

sympathy

Local File Editor for Chrome using NPAPI
JavaScript
17
star
23

disable-web-fonts

Disables Custom Fonts across all website. Saves Bandwidth. Blocks Trackers
JavaScript
17
star
24

configurator

Javascript configuration library to handle an application's configuration. Stores config to localstorage.
JavaScript
13
star
25

mf.captnemo.in

Get information about Indian Mutual Funds from their ISIN numbers.
Ruby
13
star
26

muse-dl

Download and stitch books from Project MUSE
Crystal
12
star
27

url-to-epub

A simple script that generates an EPUB from a single URL, zero-config
JavaScript
12
star
28

cctc3-solutions

Solutions to Round 1 of the CCTC Wave III Contest (Jeopardy style CTF)
PHP
11
star
29

youtube-cue

Generate CUE sheet from timestamps in youtube video description
JavaScript
11
star
30

nullcon2014

Source code for my talk on browser extension security
Ruby
11
star
31

uservoice

Clone of uservoice based on Kohana
PHP
10
star
32

outliner

A simple HTTParty based wrapper for the Outline API. Comes with ready scripts to import|export content from Outline.
Ruby
10
star
33

multiplayerchess.com

MultiplayerChess.com Source Code
JavaScript
10
star
34

tls.wtf

A hands-on workshop on using OpenSSL for TLS
Dockerfile
9
star
35

eteled

@eteled is a github bot that auto-deletes future comments from a discussion
Ruby
9
star
36

india-mutual-fund-ter-tracker

Tracking Total Expense Ratios of Indian Mutual Funds. Automatically updated daily.
HTML
9
star
37

what-to-read

Peppers your goodreads to-read list with amazon links
Ruby
8
star
38

gringotts

Personal expenses tracker over Ecommerce applications
Ruby
7
star
39

epub-metadata-generator

Generates a metadata.xml file for an EPUB from various online sources, can be used with pandoc
JavaScript
7
star
40

quick-list-select

Ever had a long list that needed to be marked Yes / No and you wanted to do it faster than Excel?
HTML
6
star
41

ickabog-ebook

Script to generate PDF and EPUB for "The Ickabog" by J.K Rowling
Shell
6
star
42

lightsaber

DNS - 30x Redirect hosted service
Ruby
6
star
43

historical-mf-data

Historical Mutual Funds data
Python
5
star
44

opml-gen

Ruby
5
star
45

magicmuggle

Script to build EPUB/MOBI/PDF versions of "Magic Muggle" book
Ruby
5
star
46

sushigo

Ruby
5
star
47

kerala-it-policy-draft

A markdown version of the Kerala State Information Technology Policy (Draft)
5
star
48

modernart

This is a MiniZinc based attempt to solve the Modern Art: Masters Gallery game.
PHP
4
star
49

obtvse-editor

DEPRECATED REPOSITORY See Potion
JavaScript
4
star
50

musicfellas-downloader

Simple Downloader for musicfellas.com
Shell
4
star
51

india-pincode-regex

A simple regex based exhaustive validator for PIN codes in India
JavaScript
4
star
52

jekyll-sqlite

A Jekyll plugin that lets you use SQLite database instead of data files as a data source.
Ruby
4
star
53

crypto.koans

crypto.koans are koans to help you learn openssl/tls/curl practical usage
PHP
4
star
54

prometheus-act-exporter

Exposes your current ACT Fibernet Internet usage as prometheus metrics. Scrapes the data from the ACT Portal website by using puppeteer.
JavaScript
4
star
55

tabcoin

Ruby
3
star
56

pget

Download Manger using PyGTK with multi-threaded download support
Python
3
star
57

suntime

Crystal library for calculating sunrise and sunset times.
Crystal
3
star
58

goosh

Fork of the original goosh shell (goosh.org). Modified with my own extensions for specific purposes
JavaScript
3
star
59

news

Plain-Text India-focused News
HTML
3
star
60

hackertray-win

Port of captn3m0/hackertray to Windows using node-webkit
JavaScript
3
star
61

forteller-dl

Downloads MP3 files from Foreteller Games, without using the app. You must purchase the media first from https://www.fortellergames.com/.
PHP
3
star
62

channeli-notice-fixer

This extension fixes the broken links in Channel I notices
JavaScript
2
star
63

muse-ebook-downloader

Archived. See muse-dl instead
Shell
2
star
64

npci-rss-feeds

RSS Feeds for various NPCI Circulars and Notifications.
Smarty
2
star
65

elibsrv

GitHub mirror for elibsrv
C
2
star
66

wona

WoNA Archives (IITR News Magazine)
HTML
2
star
67

pdp-book

HTML
2
star
68

ics-to-html

Script to publish an ICS calendar as HTML
Ruby
2
star
69

avatars

This repository contains the various avatars, and wallpapers that I use.
2
star
70

nand2tetris

The Elements of Computing Systems, My Workbook for the NAND to Tetris course.
Assembly
2
star
71

never-say-you-cant-survive

Script to generate an ebook for "Never Say You Can't Survive" - book by Charlie Jane Anders.
Ruby
2
star
72

Minerva

Minerva is a simple ebook scanning system, which uses amazon's Product Search API along with google book search to generate metadata for each book. It does full text indexing using Zend_Lucene in PHP.
PHP
2
star
73

ifttt-evernote

ifttt-webhook plugin for adding articles to evernote. Uses the readability API
PHP
2
star
74

pocket-channel-i

@IMGIITRoorkee's pocket-channel-i chrome extension without the "tabs" privilege.
JavaScript
2
star
75

ariel

Ariel is a real time collaborative code editor
JavaScript
2
star
76

gothok

A Game of Thrones: Hand of the King
Python
2
star
77

kuvera-unofficial-api-specification

Unofficial Specification for the Kuvera read APIs
HTML
2
star
78

akira-backend

Akira backend written using Limonade
PHP
2
star
79

hoshruba

Script to build EPUB/MOBI/PDF versions of "Hoshruba: The Land and the Tilism" book
CSS
1
star
80

msgboy

Msgboy pushes your web to your browser!
JavaScript
1
star
81

talks

Some Talks...
HTML
1
star
82

find-my-constituency

Python
1
star
83

terraform-docker-kayak

HCL
1
star
84

terraform-http-setcronjob-whitelist

Terraform Module that returns the latest SetCronJob IP Whitelist: https://support.setcronjob.com/hc/en-us/articles/219802207-SetCronJob-IP-addresses-list
HCL
1
star
85

tld-a-record

CSS
1
star
86

opengram

Elixir
1
star
87

dorycms

Little, simple, and made for developers who want their designs to be quickly integrated into the website.
JavaScript
1
star
88

aur-python-present

Arch package for the python present package
Shell
1
star
89

google-swe-ebook

Google SWE EBook Generator (PDF/EPUB)
Python
1
star
90

cneditor

PHP
1
star
91

projecteuler.net

My solutions of Project Euler problems
C++
1
star
92

electron-fingerprints

Generates fingerprints for electron version detection by downloading electron releases and generating checksums of the files contained in each release.
PHP
1
star
93

thesetup

Analysis of hardware/software used by people featured on The Setup (usesthis.com)
Shell
1
star
94

phreak

PHreak shows you latest hunts in your system tray (Linux-only)
Python
1
star
95

asmodee-owns-it

List of boardgames showing Asmodee's dominance in the boardgame industry
PHP
1
star
96

captn3m0

GitHub Profile page
1
star
97

frakjs

JavaScript
1
star
98

js-guard

Source code for the JS-Guard extension by CDAC.
JavaScript
1
star
99

hacker

Hacker was a text-based game I wrote long time ago in my 8th grade. Compiles only in Turbo C++
1
star
100

chrome-pin-keyboard-shortcut

Creates a keyboard shortcut (Ctrl+Shift+A) to toggle the pinned state of the current tab.
JavaScript
1
star