Skip to main content

Dewar

Dewar is a static site generator inspired by flask.

About

Why the name "dewar"?

Dewar (pronounced d-you-ah) is another name for a vacuum flask, or a thermos. Basically, it's a flask that keeps things frozen (or hot).

Why would I use this?

To the moment, there have been a few ways of making a static site:

  • Roll your own custom solution, maybe using jinja, but maybe just formatting a html template solution.

This might work for a small site, or for a repetitive report; but maintainability is lost, and a lot of custom configuration has to be done.

  • Use a static site generator (a la jekyll or hyde).

These are great for making blogs, but are opinionated about what content they should host. They don't allow for computation inline, and they are their own ecosystem to learn.

Just use flask!

There are two major limitations to flask that this project solves:

  1. Flask only serves one page at a time.
  2. Flask requires a server to be running.

These limitaions are obvious, but they prevent a few use cases:

  • hosting a site that doesn't need to be continuously rendered
  • creating sites that can be easily downloaded
  • creating a server that can be seen without a server running
  • creating sites that rely entirely on client-side code, but want some convenient templating [in this case, it adds overhead of processing that's unnecessary]

Setup

Installing Dewar is as simple as:

pip install dewar

And writing a program like

# named 'site.py'
import dewar

site = dewar.Site()

@site.register('index.html')
def index():
    return "<h1>Hello, World</h1>"

if __name__ == "__main__":
    site.render()

Then,

$ python3 site.py

That's it! Your static site is now in dist/.

Release files for dewar 1.2.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 dewar 1.2.1
File Size Uploaded
dewar-1.2.1.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dewar 1.2.1
File Interpreter ABI Platform
dewar-1.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 23.2 kB

Release files / dewar-1.2.1.tar.gz

Download URL dewar-1.2.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7a850f2396e6535abee4403879debcc1dcf56a4932284e0101fe5eb3cff51e90
BLAKE2b-256 checksum
How to use checksums
d436ebdc1c409bb2002052c975b25a122eaadba6456defb313244546efa1be95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6rc1

Release files / dewar-1.2.1-py2.py3-none-any.whl

Download URL dewar-1.2.1-py2.py3-none-any.whl
Size 13.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
92f95216e3a17195a16aa5c69fea78c4b8795cb5e78f20dae7e9a7196aa41d3a
BLAKE2b-256 checksum
How to use checksums
125012d49f3784fa45d9e8590eab732700bbd5ef5887ea2753fd80e9dfe1e29f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6rc1

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.4

1 release file

0.1.1

1 release file

0.1

1 release file

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