UnifiedReadWrite¶
- class astropy.io.registry.UnifiedReadWrite(instance, cls, method_name, registry=None)[source]¶
Bases:
objectBase class for the worker object used in unified read() or write() methods.
This lightweight object is created for each
read()orwrite()call viaread/writedescriptors on the data object class. The key driver is to allow complete format-specific documentation of available method options via ahelp()method, e.g.Table.read.help('fits').Subclasses must define a
__call__method which is what actually gets called when the data objectread()orwrite()method is called.For the canonical example see the
Tableclass implementation (in particular theconnect.pymodule there).- Parameters:
Attributes Summary
Unified I/O registry instance.
Methods Summary
help([format, out])Output help documentation for the specified unified I/O
format.list_formats([out])Print a list of available formats to console (or
outfilehandle).Attributes Documentation
- registry¶
Unified I/O registry instance.
Methods Documentation
- help(format=None, out=None)[source]¶
Output help documentation for the specified unified I/O
format.By default the help output is printed to the console via
pydoc.pager. Instead one can supplied a file handle object asoutand the output will be written to that handle.- Parameters:
- format
str Unified I/O format name, e.g. ‘fits’ or ‘ascii.ecsv’
- out
Noneor path-like object Output destination (default is stdout via a pager)
- format