This is the implementation of the WhakerKit
library.
WhakerKit is a versatile toolkit for building websites with both static and dynamic
HTML pages. It was developed by Brigitte Bigi, CNRS.
WhakerKit is a seamless toolkit for managing dynamic websites and shared documents.
WhakerKit is the ideal toolkit if you want to:
It’s designed for developers who want a lightweight, flexible solution with minimal configuration.
It’s easy to deploy, easy to understand, and highly adaptable.
WhakerKit provides easy management of public and authenticated access and
simplifies document sharing in collaborative environments. It is based on the
following technologies:
WhakerKit fills a real gap in the Python ecosystem by offering an all-in-one solution that sits between a static site generator, a lightweight CMS, and a micro-framework. Unlike general-purpose frameworks or static tools, WhakerKit provides:
To our knowledge, there is no other open-source Python project combining these features in such a streamlined, transparent, and file-oriented way.
In summary:
WhakerKit is an original toolkit, designed for developers and researchers who need simplicity, flexibility, and full control over their web applications—without the constraints of traditional frameworks.
The Apache server uses uWSGI to run a Python application, handled by
the local wsgi.py
file. The WSGI server looks for an
application(environ, start_response)
function, which is called whenever a
request is received (via POST, GET, or any other method). This file defines
a function that is an instance of the WSGIApplication
class. It is
instantiated with the following parameters:
index.html
.json
filePages are dynamically generated using the WhakerPy
library and are returned
as either HTML or JSON, depending on the request. The dynamic HTML pages fall
into two categories:
Partially dynamic pages are described in the JSON configuration file. The <head>
,
header, menu, and footer of these HTML pages are automatically added to a static
HTML body located in the html
folder. The dynamic parts are generated by Python
classes.
See the accompanying file AUTHORS.md
.
Get it from its repository https://sourceforge.net/projects/whakerkit/, and
get documentation https://whakerkit.sourceforge.io.
Download the latest ".zip" from the web page and unpack it:
> unzip WhakerKit-xxx.zip
Alternatively, you can clone the repository with git
:
> git clone https://git.code.sf.net/p/whakerkit/code whakerkit-code
> python -m pip install .
WhakerKit was developed to address real-world needs for flexibility, control, and simplicity when building web applications and collaborative websites—both online and in local environments. While established frameworks such as Django or Flask are robust and widely adopted, WhakerKit offers a different philosophy, designed for projects where transparency, minimalism, and direct control are required.
WhakerKit avoids unnecessary abstraction layers. The entire web request/response cycle is easy to follow, debug, and customize. There is no “magic”: each step is explicit, making the codebase accessible and maintainable.
You maintain complete control over the site’s structure, file management, and dynamic content generation. There are no imposed conventions or hidden behaviors—ideal for use cases that do not fit the patterns of large frameworks.
The toolkit requires only Python and a few well-documented libraries. There is no ORM, no complex plugin system, and no heavy runtime environment. This keeps deployments simple and reduces maintenance overhead.
WhakerKit makes document sharing and file management straightforward. The system is particularly suited for collaborative platforms and projects that rely on direct file access, rather than database-driven storage.
Because of its transparency and modularity, WhakerKit is a strong choice for scientific projects, reproducible research, and teaching. Students and developers can clearly see and adapt the full process, from request handling to dynamic HTML generation.
WhakerKit can be used for traditional websites, collaborative intranets, or local web applications via the embedded WhakerPy server—no need for complex server stacks or third-party hosting requirements.
WhakerKit is not intended to replace comprehensive frameworks such as Django or Flask. Those frameworks are excellent for large-scale applications, projects requiring extensive plugin ecosystems, or out-of-the-box administration features.
Instead, WhakerKit focuses on transparency, direct control, and a streamlined experience, especially for specialized, internal, or research-oriented web projects.
If your priority is a lightweight, adaptable toolkit that gives you full control over your web application—with minimal dependencies and maximum transparency—WhakerKit is an ideal solution. For many targeted use cases, it offers a unique and effective alternative to the mainstream web frameworks.
Required contents:
pyproject.toml
: Python configuration file used to install dependencieswhakerkit
: Contains the JavaScript package and the Python source code that whakerexa
: CSS and JSOptional content:
add_document.py
: Script to add documents to the uploads
folderGet it:
python -m venv .venv
python -m pip install .
— this reads pyproject.toml
and installs dependenciesFiles and folders required to launch the sample:
wsgi.py
: entry point for the applicationwhakerkit/whakerkit.json
: General configuration file for any websitesample
: folder with python source code sample/sample.json
: General configuration file for any website used by Whakerkit and list of dynamic pages for the sample used by WhakerPysample/statics
: Contains static files such as icons, images, and CSS for the samplesample/html
: Contains all static components of the HTML pages of the samplesample/uploads
: Contains the document database. This folder should never be modified manually.WhakerKit comes with a sample
directory to help you get started. All the sample files are well-commented to help developers understand and adapt
the logic to their own use case.
The whakerkit
package also includes an error
folder containing HTML error pages.
Edit these files to customize error messages. The package also includes default icons
that can be replaced as long as the file names remain the same.
Starts by editing the sample.json
to configure your project, then edit the wsgi.py file.
Since version 1.1, you must explicitly initialize WhakerKit with your configuration file in your project, after importing the package. It is usually done in the wsgi.py file:
>>> import whakerkit
>>> whakerkit.initialize('/path/to/your/config.json')
Warning: Always access the global settings with whakerkit.sg (not by importing sg directly).
Example:
>>> import whakerkit
>>> whakerkit.sg.path
If you access 'sg' before calling initialize(), it will only use the default settings, not your custom configuration.
This file contains the CustomWebData
class, which inherits from WebSiteData
.
It parses sample.json
, stores data, and manages the "bakery" system — a concept
from WhakerPy used to dynamically generate page content.
This file implements the CustomPagesResponse
class. It is invoked when a
requested page name is listed in sample.json
. It reuses the same head, header,
navigation bar, and footer, while changing only the main content, which is
defined in a static HTML file.
Allows adding content to the <head>
tag of dynamically created HTML files.
You can include <meta>
, <link>
, or <script>
elements.
Allows defining the entire <nav>
content of dynamically created HTML files.
Edit the file wsgi.py
to adapt it to your project content.
To enable debugging, modify the logging configuration, i.e. comment/uncomment
the following lines:
LOG_LEVEL = 1 # Debug level
# LOG_LEVEL = 15 # Info level
Under any linux version or macOS, launch locally the application with:
> # install required external libraries:
> python3 -m pip install pycryptodome --break-system-packages
> python -m pip install uwsgi
> # launch with uwsgi service:
> uwsgi --http :9090 --wsgi-file wsgi.py
Then open http://localhost:9090/
python -m pip install wsgi
python3 -m pip install pyuwsgi
Deploying WhakerKit on a production server depends on your hosting provider.
A typical deployment uses an Apache server with uWSGI and Python support.
Contact the author by e-mail to get help or to provide help.
See: https://sppas.org/bigi/
Initial version.
Migration from WhakerKit 1.0:
- 'whakerkit.json' must now be outside the whakerkit package folder.
- You must call 'whakerkit.initialize()' before any use of 'whakerkit.sg'.
- Never use 'from whakerkit import sg', always use 'import whakerkit' instead.
To do list: