Skip to main content

doc on github.io

json2html

show JSON in HTML. rows sampling, collapse/expand, etc.


Installation

  • pip install json_to_html
  • run : "json2html" or "python -mjson2html"

Examples

[yonghang@W5202860 json2html]$ curl -s walkerever.com/share/test/json/s6.json | qic
{
  "users": [
    {
      "userId": 1,
      "firstName": "Krish",
      "lastName": "Lee",
      "phoneNumber": "123456",
      "emailAddress": "krish.lee@learningcontainer.com"
    },
    {
      "userId": 2,
      "firstName": "racks",
      "lastName": "jacson",
      "phoneNumber": "123456",
      "emailAddress": "racks.jacson@learningcontainer.com"
    },
    {
      "userId": 3,
      "firstName": "denial",
      "lastName": "roast",
      "phoneNumber": "33333333",
      "emailAddress": "denial.roast@learningcontainer.com"
    },
    {
      "userId": 4,
      "firstName": "devid",
      "lastName": "neo",
      "phoneNumber": "222222222",
      "emailAddress": "devid.neo@learningcontainer.com"
    },
    {
      "userId": 5,
      "firstName": "jone",
      "lastName": "mac",
      "phoneNumber": "111111111",
      "emailAddress": "jone.mac@learningcontainer.com"
    }
  ]
}


conver to plain HTML

[yonghang@W5202860 json2html]$ curl -s walkerever.com/share/test/json/s6.json | python -mjson2html

users
userId 1
firstName Krish
lastName Lee
phoneNumber 123456
emailAddress krish.lee@learningcontainer.com
userId 2
firstName racks
lastName jacson
phoneNumber 123456
emailAddress racks.jacson@learningcontainer.com
userId 3
firstName denial
lastName roast
phoneNumber 33333333
emailAddress denial.roast@learningcontainer.com
userId 4
firstName devid
lastName neo
phoneNumber 222222222
emailAddress devid.neo@learningcontainer.com
userId 5
firstName jone
lastName mac
phoneNumber 111111111
emailAddress jone.mac@learningcontainer.com
</td>

with -Z option

[yonghang@W5202860 json2html]$ curl -s walkerever.com/share/test/json/s6.json | python -mjson2html -Z

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('tr.parent') .css("cursor", "pointer") .attr("title", "Click to expand/collapse") .click(function () { $(this).siblings('.child-' + this.id).toggle(); }); $('tr[@class^=child-]').hide().children('td'); }); </script>
D(1)
users
L(5)
userId 1
firstName Krish
lastName Lee
phoneNumber 123456
emailAddress krish.lee@learningcontainer.com
userId 2
firstName racks
lastName jacson
phoneNumber 123456
emailAddress racks.jacson@learningcontainer.com
userId 3
firstName denial
lastName roast
phoneNumber 33333333
emailAddress denial.roast@learningcontainer.com
userId 4
firstName devid
lastName neo
phoneNumber 222222222
emailAddress devid.neo@learningcontainer.com
userId 5
firstName jone
lastName mac
phoneNumber 111111111
emailAddress jone.mac@learningcontainer.com
</td>

Metadata

Release files for json-to-html 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-to-html 1.0.2
File Size Uploaded Provenance Actions
json_to_html-1.0.2.tar.gz 10.7 kB Without provenance Details for json_to_html-1.0.2.tar.gz

Release files / json_to_html-1.0.2.tar.gz

Download URL json_to_html-1.0.2.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
710553928ba448fa959bc1616da0b3eae39c9ff8d25245b7631b13218f651164
BLAKE2b-256 checksum
How to use checksums
9678f4b77eb1f2296363736c8aa70a5f3bdb9dfe0144bfd76b50a88c8d5b4d5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for json-to-html 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page