PyProcessor: Python 3 preprocessor
PyProcessor is a Python 3 preprocessor. It accepts text as its input, executes code regions found inside that text, substitutes variables and returns an output text.
PyProcessor runs code by default delimited by <% and %>. For example:
Hello, <% print('world!', end='') %>
Will result in
Hello, world!. You may also define variables on the command line or within code regions. These variables can be directly substituted, like in this example:
I have a variable named 'GOOFY'. GOOFY's value is @@GOOFY@@.
No error will result if you don't define
Empty and space variable names will be silently ignored.
Default code delimiters are
<% %> and default variable delimiters are
@@ @@. You may overrirde these by command line.
Usage as a command line tool
PyProcessor can also be run from command line to directly work on files or piped data. Type
python -m pyprocessor --help for further information.
PyProcessor is free software and is distributed under the GNU General Public License version 3 (GPL v3).
If you find any bugs please submit a report through the issue tracker at https://github.com/alkafir/pyprocessor/issues