2 points · by slaybear · 2y ago · 4 comments
I contribute on a few different python web projects, and grew tired of remembering the varying syntax - just let me write python!
This is not a full templating language like Jinja, and does not support things like template inheritance, etc. Rather, empyt can be used as an 'extension' alongside other templating engines.
Fully functional, but considered a very early v1. Biggest thing ATM is that security needs to be thought through a lot more.
It would probably be helpful to show examples of what it does support, and how that complements an existing templating engine like Jinja. In the README it looks like empyt wraps an existing templating engine, but it isn't clear what that wrapping accomplishes.
Documentation + examples are definitely lacking ATM. Will be rectified in short order. To answer your question now, the goal is pretty simple: enable python to be directly used in HTML templates.
For usage with another template engine, I see it as more of a convenience / speed factor. Quickly write frontend logic in python without reaching for a new (albeit similar) syntax.
empyt can also be used standalone, in situations where people want to avoid a templating engine altogether, and just want to use python on the frontend.
with templating engine: https://github.com/crypto-rizzo/empyt/blob/master/examples/t...
without templating engine: https://github.com/crypto-rizzo/empyt/blob/master/examples/t...
But this is interesting and I could see using it, maybe passing in more complicated functions through the interface if needed.
Anyway thanks for the kind words, and let me know of any feedback you have if you do take empyt for a joy ride. Planning to have a public roadmap before EOY