stlehmann / pdftools

small collection of python scripts for pdf manipulation
MIT License
93 stars 19 forks source link

Universal CLI for all tools #8

Closed jrhawley closed 4 years ago

jrhawley commented 4 years ago

Hi @stlehmann,

I don't know if you're still actively maintaining this repo or not, but I recently stumbled upon it and think it's great and it has all the nice functionality I've wanted in a command line tool for manipulating PDFs.

What I wanted to have was a universal CLI command to call, with each tools as a sub-command, instead of having pdfmerge.py, pdfsplit.py, etc in my PATH and calling those commands.

So in this PR, I've refactored the code to have a single entry point (pdftools), with all the appropriate functions as sub-commands (e.g. pdftools merge). I've also formatted some of the arguments to have consistent naming and help statements to try and help with clarity.

If you don't want to merge this PR that's cool, I don't mind. I figured if I refactored this code to make the tool more accessible for myself, then you/others might be interested in it too.

stlehmann commented 4 years ago

Hey James, thank you for your PR. This is one of my first open-source repositiories and as you could see I haven't touched it for a long time. However, I would like to keep it up-to-date. I like your idea of using one common entrypoint for all commands. I will have a look at your proposed changes and review your PR asap.

jrhawley commented 4 years ago

I just pushed a few commits to address your earlier points, but it looks like the TravisCI checks are failing. I looked into them and it looks like there's an issue with Travis setting up Python 3.2 and 3.3 environments. v3.4 - nightly appear to be passing, though

stlehmann commented 4 years ago

That looks great. Thanks lots for your effort here. It think these changes demand for a new mayor version. I'll merge this and take care of the rest.