<% async for blank_page in sketchbook %> <% let sketch = await blank_page.draw() %> <% end %>
Sketchbook is a brand new template engine for asyncio. It takes advantage of
Python 3's unicode and the new
await syntax(PEP 492)
asyncio (PEP 3156) and concurrent I/O
with a syntax inspired by ERB and
- Super Simple Syntax: The syntax of Sketchbook is super easy to learn. It mixes the Python syntax with the ERB style tag marker while keeping a big picture from Python.
- Safe: The output is escaped by default unless manually overridden.
- Unicode Support: Unicode is baked into the whole system, never worry about dealing with the bytestring.
awaitready: Sketchbook is designed from the ground up for and
awaitsyntax. Developers are able to use
- Fast Execution: Like Mako and Jinja2, Sketchbook compiles the template into Python bytecode before execution, it should be as fast as running other Python code.
- Dynamic Template Inheritance and Including: The template can inherit from and include the other templates at the runtime, which significantly improves the reusability and flexibility.
$ pip install -U sketchbook
Alternative Event Loop
asyncio module from the Python standard library, Sketchbook
can also be used with curio.
- Python 3.6+
- aiofiles>=0.3.1,<1(Optional, used by :class:`.AsyncSketchFinder`)
- For how to integrate sketchbook into your project, see :ref:`integration`.
- For the Language Reference , please refer to :ref:`language`.
There's quite a few template engines for Python, why reinvent the wheel?
- Most template engines are relics from
Python 2.x, thus they suck when dealing with unicode.
- The coroutine is now one of the first class citizens in the Python language, but not in these template engines.
- None of them support the new type hints system introduced in
- It's fun!
.. toctree:: :maxdepth: 3 integration language sketchbook