JSONImporter β€” JSON Import

class sloth.mmcif.importer.JSONImporter[source]

Bases: BaseImporter

Import JSON data back to mmCIF format.

__init__(dict_path=None, cache_dir=None, quiet=False)[source]

Initialize the JSON importer.

Parameters:
  • dict_path (Union[str, Path, None]) – Path to mmCIF dictionary file

  • cache_dir (Optional[str]) – Directory for caching

  • quiet (bool) – Suppress output messages

import_data(data)[source]

Import JSON data back to mmCIF format.

JSON import always expects nested structure since that’s our default export format.

Parameters:

data (Union[str, Dict[str, Any], Path]) – JSON data as string, dict, or file path

Return type:

MMCIFDataContainer

Returns:

MMCIFDataContainer with imported data