Plugin which provides XML format (data input) support for jinjanator
Project description
jinjanator-plugin-format-xml: Provides XML format (data input) support for jinjanator
This plugin allows jinjanator to parse XML data for processing in
templates. The format can be selected using --format xml
or
autoselected by using a data file with a name ending with .xml
.
Installation
pip install jinjanator-plugin-format-xml
Usage
Suppose you have an NGINX configuration file template, nginx.j2
:
server {
listen 80;
server_name {{ nginx.hostname }};
root {{ nginx.webroot }};
index index.htm;
}
And you have an XML file with the data, nginx.xml
:
<nginx>
<hostname>
localhost
</hostname>
<webroot>
/var/www/project
</webroot>
</nginx>
This is how you render it into a working configuration file:
$ jinjanate nginx.j2 nginx.xml > nginx.conf
Options
process-namespaces
: configures the XML parser to replace namespace references in element names with the corresponding namespaces fromxmlns
attributes in the top-level element in the document.
Release Information
Backwards-incompatible Changes
-
Added support for Python 3.13, and removed support for Python 3.8.
-
Upgraded to version 24.2.0 of jinjanator-plugins.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jinjanator_plugin_format_xml-24.2.0.tar.gz
.
File metadata
- Download URL: jinjanator_plugin_format_xml-24.2.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5974fbbf37d6ac9aec31ff663a580ca08ca1c1fa2a8728810e8988aef0987c3 |
|
MD5 | 2df4d72acf1f67d22ebcbcf9d0e9794c |
|
BLAKE2b-256 | 10a85e978bd10b31c02c89dcfee678f5ef302d148066078b051f4c57a809a5b8 |
File details
Details for the file jinjanator_plugin_format_xml-24.2.0-py3-none-any.whl
.
File metadata
- Download URL: jinjanator_plugin_format_xml-24.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c812d2e5150e6594d81c2d0cf6cde8d3bf6dafa3c1476e9114931aacd753562 |
|
MD5 | fc98c7c1ec03659c13c1de2ddca5c0c0 |
|
BLAKE2b-256 | 26425b41c3eda440ac128a5e71b5ff4e2e6de2fce49a091f647227aab6c9a4f4 |