# spacepy.datamodel.writeJSONMetadata

`spacepy.datamodel.``writeJSONMetadata`(fname, insd, depend0=None, order=None, verbose=False, returnString=False)

  Scrape metadata from SpaceData object and make a JSON header

  Parameters: | fname : str Filename to write to (can also use a file-like object) None can be given in conjunction with the returnString keyword to skip writing output insd : spacepy.datamodel.SpaceData SpaceData with associated attributes and variables in dmarrays
  Returns: | None (unless returnString keyword is True)
  Other Parameters:
  | depend0 : str (optional) variable name to use to indicate parameter on which other data depend (e.g. Time) order : list (optional) list of key names in order of start column in output JSON file verbose: bool (optional) verbose output returnString: bool (optional) return JSON header as string instead of returning None