Skip to main content

Coded JSON files. Save your files with .cjson extension to unlock these features

Project description



Coded Javascript Object Notation


Why static JSON if you can utilize CJSON




Your first CJSON code

  • Create file with .cjson extension
  • Write below code to decode the json:
    from cjson import Cjson
    cjson = Cjson(file/path/to/file.cjson);
    var b = cjson.deserialize();

Output:

{
    "source": {
        // Source JSON content
    },
    "target": {
        "fruit": "Apple",
        "size": "Large",
        "color": "Red"
    }
}

Features

Import multiple JSON files

You can use $import keyword for importing other JSON files.
You can also import multiple JSON files.

{
    "source": $import "./source.json",
    "target": {
        "fruit": "Apple",
        "size": "Large",
        "color": "Red"
    }
}

Single/ Multiple line comments

For single line comments, use //

For multi line comments, use like below:

// This is first line comment
// This is the second one

Calling relative keys using JPATH

You can also refer to other variables using $. followed by jpath.
Please note, the current version is only decoding using top to down approach

Keywords

Keyword Description
$import To import other json file
Comments(Single/ Multi-line) //
$.jpath Refer to a local variable inside JSON

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codedjson-1.1.1.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file codedjson-1.1.1.tar.gz.

File metadata

  • Download URL: codedjson-1.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for codedjson-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b5211d5c6d60a544641d59c7e24ea390ffcb6c9be4e756e99bbdb9c5964372f1
MD5 523780449cf1bddee5575c0f2b6fad1a
BLAKE2b-256 ca48c802d1e89d44855afefbf6f2bd91bff441293daab8b2d078f42dbcc3c817

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page