astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- I/O Registry (`astropy.io.registry`) »
- register_reader

# register_reader

astropy.io.registry.register_reader(data_format, data_class, function, force=False, priority=0)

  Register a reader function.

  Parameters:
    data_format `python:str`

      The data format identifier. This is the string that will be used to specify the data type when reading.

    data_class class

      The class of the object that the reader produces.

    function python:function

      The function to read in a data object.

    force bool, optional

      Whether to override any existing function if already present. Default is `False`.

    priority `python:int`, optional

      The priority of the reader, used to compare possible formats when trying to determine the best reader to use. Higher priorities are preferred over lower priorities, with the default priority being 0 (negative numbers are allowed though).