Ravenports generated: 08 Feb 2023 06:37
[ravenports.git] / bucket_18 / python-json2html
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-json2html
4 VERSION=                1.3.0
5 KEYWORDS=               python
6 VARIANTS=               py310 v11
7 SDESC[py310]=           JSON to HTML Table Representation (3.10)
8 SDESC[v11]=             JSON to HTML Table Representation (3.11)
9 HOMEPAGE=               https://github.com/softvar/json2html
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/j/json2html
14 DISTFILE[1]=            json2html-1.3.0.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[py310]=           single
17 SPKGS[v11]=             single
18
19 OPTIONS_AVAILABLE=      PY310 PY311
20 OPTIONS_STANDARD=       none
21 VOPTS[py310]=           PY310=ON PY311=OFF
22 VOPTS[v11]=             PY310=OFF PY311=ON
23
24 DISTNAME=               json2html-1.3.0
25
26 GENERATED=              yes
27
28 [PY310].USES_ON=                        python:py310,sutools
29
30 [PY311].USES_ON=                        python:v11,sutools
31
32 [FILE:2731:descriptions/desc.single]
33 json2html
34 =========
35
36 Python wrapper to convert JSON into a human readable HTML Table
37 representation.
38
39 |Latest Version| |Downloads| |Build|
40
41 Features
42 --------
43
44 * User friendly tablular fomat, easy to read and share.
45 * If value of the key is array of objects and all the keys are same(value
46 of the key is a dict of list), the module will club by default. Eg.
47
48 .. code-block:: bash
49
50         input = {
51                 "sampleData": [{
52                         "a":1, "b":2, "c":3
53                 }, {
54                         "a":5, "b":6, "c":7
55                 }]
56         }
57
58         will create only one row combining the results. This feature can be turned
59 off by explicitly passing an argument ``clubbing = False``.
60
61 * Generated table can be provided some attributes explicitly. Eg. giving an
62 id, class or any ``data-*`` attribute.
63 * Python 3 compatible
64
65 Live Demo
66 ----------
67
68 [Click here] for the online demo.
69
70 List of valid arguments
71 -----------------------
72
73 ``json2html.convert`` - The module's convert method accepts the following
74 arguments:
75
76 ===================== ================
77 Argument              Description
78 --------------------- ----------------
79 `json`                a valid JSON; This can either be a string in valid
80 JSON format or a python object that is either dict-like or list-like at the
81 top level.
82 --------------------- ----------------
83 `table_attributes`    e.g. pass `id="info-table"` or
84 `class="bootstrap-class"`/`data-*` to apply these attributes to the
85 generated table
86 --------------------- ----------------
87 `clubbing`            turn on[default]/off clubbing of list with same keys
88 of a dict / Array of objects with same key
89 --------------------- ----------------
90 `encode`              turn on/off[default] encoding of result to escaped
91 html, compatible with any browser
92 --------------------- ----------------
93 `escape`              turn on[default]/off escaping of html tags in text
94 nodes (prevents XSS attacks in case you pass untrusted data to json2html)
95 ===================== ================
96
97 Installation
98 ------------
99
100 .. code-block:: bash
101
102         $ pip install json2html
103
104 Or, Download [here] and run `python setup.py install` after changing
105 directory to `/json2html`
106
107 Example Usage
108 -------------
109
110 **Example 1:** Basic usage
111
112 .. code-block:: python
113
114         from json2html import *
115         input = {
116                 "name": "json2html",
117                 "description": "Converts JSON to HTML tabular representation"
118         }
119         json2html.convert(json = input)
120
121 Output:
122
123 .. code-block:: bash
124
125         <table
126 border="1"><tr><th>name</th><td>json2html</td></tr><tr><th>description</th><td>converts
127 JSON to HTML tabular representation</td></tr></table>
128
129 ============ ========================================================
130 name         json2html
131 ------------ --------------------------------------------------------
132 description  Converts JSON to HTML tabular representation
133
134
135 [FILE:101:distinfo]
136 8951a53662ae9cfd812685facdba693fc950ffc1c1fd1a8a2d3cf4c34600689c         6977 json2html-1.3.0.tar.gz
137