Skip to main content

Convertor for JSON database(s) to MAKO templated output

Project description

Apache2 License Pypi packaged release Build status Code Coverage Code Climate Status Issue Count Requirements Status Contributions welcome

JSON to MAKO generator

Python script that converts JSON database(s) to any templated output using MAKO templates.


pip3 install mlx.json_to_mako


The script takes multiple JSON input files, combines them in a python list, and renders the data through a provided template. No data-parsing functionality is provided by the script: the complexity of ‘interpreting’ the data is done in the MAKO templates.


General use:

json-to-mako --input database.json --template rendering.mako --output rendered.html

The MAKO-template should match the dataformat of the JSON input file. The script adds

  • a list at the top level: multiple input JSON files are appended to a list,
  • some metadata in order to identify the input source

The usage on how to match the dataformat between JSON and MAKO is explained through an example in the example/ directory.

Multiple input files

The –input flag can be provided multiple times in order to provide multiple JSON databases. This is explained by the example.

json-to-mako --input database1.json --input database2.json--template rendering.mako --output rendered.html

The multiple JSON databases are appended into a python list. Your MAKO-template needs to incorporate this by e.g. looping over the different databases. See example/ folder for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mlx.json-to-mako, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size mlx.json_to_mako-0.4-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size mlx.json_to_mako-0.4.tar.gz (11.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page