Skip to main content

Async version of Jinja2 environment

Project description

aioja

Async version of Jinja2.

PyPI Build Status

This library contains a modification of the Jinja2 library. In addition to Jinja's built-in render_async, i've added:

  • async FileSystemLoader (via aiofiles)
  • async bytecode cache (aioredis and aiocache supported)
  • async version of the Environment.compile_templates method

Install

pip install aioja

Quick Start

from aioja.environment import Environment
from aioja.loaders import FileSystemLoader
from aioja.bccache.aiocache import AioCacheBytecodeCache


env = Environment(
    loader=FileSystemLoader('templates'),
    # ...
    # bytecode_cache=AioCacheBytecodeCache()
    # ...
)

template = await env.get_template('index.html')
content = await template.render_async({
    'page_id': 123
})

Project details


Download files

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

Source Distribution

aioja-0.0.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

aioja-0.0.4-py2.py3-none-any.whl (16.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file aioja-0.0.4.tar.gz.

File metadata

  • Download URL: aioja-0.0.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.0

File hashes

Hashes for aioja-0.0.4.tar.gz
Algorithm Hash digest
SHA256 c7e4256d53d9fbbcefe02258bebc3429f9f103e1067ee2a942bef2640285c62b
MD5 fefc99ce15e974ebb69e40d8c66e5c83
BLAKE2b-256 4280e9f30ba86a34455a75f83a8943ce65aafd6c23b66c6fe7909811a17e37c5

See more details on using hashes here.

File details

Details for the file aioja-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: aioja-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.0

File hashes

Hashes for aioja-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e6e1625ff99197a70bdb3ae6cbea628af8eb814d9e5a4f9e66ba2c781737f071
MD5 8cd8b84ad94f55bb58bba1ffe1039fcc
BLAKE2b-256 f1ab429c917aa87314665b4f9a5227b73f85cf23b0574d1c6895c82bdc18f974

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page