Ziel Python Library Master (36) json2html

[Bibliotheksbeschreibung]

Verwandeln Sie das JSON-Format in eine einfach zu lesende HTML-Tabelle

【Programm】

json2html_1.py


# -*- coding: utf-8 -*-

from json2html import json2html

print json2html.convert(json = {'name':'softvar','age':'22'})
# <table border="1"><tr><th>age</th><td>22</td></tr><tr><th>name</th><td>softvar</td></tr></table>
1.png

json2html_2.py


# -*- coding: utf-8 -*-

from json2html import json2html

_json2conv = {"sample": [ {"a":1, "b":2, "c":3}, {"a":5, "b":6, "c":7} ] }
print json2html.convert(json = _json2conv)

'''
<table border="1"><tr><th>sample</th><td><table border="1"><tr><th>a</th>
<th>c</th><th>b</th></tr><tr><td>1</td><td>3</td><td>2</td></tr>
<tr><td>5</td><td>7</td><td>6</td></tr></table></td></tr></table>
'''
2.png

json2html_3.py


# -*- coding: utf-8 -*-

from json2html import json2html

_json2conv = {
        "glossary": {
                "title": "example glossary",
                "GlossDiv": {
                        "title": "S",
                        "GlossList": {
                                "GlossEntry": {
                                        "ID": "SGML",
                                        "SortAs": "SGML",
                                        "GlossTerm": "Standard Generalized Markup Language",
                                        "Acronym": "SGML",
                                        "Abbrev": "ISO 8879:1986",
                                        "GlossDef": {
                                                "para": "A meta-markup language, used to create markup languages such as DocBook.",
                                                "GlossSeeAlso": ["GML", "XML"]
                                        },
                                        "GlossSee": "markup"
                                }
                        }
                }
        }
}

print json2html.convert(json = _json2conv)

'''
<table border="1"><tr><th>glossary</th><td><table border="1"><tr><th>title</th>
<td>example glossary</td></tr><tr><th>GlossDiv</th><td><table border="1"><tr>
<th>GlossList</th><td><table border="1"><tr><th>GlossEntry</th><td><table border="1">
<tr><th>GlossDef</th><td><table border="1"><tr><th>GlossSeeAlso</th>
<td><ul><li>GML</li><li>XML</li></ul></td></tr><tr><th>para</th>
<td>A meta-markup language, used to create markup languages such as DocBook.</td>
</tr></table></td></tr><tr><th>GlossSee</th><td>markup</td></tr><tr>
<th>Acronym</th><td>SGML</td></tr><tr><th>GlossTerm</th>
<td>Standard Generalized Markup Language</td></tr><tr><th>SortAs</th>
<td>SGML</td></tr><tr><th>Abbrev</th><td>ISO 8879:1986</td></tr><tr>
<th>ID</th><td>SGML</td></tr></table></td></tr></table></td></tr><tr>
<th>title</th><td>S</td></tr></table></td></tr></table></td></tr></table>
'''
3.png

[Referenzseite]

pypi  github

Recommended Posts

Ziel Python Library Master (36) json2html
Ziel Python Library Master (48) Autopep8
Ziel Python-Master (49) psidialogs
Ziel Python Library Master (26) easyxml
Ziel Python Library Master (29) table_printer
Zielen Sie auf die Namespaces des Python Library Master (55)
Ziel Python Library Master (46) Browserplus
Ziel Python Library Master (30) Chronyk
Ziel Python Library Master (3) Arbeitskalender
Ziel Python Speed Master (42) Speedrecorder
Ziel Python Library Master (37) Slimurl
Ziel Python Library Master (44) Pynetviz
Ziel Python Library Master (8) Rolex
Ziel Python Library Master (52) Marktime
Ziel Python Library Master (7) Numparser
Ziel Python Library Master (21) hy
Richten Sie die Anforderungen des Python Library Master (18) aus
Ziel Python Library Master (13) easydev
Ziel Python Library Master (20) Pyyaml
Zielen Sie gleichzeitig auf den Python-Bibliotheksmaster (34)
Ziel ist die Wortsegmentierung des Python Library Master (40)
Ziel Python Library Master (43) cpmoptimize
Ziel Python Library Master (68) Pazudorasolver
Ziel Python Library Master (58) Fälscher
Ziel Python Library Master (11) nlist
Ziel Python Library Master (38) beautiful_print
Ziel Python Library Master (65) Geopy
Ziel Python Library Master (2) Vincent
Zielen Sie auf das Logbuch des Python Library Master (59)
Ziel Python Library Master (51) Pyautogui
Ziel Python Library Master (10) Timeit
Ziel Python Python Master (0) Links
Ziel Python Library Master (66) youtube-dl
Ziel Python Library Master (53) Psutil
Ziel Python Library Master (22) htmltag
Ziel Python Library Master (67) httpie
Ziel Python Library Master (45) xlsxwriter
Ziel Python Library Master (9) WebHelpers
Ziel Python Library Master (32) SQL
Ziel Python Library Master (60) Colourettu
Ziel Python Library Master (64) Pretty_cron
Ziel Python Library Master (56) Colorthief
Ziel Python Library Master (61) verschachtelte Suche
Ziel Python Range Master (17) RangeParser
Ziel Python Library Master (47) Deckor
Ziel Python Library Master (25) bestellte Menge
Ziel Python Python Library Master (62) Blicke
Ziel Python Library Master (12) Excel
Ziel Python Library Master (24) Combi
Ziel Python Library Master (63) easygui
Ziel Python Library Master (19) Riemann
Ziel Python Library Master (39) goless
Ziel Python Library Master (54) tqdm
Zielen Sie auf das Byteplay von Python Library Master (16)
Ziel Python Python Master (23) memory_utils
Ziel Python Library Master (27) Benchit
Ziel Python Library Master (35) Pywildcard
Ziel Python Library Master (14) Pyknon
Ziel Python Library Master (15) Brute
Zielen Sie auf Python Library Master (50) xlwings
Ziel Python Library Master (31) Adipy