NonTemplate v0.13
For more information, see <http://code.zoic.org/nontemplate/>.
Summary
NonTemplate allows you to generate simple XML output directly in your Python code with a minimum of syntactic noise.
It uses the with statement introduced in Python 2.6 to ensure that once a tag is opened, it will be closed.
Python code and template codes can be interleaved naturally, without resorting to restrictive language constructions. Your favourite debugger can see, and set breakpoints in, every level of your template.
100% pure Python (>= 2.6), and it works just fine in Python 3.0 as well.
Performance is comparable to the commonly used templating languages and is better than most.
Asynchronous use is easy: NonTemplate is happy reading from iterables and writing to IO streams. This means you can start sending XHTML to your clients while your database is still retrieving rows …
Example
import nontemplate
D = nontemplate.Document(doctype=nontemplate.doctype.html_2_0)
with D.html():
D._comment("this is a test")
D._comment("this --> is too")
D._emit("<!-- testing & < > emit -->\n")
with D.head():
D.title()("foo")
with D.body():
with D.h1(id="foo"):
D._text("This is a <foo> & test")
with D.table(_class="cool"):
with D.tbody():
for row in range(1,3):
with D.tr():
for col in range(1,3):
D.td()("%d,%d" % (row,col))
Metadata
Release files for nontemplate 0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nontemplate-0.13.tar.gz | 4.4 kB | Without provenance | Details for nontemplate-0.13.tar.gz |
Release files / nontemplate-0.13.tar.gz
| Download URL | nontemplate-0.13.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7b85a7860c154b2d1092a4f6a4fbe3cd2b042c34ce11df2b13d496b2332e4c3
|
|
BLAKE2b-256 checksum How to use checksums |
c83631680595d7880cb5574f1564972097d732e54f4c5eafb61c747c852c0742
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for nontemplate 0.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.