Skip to main content

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

Metadata

Release files for flask-simplebook 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-simplebook 0.6.1
File Size Uploaded Provenance Actions
flask-simplebook-0.6.1.tar.gz 26.6 kB Without provenance Details for flask-simplebook-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-simplebook 0.6.1
File Interpreter ABI Platform Actions
flask_simplebook-0.6.1-py3-none-any.whl Python 3 none any Details for flask_simplebook-0.6.1-py3-none-any.whl

Total release size: 53.8 kB

Release files / flask-simplebook-0.6.1.tar.gz

Download URL flask-simplebook-0.6.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8c130a7f141d3681ae95d60c64e0d56bbc8995bda9ce74dd3176bb4effe29552
BLAKE2b-256 checksum
How to use checksums
7ee5e044f0dc14822364f3b1645b61f4afc3404cd9f8f845097375312d6652a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / flask_simplebook-0.6.1-py3-none-any.whl

Download URL flask_simplebook-0.6.1-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ea8d3ed532b643199c0b2ca405c05bf1754c416711baa7d02e48533d5dbdc6c
BLAKE2b-256 checksum
How to use checksums
4d9d9811754b89d313148e00859e57b4812cc467b91112d6f2262161102a7912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for flask-simplebook 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page