Skip to content

Iris is a modern, lightweight Python template engine for rendering dynamic HTML with advanced directive support, layout inheritance, and safe variable evaluation. Ideal for fast and flexible application templating.

License

Notifications You must be signed in to change notification settings

altxriainc/iris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iris

Latest Version Downloads Status License: MIT

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.

Click here for the documentation


🚀 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

About

Iris is a modern, lightweight Python template engine for rendering dynamic HTML with advanced directive support, layout inheritance, and safe variable evaluation. Ideal for fast and flexible application templating.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published