Skip to content

Guiding Principles

Nemo edited this page Jul 18, 2021 · 3 revisions

These are the guiding principles behind pystitcher. When in doubt regarding a change, check here.

Declarative

Stitching together complex PDFs (For simpler usecases you should instead look at pdftk or stapler) is not something that happens in one-shot. It is something you tweak and retry till you get it right. Having a declarative approach (where we use Markdown as the input language) makes for a simpler experience where your input is essentially defining the intended PDF structure.

Good Defaults

The default values should work for majority of the use-cases.

Pure Python

Relying on a dependency such as Java (for pdftk) or ghostscript ends up causing a ton of issues for users. It is better to avoid such issues by sticking to 100% python.

If something is not achievable in pure python, then let the package installation and usage experience not be hampered by such issues. In other words, gracefully degrade the user experience while allowing for most of the usecases (and warn the user at install or runtime about which features are unavailable).

Library

pystitcher should act as a generic PDF merging toolkit for other applications. (This is currently not true, as pystitcher does not have a stable API or documentation.

Avoid Command Line Arguments

CLI arguments just don't have the flexibility required for complex rules. As an example, see the complex --rule flag that pdfmerge used. pystitcher limits command line flags to the tool's functioning (debug/cleanup etc) instead of document configuration.

Python Support

Don't support unsupported python releases.

Clone this wiki locally