PKMNg. j/__init__.py""" Simple pipeline json parser It is as jq but better because you can use python syntax and you do not need to look in documentation every time. """ __version__ = '1.0.0' PKMNP| j/main.py#!/usr/bin/env python3 import json import sys from pygments import highlight from pygments.formatters import TerminalFormatter from pygments.lexers import JsonLexer def process(it): if len(sys.argv) <= 1: dump = json.dumps(it, sort_keys=True, indent=4) output = highlight(dump, JsonLexer(), TerminalFormatter()) print(output, end='') return print( highlight( json.dumps(eval(sys.argv[1]), sort_keys=True, indent=4), JsonLexer(), TerminalFormatter() ), end='' ) def main(): try: stdin = sys.stdin.read() it = json.loads(stdin) process(it) except json.decoder.JSONDecodeError: its = [json.loads(line.strip()) for line in stdin.split('\n') if line.strip()] for it in its: process(it) if __name__ == '__main__': main() PK!Hv !&jsonp-1.0.0.dist-info/entry_points.txtN+I/N.,()ʲM̳\\PK!HPOjsonp-1.0.0.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,szd&Y)r$[)T&UrPK!H$2"jsonp-1.0.0.dist-info/METADATASj@W Xr R5M^ګ]ew։H䴇P(T yzIdW&1/ivPҵ9ܪjP+<:֘6b QɤR AGh~ת@{72s.>XÂ0C5Z*C$Ɏ$Tm(#A9e<~"{+N5VKk ۆ>҄=J`ĥޫ8ɺVki zOg%/'6V5B5S1#P= #6@! s!Ҕ]`,A,,hkw Ș ] jX ̌'R0~+ _GF؝gB,jqPbca*7+|:NT E<)yvƞ:'Hk=F [$?е}=2t1ëzQLšwrcKn!#b1i!g8(sɮ|ȓ;ݟ;X[1eg1i4̣"K,f:Ϗq}PK!H{Z)jsonp-1.0.0.dist-info/RECORDur04C,.Kӷgzq7>#2 6Oe\V>oh3+[%l<[jT*8@4gUL? s\(1m{GR=1V X@ew5k4%ei=f$MM_O;)JuUm=P&b4$+D /*TɉZ˛CGTP0 |3cqb.ވ/lJtr7^1EHZF (=`;,PKMNg. j/__init__.pyPKMNP| j/main.pyPK!Hv !&jsonp-1.0.0.dist-info/entry_points.txtPK!HPOjsonp-1.0.0.dist-info/WHEELPK!H$2"wjsonp-1.0.0.dist-info/METADATAPK!H{Z)jsonp-1.0.0.dist-info/RECORDPK8