access templates from within a zip (via zipfile module?)

Skip to first unread message

Alexander Krause

Apr 26, 2017, 8:14:15 AM4/26/17
to Mako Templates for Python
Hi there!

Did anyone tried to implement something to access mako templates from a zipfile?

For deployment (py2exe) I'd like to directly read a template without extracting it to a temporary folder from a zip.

At the moment I'm trying to overload some of the filesystem functions of mako but I was wondering if it might also be possible via a special TemplateLookup class?

Thanks for hints and have a great day!

mike bayer

Apr 26, 2017, 1:26:28 PM4/26/17

On 04/26/2017 08:14 AM, 'Alexander Krause' via Mako Templates for Python
I don't have much to add here except, "yes", a custom TemplateLookup
could pull the files from a zip as a source. The base class is
TemplateCollection which is "abstract", I'd use that as a base.

> --
> You received this message because you are subscribed to the Google
> Groups "Mako Templates for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> <>.
> To post to this group, send email to
> <>.
> Visit this group at
> For more options, visit

Alexander Krause

Apr 26, 2017, 3:22:10 PM4/26/17
to Mako Templates for Python
I've uploaded my progress to github:

Examples are there and the use should be pretty easy to.

Basically it already seems to work but I'm open for comments.

Reply all
Reply to author
0 new messages