Skip to main content

flask app for SimpleBook

Project description

flask-simplebook

This is the flask companion application to the SimpleBook MediaWiki extension.

It handles all the administration of pdf creation. To that end, it is comprised of two parts:

  • A flask webserver to communicate with mediawiki
  • A rq worker task to manage mw2pdf

Installation

Pre-requisistes

The API uses redis and expects you to have a redis server running on localhost:6379. Install through whatever means is best for your organization, but on debian based systems, installing via apt and starting as part of services is sufficient:

$ apt install redis

Installing from pypi

From a directory where you want to host the project, install via pipenv:

$ pipenv install flask-simplebook
$ pipenv install gunicorn

Configuring

Configuration is done via environment variables. The following are available:

  • SIMPLE_BOOK_DATA_DIR - The directory where created pdfs should be stored
  • SIMPLE_BOOK_FONT - An optional font location on disk for the title page fonts. Note: Fonts for the wiki pages are handled by the css (and webfonts) configured in mediawiki. This only handles fonts for the title page and headers of the pages. SimpleBook ships with the free Roboto and SourceCodepro fonts, and so proprietary and other fonts need to be managed by the sysadmin
  • SIMPLE_BOOK_LOGO - An optional logo for the title page of the books. Should point to a place on disk that can be accessed by mw2pdf

Running

Start the flask server:

$ pipenv run gunicorn --bind 127.0.0.1:3333 simplebook.wsgi:app

And also the rq worker:

$ pipenv run rq worker

Developing

When running in development, install from the local Pipfile:

$ cd flask-simplebook
$ pipenv install

And then start as above in two terminals:

$ pipenv run gunicorn --bind 127.0.0.1:3333 simplebook.wsgi:app
$ pipenv run rq worker

You can also install via to another directory via pipenv install -e

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-simplebook-0.6.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

flask_simplebook-0.6.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file flask-simplebook-0.6.0.tar.gz.

File metadata

  • Download URL: flask-simplebook-0.6.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for flask-simplebook-0.6.0.tar.gz
Algorithm Hash digest
SHA256 352976a589abd70ca735f11b3d8aaab8c705c7ae0fb49ae4e414f01667fe983c
MD5 06a6924aaaf2b263d0d7faa9f249b8d9
BLAKE2b-256 8999b5127f8382797f10aab1f6a700c6a717c9313b90eb033ea81a5a78778c27

See more details on using hashes here.

File details

Details for the file flask_simplebook-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_simplebook-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ba8406c8e2b3a77ad1c95027a5936977b34f815ad35581329e374f524ff520
MD5 b976e3de2cb12c5bc9110aacbedbde8e
BLAKE2b-256 d071cf80e192e08b036ca783f5179afdeb6f2ba55ca7f40b4e5b523fd49991bb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page