{"id":21704,"library":"preppy","title":"preppy - a Preprocessor for Python","description":"preppy is a Python preprocessor for generating text output from templates. It compiles template files into Python modules for fast execution. Current version 5.1.0, maintained by ReportLab, with irregular release cadence.","status":"active","version":"5.1.0","language":"python","source_language":"en","source_url":"https://github.com/reportlab/preppy","tags":["template","preprocessor","reportlab","python"],"install":[{"cmd":"pip install preppy","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"preppy is a module; the correct import is just 'import preppy'.","wrong":"from preppy import preppy","symbol":"preppy","correct":"import preppy"},{"note":"getModule takes a filename string, not keyword arguments.","wrong":"preppy.getModule(name='template')","symbol":"getModule","correct":"preppy.getModule('template.prep')"}],"quickstart":{"code":"import preppy\n\ntemplate = preppy.getModule('template.prep', source_extension='.prep')\nresult = template.getOutput({'name': 'World'})\nprint(result)","lang":"python","description":"Compile and run a template file named 'template.prep' with a variable 'name'."},"warnings":[{"fix":"Recompile templates with preppy 5.x.","message":"Version 3.x dropped Python 2 support. Templates compiled with older versions may not be compatible.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Add noCaching=True if you need fresh compilation each time.","message":"In version 5.x, the module caching behavior changed: getModule now caches compiled modules by default. Use noCaching parameter to disable.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use preppy.getModule('file.prep') or preppy.getModule('file', source_extension='.prep').","message":"Template files must have a .prep extension by default, or specify source_extension in getModule.","severity":"gotcha","affected_versions":"all"},{"fix":"Use template.getOutput({'var': value}) instead of template.getOutput(var=value).","message":"getOutput does not accept keyword arguments for variables; pass a dictionary as first argument.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install preppy'.","cause":"preppy is not installed.","error":"ModuleNotFoundError: No module named 'preppy'"},{"fix":"Use 'import preppy' and call preppy.getModule().","cause":"Wrong import (e.g., 'from preppy import preppy').","error":"AttributeError: module 'preppy' has no attribute 'getModule'"},{"fix":"Ensure filename includes .prep extension or use source_extension parameter.","cause":"Filename or path is incorrect, or extension missing.","error":"preppy.PreppyError: Could not find template file"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}