Skip to main content

Simple markdown based low bandwidth static site generator

Project description

PyStatisk Ascii Logo


A Python port of the Kotlin Statisk project, designed to run on low power devices (RaspberryPi Zero). Converts Markdown files to simple Html with image size reduction for extreme low-bandwidth web pages.


Install via PIP:

pip install Statisk

then run with:

stsk /path/to/blog/

If you encounter an error when running stsk similar to:

ImportError: cannot open shared object file: No such file or directory

execute the following to fix: sudo apt-get install libopenjp2-7-dev


_template.html should be placed in root directory of the website, simple example:

<!DOCTYPE html>
        <!-- Optional -->
        <title>{{ title }}</title>  
        {{ content }}
            <!-- Optional -->
            {{ page_size }}

Blog Structure

Markdown posts need to be in a Year/Month/Day (YYYY/MM/DD) structure inside a root posts/ directory:

|- _template.html  
|- posts/  
    |- 2020/  
        |- 01/ 
                |- picture.png  
    |- 2019/  
        |- 12/    
                |- pictureA.png 
                |- pictureB.png 

Style Parameters

Markdown posts can set parameters to override how images are handled and to set the page background, this is done using a hidden comment at the top of the markdown file, eg:

<!--- -algorithm 5by3Bayer -threshold 100 -background #efefef -image_foreground #002233 -image_background #dedede -->

Argument Behaviour
-algorithm Sets dither algorithm (see below), eg. -algorithm stucki
-threshold Set threshold of dither algorithms in range 0 to 255, eg. -threshold 255
-image_foreground Set the foreground colour of dithered images, eg. -image_foreground #002233
-image_background Set the background colour of dithered images, eg. -image_background #ffcdcd
-background Override the page background colour, eg. -background #efefef


Available dithering algorithms (from DitherKt):

2by2Bayer, 3by3Bayer, 4by4Bayer, 5by3Bayer, 8by8Bayer, FloydSteinberg, FalseFloydSteinberg, NewspaperHalftone, JarvisJudiceNinke, Sierra, SierraLite, TwoRowSierra, Burkes, Atkinson, Stucki, ErrorDif, Threshold, Random

there's also a greyscale filter (-algorithm greyscale), threshold is ignored.

Project details

Download files

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

Files for Statisk, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size Statisk-1.2.0-py3.7.egg (16.7 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size Statisk-1.2.0-py3-none-any.whl (20.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Statisk-1.2.0.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page