belso.translator.serialization package — belso 0.0.1 documentation

# belso.translator.serialization package

## Submodules

## belso.translator.serialization.json_format module

belso.translator.serialization.json_format.json_to_schema(json_input)

  Convert a standardized JSON format or JSON file to a belso Schema.

  Return type:

    `Type`[`Schema`]

  ### Args

  - json_input: either a JSON dictionary or a file path to a JSON file.

  ### Returns

  - Type[Schema]: the belso Schema.

belso.translator.serialization.json_format.schema_to_json(schema, file_path=None)

  Convert a belso Schema to a standardized JSON format and optionally save to a file.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  param file_path:

    path to save the JSON to a file.

  type file_path:

    Optional[Union[str, Path, PathLike]]

  ### Returns

  - Dict[str, Any]: the schema in JSON format.

## belso.translator.serialization.xml_format module

belso.translator.serialization.xml_format.schema_to_xml(schema, file_path=None)

  Convert a belso Schema to XML format and optionally save to a file.

  Return type:

    `str`

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  param file_path:

    path to save the XML to a file.

  type file_path:

    Optional[Union[str, Path, PathLike]]

  ### Returns

  - str: the schema in XML format.

belso.translator.serialization.xml_format.xml_to_schema(xml_input)

  Convert XML data or an XML file to a belso Schema.

  Return type:

    `Type`[`Schema`]

  ### Args

  - xml_input: either an XML string, Element, or a file path to an XML file.

  ### Returns

  - Type[Schema]: the belso Schema.

## Module contents

belso.translator.serialization.json_to_schema(json_input)

  Convert a standardized JSON format or JSON file to a belso Schema.

  Return type:

    `Type`[`Schema`]

  ### Args

  - json_input: either a JSON dictionary or a file path to a JSON file.

  ### Returns

  - Type[Schema]: the belso Schema.

belso.translator.serialization.schema_to_json(schema, file_path=None)

  Convert a belso Schema to a standardized JSON format and optionally save to a file.

  Return type:

    `Dict`[`str`, `Any`]

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  param file_path:

    path to save the JSON to a file.

  type file_path:

    Optional[Union[str, Path, PathLike]]

  ### Returns

  - Dict[str, Any]: the schema in JSON format.

belso.translator.serialization.schema_to_xml(schema, file_path=None)

  Convert a belso Schema to XML format and optionally save to a file.

  Return type:

    `str`

  ### Args

  param schema:

    the schema to convert.

  type schema:

    Type[Schema]

  param file_path:

    path to save the XML to a file.

  type file_path:

    Optional[Union[str, Path, PathLike]]

  ### Returns

  - str: the schema in XML format.

belso.translator.serialization.xml_to_schema(xml_input)

  Convert XML data or an XML file to a belso Schema.

  Return type:

    `Type`[`Schema`]

  ### Args

  - xml_input: either an XML string, Element, or a file path to an XML file.

  ### Returns

  - Type[Schema]: the belso Schema.