Skip to main content

Granular Structured Object Notation.

Project description

GSON

Granular Structured Object Notation.

Features

GSON is a superset of JSON with:

  • Fast parsing through Unicode markers.
  • A simple syntax for:
    • Multiline strings
    • File inclusion
    • UUID and TUID generation

Sample

{
    "path":
        "test.json",
    "text":
        ‴first line
        second line
        third line ‗
        ‗ fourth line
        fifth line‴,
    "person":
        {
            "name":
                "Jack",
            "age":
                48
        },
    "personArray":
        [
            {
                "name":
                    "Mike",
                "age":
                    35
            },
            {
                "name":
                    "Nina",
                "age":
                    32
            },
            {
                "name":
                    "Pete",
                "age":
                    38
            }
        },
    "personByIdMap":
        {
            "mike":
                {
                    "name":
                        "Mike",
                    "age":
                        35
                },
            "nina":
                {
                    "name":
                        "Nina",
                    "age":
                        32
                },
            "pete":
                {
                    "name":
                        "Pete",
                    "age":
                        38
                }
        ],
    "escaped":
        "\u2034",
    "uuid":
        ‴‼#jack‴,
    "tuid":
        ‴‼%jack‴,
    "included":
        ‴‼@included.gson‴
}

Syntax

Any JSON file is also a GSON file, since GSON is a superset of JSON.

Multiline strings are enclosed by characters, and use the character to represent a non-trimmable space:

‴first line
second line
third line ‗
‗ fourth line
fifth line‴

Command strings are also enclosed by characters, but start with a character:

  • ‴‼#id‴ generates an MD5-based UUID.
  • ‴‼%id‴ generates an MD5-based TUID.
  • ‴‼@path/to/file.gson‴ includes the contents of another GSON file.

Use Cases

GSON is designed to extend JSON in scenarios where additional flexibility and expressiveness are beneficial.

It is particularly well suited for configuration files where readability matters, especially when working with multiline text.

It also helps organize large configurations or datasets by allowing them to be split into multiple files and included where needed.

Additionally, GSON supports generating consistent identifiers such as UUIDs and TUIDs directly within the data.

Limitations

When used as literal text:

  • The character must be escaped in string literals.
  • The and characters must be escaped in multiline string literals.

Version

0.4

Author

Eric Pelzer (ecstatic.coder@gmail.com).

License

This project is licensed under the GNU Lesser General Public License version 3.

See the LICENSE.md file for details.

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

senselogic_gson-0.4.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

senselogic_gson-0.4.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file senselogic_gson-0.4.0.tar.gz.

File metadata

  • Download URL: senselogic_gson-0.4.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for senselogic_gson-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4292b15e0a05ad84f29ef50520c2ade1f3db2171d1ed29994c6515961aa0b804
MD5 d7fb7e25b4555e14ba4f8053d3bee48b
BLAKE2b-256 1efc1d9dc1421730f09fbadb3fa32450672fbca6b641047a54352fec6ada500f

See more details on using hashes here.

File details

Details for the file senselogic_gson-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for senselogic_gson-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5377514895f50d2767ecbbff62f85113249d003ca53884a3f6dd6edfb7b193cc
MD5 687fd9d5f050f119448a550b9bfb343f
BLAKE2b-256 6dbfb239d2c4434676ef9a8092b202322595ea4a09122b1d56aafcc3dc0d882e

See more details on using hashes here.

Supported by

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