Skip to main content

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 from xmlns 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.


→ Full Changelog

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

jinjanator_plugin_format_xml-24.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file jinjanator_plugin_format_xml-24.2.0.tar.gz.

File metadata

File hashes

Hashes for jinjanator_plugin_format_xml-24.2.0.tar.gz
Algorithm Hash digest
SHA256 c5974fbbf37d6ac9aec31ff663a580ca08ca1c1fa2a8728810e8988aef0987c3
MD5 2df4d72acf1f67d22ebcbcf9d0e9794c
BLAKE2b-256 10a85e978bd10b31c02c89dcfee678f5ef302d148066078b051f4c57a809a5b8

See more details on using hashes here.

File details

Details for the file jinjanator_plugin_format_xml-24.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jinjanator_plugin_format_xml-24.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c812d2e5150e6594d81c2d0cf6cde8d3bf6dafa3c1476e9114931aacd753562
MD5 fc98c7c1ec03659c13c1de2ddca5c0c0
BLAKE2b-256 26425b41c3eda440ac128a5e71b5ff4e2e6de2fce49a091f647227aab6c9a4f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page