JSOB: Fault tolerant JSON parser. A standardization of low standards. Be a JSLOB.
Project description
JSONofabitch
- fault tolerant json parser
- JSON correction/formatting engine
- stochastic ascii structured data format
- a standard for low standards
- the retard proof multi-parameter, multi-type input parser
- a troll of api scraping reverse engineers
- a JSON of a bitch!
functions
loads()
- loads JSLOB compliant textdumps()
- dumps regular JSONcorrect()
- turns JSLOB to JSONdumpslob()
- dumps stochastic JSLOB
JSLOB syntax
- keypairs -
:
or=
separate key value pairs, whitespace is ignored'g=5' -> {"g": 5}
and'g:5' -> {"g": 5}
- keypairs are separated by
;
or,
in a JSLOB object, - keys - double quoted string or alphanumeric plus underscore, non-numeric first character(same as python vars).
- values - another JSLOB object, a tupple, a list, alphanumeric string without quotes, quote-enclosed string, boolean
true
false
,null
, integers, floats 'true' -> True
'false' -> False
'null' -> None
case sensitive- tuples in
( )
lists in[ ]
objects separated by comma or semicolon. trailing comma/semicolon okay - dicts/JSLOB objects have keypairs separated by semicolon or comma, nested jslob objects are terminated and separated simultaneously by
;;
or,,
, IE:'[g=5,h=3]' -> [{'g': 5, 'h': 3}]
and'[g=5;;h=3]' -> [{'g': 5}, {'h': 3}]
- other - unquoted strings must be alphanumeric plus
_
non-numeric first character. only double quotes can be used - scientific notation
2e4
resolves to $2.0 * 10^4$, always resolve to float - numbers with decimal present resolve to floats while others resolve to ints IE
'3.0' -> 3.0
and'3' -> 3
'3.' -> 3.0
conventions
- the software is called JSOB(jay-sawb) in polite company
- the standardized syntax is called JSLOB (jay-slawb)
- suggested file extension
.jslob
or.slob
or.jsob
examples
import jsonofabitch as jsob
d = jsob.loads("f=5, size=big, style=SLOB, coord=[(3,4),(1.2,3)]")
#{'f': 5, 'size': 'big', 'style': 'SLOB', 'coord': [(3, 4), (1.2, 3)]}
jsob.dumps(d)
#Out[3]: '{"f": 5, "size": "big", "style": "SLOB", "coord": [[3, 4], [1.2, 3]]}'
jsob.dumpslob(d)
#Out[4]: ' "f"= 5; "size"="big";style= "SLOB"; coord: [ (3 ,4 ), (1.2, 3,) ];'
jsob.dumpslob(d)
#Out[5]: ' "f"= 5;size="big", style: SLOB, "coord": [ (3, 4 ),(1.2 , 3 ) ];'
jsob.dumpslob(d)
#Out[6]: ' "f"= 5, size= "big",style= "SLOB"; coord: [ (3,4 ,) ,(1.2 , 3,) ];'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for jsonofabitch-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 183992e5019771ee8b5a09f65bf775a9b055c730fd99cbb8aa6b9eaa3c21a2d2 |
|
MD5 | 357cda29794bf7ebb0599b983904a553 |
|
BLAKE2b-256 | 039f74257bef84e3642b02570638b688363e8193a57c8a57497363b230d12272 |