An Async YAML template engine with Python expressions
Project description
AIO-YTE - An Asynchronous YAML Template Engine with Python Expressions
AIO-YTE is an asynchronous template engine for YAML format that extends the YAML structure with Python expressions, enabling dynamic YAML document generation. The key feature of AIO-YTE is its ability to process Python expressions asynchronously, making it ideal for use in environments that require asynchronous operations, such as web servers or other I/O-bound applications.
Key Features
-
Asynchronous Evaluation: AIO-YTE allows you to use
await
within your YAML templates, enabling asynchronous processing of expressions. This is particularly useful in modern Python applications where asynchronous code is prevalent. -
YAML-First Approach: Like its predecessor YTE, AIO-YTE leverages YAML's structure to simplify2the syntax for template expressions, making it more intuitive and human-readable while maintaining YAML's native semantics.
-
Python Expression Integration: AIO-YTE integrates Python syntax directly into YAML, allowing you to use conditionals, loops, and other Python expressions seamlessly within your templates.
Documentation
Comprehensive documentation for YTE can be found at yte-template-engine.github.io.
Comparison with Other Engines
Many template engines are available, such as the popular jinja2. AIO-YTE is specifically designed for YAML, offering several advantages:
- YAML-Specific Syntax: By utilizing YAML's syntax, AIO-YTE reduces the need for additional control flow symbols, making the templates more readable and less foreign to those familiar with YAML.
- Improved Whitespace Handling: YAML's semantics require careful handling of whitespace, which AIO-YTE manages seamlessly without the need for complex configurations, as might be necessary with engines like jinja2.
Other YAML-specific template engines include:
The main distinction of AIO-YTE is its extension of YAML with native Python syntax and its support for asynchronous operations. This allows for more natural and powerful template processing, particularly in applications that require asynchronous execution.
Differences Between AIO-YTE and YTE
While AIO-YTE retains the core functionality of YTE, it introduces several key enhancements:
- Asynchronous Processing: The primary difference is the ability to handle asynchronous expressions, enabling the use of
await
directly within YAML templates. - Enhanced Error Handling: AIO-YTE improves error handling, particularly in the context of asynchronous operations, ensuring more robust and predictable template evaluation.
- Backwards Compatibility: AIO-YTE remains compatible with existing YTE templates but extends their capabilities to handle async code, making it a drop-in replacement for applications that require async processing.
By incorporating these features, AIO-YTE is designed to meet the needs of modern Python applications, offering a powerful and flexible template engine for YAML.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aio_yte-2.0.5.tar.gz
.
File metadata
- Download URL: aio_yte-2.0.5.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d7f851248712070da92b08df5ba8a808193a48f66f276de9870e42e53c0a268 |
|
MD5 | f39570f630a65739949ce08682bd05f0 |
|
BLAKE2b-256 | 22a8da3e42e8b433d68b475e664bb001ff326d57ef7a25fd44b626ae75c84088 |
File details
Details for the file aio_yte-2.0.5-py3-none-any.whl
.
File metadata
- Download URL: aio_yte-2.0.5-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 599f1ae7e90d653c6fc4812281ac20df2802de349652a48fe179f2a573566eb4 |
|
MD5 | 6641fc2b2edafc7b9e9cc3317e7e5927 |
|
BLAKE2b-256 | 5a5469d1d51f5546df4591c0da16faff42418d4f8dce955e83625cb24f221c08 |