https://github.com/nggit/pspparse
pspparse is a Python module containing a PSP parser extracted from the mod_python project.
https://github.com/nggit/pspparse
python template-engine templates
Last synced: 5 days ago
JSON representation
pspparse is a Python module containing a PSP parser extracted from the mod_python project.
- Host: GitHub
- URL: https://github.com/nggit/pspparse
- Owner: nggit
- License: apache-2.0
- Created: 2024-12-14T09:53:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T05:09:29.000Z (over 1 year ago)
- Last Synced: 2025-12-16T17:21:43.851Z (4 months ago)
- Topics: python, template-engine, templates
- Language: C
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pspparse
========
**pspparse** is a Python module containing a PSP parser extracted from the [mod_python](https://modpython.org/) project.
It is not meant for console games, but [Python Server Pages](https://modpython.org/live/mod_python-3.3.1/doc-html/pyapi-psp.html). I have an idea to use it on [httpout](https://github.com/nggit/httpout).
Build the module
----------------
```
$ make
```
Usage
-----
```python
from pspparse import parse_string
source = parse_string(b'Hello, <%=__name__%>!')
```
The result is the following source code.
```python
"print('''Hello, ''', end=''); print(__name__, end=''); print('''!''', end='')"
```
Changes that have been made from the original
---------------------------------------------
- Rename module from `_psp` to `pspparse`
- Change `req.write()` to `print()`
- Add an alias for `parsestring`, `parse_string`
License
-------
Apache License, Version 2.0