Skip to main content

A powerful template rendering engine with support for directives, includes, and dynamic context evaluation.

Project description

Iris

Latest Version Downloads Status License: CC BY-ND 4.0

Iris is a modern, lightweight Python template engine designed for simplicity, flexibility, and performance. With advanced directive processing, includes, and dynamic context evaluation, Iris provides developers with a seamless way to render dynamic templates efficiently.


🚀 Key Features

  • Advanced Directives: Includes support for custom template directives like @extends, @include, and control structures.
  • Dynamic Context Injection: Easily pass and process dynamic data into your templates.
  • Flexible Templating: Supports layout inheritance, template composition, and reusable components.
  • Fast and Lightweight: Minimal overhead with high performance, designed for Python applications.
  • Safe Evaluation: Includes built-in safeguards for variable evaluation to ensure template safety.
  • Open for Personal & Commercial Use: Use Iris freely in personal and commercial projects (not for resale as a standalone product).

🛠️ How to Use Iris

Step 1: Install Iris

Install Iris via pip:

pip install iris-templates

Step 2: Render Your First Template

Create a template file, e.g., template.html:

@extends('base.html')

@section('title', 'Welcome to Iris')

@section('content')
    <h1>Hello, {{ user }}!</h1>
@endsection

Create a Python script to render the template:

from altxria.iris.engine import TemplateEngine

engine = TemplateEngine(template_dir="./templates")
output = engine.render("template.html", {"user": "Alice"})
print(output)

Step 3: Explore More Features

Iris provides advanced features for layout inheritance, template inclusion, and custom directives. For example:

Including Other Templates

@include('header.html')

<p>This is the body content.</p>

@include('footer.html')

Dynamic Control Structures

@if(user.is_admin)
    <p>Welcome, Admin {{ user.name }}!</p>
@else
    <p>Welcome, {{ user.name }}!</p>
@endif

🔍 Project Status

Issues Closed Bug Issues Enhancement Issues


📜 License and Usage

Iris is free to use for both personal and commercial projects. However, Iris itself cannot be resold or distributed as a standalone product.


🤝 Contributors

Developed and maintained by Altxria Inc. with contributions from a growing community of passionate developers.

Contributors

See All Contributors


❤️ Support Iris

If you find Iris useful, consider sponsoring us to support ongoing development and new features!

Sponsor Iris

ko-fi

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

iris_templates-0.1.2.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

iris_templates-0.1.2-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file iris_templates-0.1.2.tar.gz.

File metadata

  • Download URL: iris_templates-0.1.2.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for iris_templates-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b2ce0f1bb0380089f44f68db33cd37ecc28fa5348fec773483d409b637ed7287
MD5 b3fa8a17b1ab2a58e0c41d2d3aa33196
BLAKE2b-256 506831ac3f71566f2a1d495a20abd098e8224d017472d151d282e2f8b9bd4b83

See more details on using hashes here.

File details

Details for the file iris_templates-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iris_templates-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for iris_templates-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43e3d0d0e0188f9ac8f104709dd2e7dddd1942cb1abee99a0bc6b1b846bc9f52
MD5 324b68b86e89febf1018d07f5fd3d389
BLAKE2b-256 3d6d0c4f1c46a461c3588af884c4c6749023c1157d6774ea4efea59759e23e05

See more details on using hashes here.

Supported by

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