Skip to main content
`Ctrl`+`K`

# skbio.io.registry.IORegistry.sniff

IORegistry.sniff(file, into=None, **kwargs)

  Detect the format of a given file and suggest kwargs for reading.

  Parameters:
    file openable (filepath, URL, filehandle, etc.)

      The file to sniff. Something that is understood by `skbio.io.open`.

    kwargs dict, optional

      Keyword arguments will be passed to `skbio.io.open`. `newline` cannot be provided.

  Returns:
    (str, dict)

      The name of the format of the file and any suggested kwargs for use with the corresponding reader.

  Raises:
    UnrecognizedFormatError

      This occurs when the format is not ‘claimed’ by any registered sniffer or when the format is ambiguous and has been ‘claimed’ by more than one sniffer.

    TypeError

      If `newline` is provided in `kwargs`.