bsb_json package

Module contents

JSON parser and utilities for the BSB.

Submodules

bsb_json.parser module

JSON parsing module.

Built on top of the Python json module. Adds JSON imports and references.

class bsb_json.parser.JsonParser

Bases: ParsesReferences, ConfigurationParser

Parser plugin class to parse JSON configuration files.

data_description = 'JSON'
data_extensions = ('json',)
data_syntax = 'json'
generate(tree, pretty=False)

Generate a string representation of the configuration tree (dictionary).

Parameters:
  • tree (dict) – configuration tree

  • pretty (bool) – if True, will add indentation to the output string

Returns:

str representation of the configuration tree

Return type:

str

parse(content, path=None)

Traverse the parsed tree and resolve any $ref and $import

Subpackages