Skip to main content
`Ctrl`+`K`

# identify_format

astropy.io.registry.identify_format(origin, data_class_required, path, fileobj, args, kwargs)

  Loop through identifiers to see which formats match.

  Parameters:
    origin `python:str`

      A string `"read` or `"write"` identifying whether the file is to be opened for reading or writing.

    data_class_required `object`

      The specified class for the result of `read` or the class that is to be written.

    path `python:str` or python:path-like object or `python:None`

      The path to the file or None.

    fileobj python:file-like object or None.

      An open file object to read the file’s contents, or `None` if the file could not be opened.

    args python:sequence

      Positional arguments for the `read` or `write` function. Note that these must be provided as sequence.

    kwargs dict-like

      Keyword arguments for the `read` or `write` function. Note that this parameter must be `dict`-like.

  Returns:
    valid_formats `python:list`

      List of matching formats.