Package: pdfebc-web
DocsContentsOverviewRequirementsInstallOption 1: Install from PyPi withpipOption 2: Clone the repo and the install withpipHow to runLicenseContributingOverviewpdfebc-webis the web based part of the set ofpdfebc-coreinterfaces. The app is primarily
built withFlask, butCeleryhandles CPU-intensive background tasks, such as compressing pdf files.
This is mostly a toy project for me to learn Flask, but someone, somewhere may find it
useful someday. Currently, the features include uploading pdf files, compressing them, and
having them sent to a pre-configured e-mail address.RequirementsAside from the Python modules listed inrequirements.txt, the following requirements must be
met:Python 3.6Strictly speaking, 3.5 should also work fine, but the tests use 3.6 features so the
build is only tested for 3.6.Ghostscriptpdfebc-corerequiresGhostscriptfor the PDF compression. The default binary isgs,
but this can be specified in the configuration file.RedisCelery requires a message broker, and I chose to go withRedis.A Gmail account (for sending e-mails)By default,pdfebcuses Google’s SMTP server to send e-mails. The program can however
be configured to use any SMTP server by maniupulating theconfig.cnf.InstallOption 1: Install from PyPi withpipThe latest release ofpdfebc-webis on PyPi, and can thus be installed as usual withpip.
I strongly discourage system-widepipinstalls (i.e.sudo pip install <package>), as this
may land you with incompatible packages in a very short amount of time. A per-user install
can be done like this:Executepip install--userpdfebc-webto install the package.InstallRedis(used byCelery).This may or may not be available in your package manager, Google it for specifics!InstallGhostscript.Many distributions come withGhostscriptpre-installed, but you may need to install
it.Make note of what the binary is called, and enter it in the configuration file
(see the next step).Currently, you must add the configuration file manually. Please have a look at thesample configurationfile for details. Where to put the configuration file is
machine-dependent, and decided by theappdirspackage.
On most modern Linux distributions, the file should be put at$HOME/.config/pdfebc/config.cnf.
You can runapdirs.user_config_dir('pdfebc')in the Python interpreter to find the
correct directory for your machine.
Note that you must first importappdirsfor it to be available in the interpreter.Note:When using a Gmail account, I strongly recommend
using anApp passwordinstead of the actual account password.Option 2: Clone the repo and the install withpipIf you want the dev version, you will need to clone the repo, as only release versions are uploaded
to PyPi. Unless you are planning to work on this yourself, I suggest going with the release version.Clone the repo withgit:git clonehttps://github.com/slarse/pdfebc-webcdinto the project root directory and install withpip.pip install--user., this will create a local install for the current user.Or justpip install .if you usevirtualenv.For development, usepip install-e.in avirtualenv.InstallRedis(used byCelery).This may or may not be available in your package manager, Google it for specifics!InstallGhostscript.Many distributions come withGhostscriptpre-installed, but you may need to install
it.Make note of what the binary is called, and enter it in the configuration file
(see the next step).Currently, you must add the configuration file manually. Please have a look at thesample configurationfile for details. Where to put the configuration file is
machine-dependent, and decided by theappdirspackage. Runapdirs.user_config_dir('pdfebc')in the Python interpreter to find the correct directory.
Note that you must first importappdirsfor it to be available in the interpreter.Note:When using a Gmail account, I strongly recommend
using anApp passwordinstead of the actual account password.How to runAssuming everything is installed correctly, running the application is dead simple.Executepdfebc-web-start-celery-redisto start up theRedisserver and 4Celeryworkers. The script will complain ifRedisorCeleryis not installed.Executepdfebc-webrunserver-hx.x.x.x-pnto runpdfebc-webwhile listening
to addressx.x.x.xand portn. Do note that if you run the server as root,
for example if you want to run it on a port lower than 1000,
thenappdirswill likely look for a different configuration directory than if you
run it as your normal user (because root is a different user).LicenseThis software is licensed under the MIT License. See thelicense filefile for specifics.ContributingI am currently not looking for contributions. At this point, this is a practice project for me,
and even if I were looking for outside help the test suite is nowhere near comprehensive enough
for that yet. Sorry!