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
Additions
- Added Python 3.12 support. [#2](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/2)
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for jinjanator_plugin_format_xml-23.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b58f735895404a4a10c98672d6b79d1f027c13d3dea9756a1f79add39a63d248 |
|
MD5 | 339fc93a3f31752c1fe398da12b0f459 |
|
BLAKE2b-256 | 9bd3e7269c0790df0fb991847da21d8fd403c6b5f89db24fbbd08735baf8436c |
Close
Hashes for jinjanator_plugin_format_xml-23.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf9ea64f4c9b7153531b9b9c3613daf15e7af892429c2c07181ad197686c512 |
|
MD5 | 11080740ffebf3ad1546280e0368d434 |
|
BLAKE2b-256 | 4a6dd4aeb2d5432f6288d4a357355fc9bb76b687e5e5016c6d8dcdf23859e270 |