Metadata-Version: 2.1
Name: aioja
Version: 0.0.2
Summary: Async version of Jinja2 environment
Home-page: https://github.com/dldevinc/aioja
Author: Mihail Mishakin
Author-email: x896321475@gmail.com
Maintainer: Mihail Mishakin
Maintainer-email: x896321475@gmail.com
License: BSD license
Platform: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: jinja2
Requires-Dist: aiofiles
Provides-Extra: aiocache
Requires-Dist: aiocache ; extra == 'aiocache'
Provides-Extra: aioredis
Requires-Dist: aioredis ; extra == 'aioredis'

# aioja
Async version of Jinja2.

[![PyPI](https://img.shields.io/pypi/v/aioja.svg)](https://pypi.org/project/aioja/)
[![Build Status](https://travis-ci.org/dldevinc/aioja.svg?branch=master)](https://travis-ci.org/dldevinc/aioja)

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](https://github.com/Tinche/aiofiles))
* async bytecode cache ([aioredis](https://github.com/aio-libs/aioredis) and [aiocache](https://github.com/argaen/aiocache) supported)
* async version of the `Environment.compile_templates` method

## Install

```
pip install aioja
```

## Quick Start

```python
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
})
```


