cjson module
- class cjson.Cjson(content: str, is_content_cjson: bool = False)[source]
Bases:
Is
Coded JSON is an extended format of JSON formatted data storage, which gives you more previledge to organize data into more structured format.
Here is an example for CJSON format:
{ "source": $import "./source.json", "target": { "fruit": "Apple", "size": "Large", "color": "Red", "secColor": $.target.color, "colorList": [ $.target.color, $.target.secColor ], // You can add comments like this "digitCheck": 1.5, "digitImport": $.target.digitCheck, "digitArrayImport": [ $.target.digitCheck, $.target.digitImport ] } }
The above CJSON snipped will be deserialized in JSON format and can be used as same as other JSON files.
For other details, please refer to official page: https://subhendushekhar.github.io/cjson/
- deserialize()[source]
Deserializes CJSON context and returns dictionary object in JSON context.
Please Note, if any key is detected for runtime variable injections is replaced with <-tag->. No error/warning is thrown.
To inject runtime variables, use inject function