Reference/API#

astropy.io.ascii Package#

An extensible ASCII table reader and writer.

Functions#

convert_numpy(numpy_type)

Return a tuple containing a function which converts a list into a numpy array and the type produced by the converter function.

get_read_trace()

Return a traceback of the attempted read formats for the last call to read where guessing was enabled.

get_reader([reader_cls, inputter_cls, ...])

Initialize a table reader allowing for common customizations.

get_writer([writer_cls, fast_writer])

Initialize a table writer allowing for common customizations.

read(table[, guess])

Read the input table and return the table.

set_guess(guess)

Set the default value of the guess parameter for read().

write(table[, output, format, Writer, ...])

Write the input table to filename.

Classes#

AASTex(**kwargs)

AASTeX format table.

AllType()

Subclass of all other data types.

BaseData()

Base table data reader.

BaseHeader()

Base table header reader.

BaseInputter()

Get the lines from the table input and return a list of lines.

BaseOutputter()

Output table as a dict of column objects keyed on column name.

BaseReader()

Class providing methods to read and write an ASCII table using the specified header, data, inputter, and outputter instances.

BaseSplitter()

Base splitter that uses python's split method to do the work.

Basic()

Character-delimited table with a single header line at the top.

BasicData()

Basic table Data Reader.

BasicHeader()

Basic table Header Reader.

Cds([readme])

CDS format table.

Column(name)

Table column.

CommentedHeader()

Character-delimited table with column names in a comment line.

ContinuationLinesInputter()

Inputter where lines ending in continuation_char are joined with the subsequent line.

Csv()

CSV (comma-separated-values) table.

Daophot()

DAOphot format table.

DefaultSplitter()

Default class to split strings into columns using python csv.

Ecsv()

ECSV (Enhanced Character Separated Values) format table.

FastBasic([default_kwargs])

This class is intended to handle the same format addressed by the ordinary Basic writer, but it acts as a wrapper for underlying C code and is therefore much faster.

FastCommentedHeader(**kwargs)

A faster version of the CommentedHeader reader, which looks for column names in a commented line.

FastCsv(**kwargs)

A faster version of the ordinary Csv writer that uses the optimized C parsing engine.

FastNoHeader(**kwargs)

This class uses the fast C engine to read tables with no header line.

FastRdb(**kwargs)

A faster version of the Rdb reader.

FastTab(**kwargs)

A faster version of the ordinary Tab reader that uses the optimized C parsing engine.

FixedWidth([col_starts, col_ends, ...])

Fixed width table with single header line defining column names and positions.

FixedWidthData()

Base table data reader.

FixedWidthHeader()

Fixed width table header reader.

FixedWidthNoHeader([col_starts, col_ends, ...])

Fixed width table which has no header line.

FixedWidthSplitter()

Split line based on fixed start and end positions for each col in self.cols.

FixedWidthTwoLine([position_line, ...])

Fixed width table which has two header lines.

FloatType()

Describes floating-point data.

HTML([htmldict])

HTML format table.

InconsistentTableError

Indicates that an input table is inconsistent in some way.

IntType()

Describes integer data.

Ipac([definition, DBMS])

IPAC format table.

Latex([ignore_latex_commands, latexdict, ...])

LaTeX format table.

Mrt()

AAS MRT (Machine-Readable Table) format table.

NoHeader()

Character-delimited table with no header line.

NoType()

Superclass for StrType and NumType classes.

NumType()

Indicates that a column consists of numerical data.

ParameterError

Indicates that a reader cannot handle a passed parameter.

QDP([table_id, names, err_specs, sep])

Quick and Dandy Plot table.

RST([header_rows])

reStructuredText simple format table.

Rdb()

Tab-separated file with an extra line after the column definition line that specifies either numeric (N) or string (S) data.

SExtractor()

SExtractor format table.

StrType()

Indicates that a column consists of text data.

Tab()

Tab-separated table.

TableOutputter()

Output the table as an astropy.table.Table object.

WhitespaceSplitter()

Class Inheritance Diagram#

Inheritance diagram of astropy.io.ascii.latex.AASTex, astropy.io.ascii.core.AllType, astropy.io.ascii.core.BaseData, astropy.io.ascii.core.BaseHeader, astropy.io.ascii.core.BaseInputter, astropy.io.ascii.core.BaseOutputter, astropy.io.ascii.core.BaseReader, astropy.io.ascii.core.BaseSplitter, astropy.io.ascii.basic.Basic, astropy.io.ascii.basic.BasicData, astropy.io.ascii.basic.BasicHeader, astropy.io.ascii.cds.Cds, astropy.io.ascii.core.Column, astropy.io.ascii.basic.CommentedHeader, astropy.io.ascii.core.ContinuationLinesInputter, astropy.io.ascii.basic.Csv, astropy.io.ascii.daophot.Daophot, astropy.io.ascii.core.DefaultSplitter, astropy.io.ascii.ecsv.Ecsv, astropy.io.ascii.fastbasic.FastBasic, astropy.io.ascii.fastbasic.FastCommentedHeader, astropy.io.ascii.fastbasic.FastCsv, astropy.io.ascii.fastbasic.FastNoHeader, astropy.io.ascii.fastbasic.FastRdb, astropy.io.ascii.fastbasic.FastTab, astropy.io.ascii.fixedwidth.FixedWidth, astropy.io.ascii.fixedwidth.FixedWidthData, astropy.io.ascii.fixedwidth.FixedWidthHeader, astropy.io.ascii.fixedwidth.FixedWidthNoHeader, astropy.io.ascii.fixedwidth.FixedWidthSplitter, astropy.io.ascii.fixedwidth.FixedWidthTwoLine, astropy.io.ascii.core.FloatType, astropy.io.ascii.html.HTML, astropy.io.ascii.core.InconsistentTableError, astropy.io.ascii.core.IntType, astropy.io.ascii.ipac.Ipac, astropy.io.ascii.latex.Latex, astropy.io.ascii.mrt.Mrt, astropy.io.ascii.basic.NoHeader, astropy.io.ascii.core.NoType, astropy.io.ascii.core.NumType, astropy.io.ascii.core.ParameterError, astropy.io.ascii.qdp.QDP, astropy.io.ascii.rst.RST, astropy.io.ascii.basic.Rdb, astropy.io.ascii.sextractor.SExtractor, astropy.io.ascii.core.StrType, astropy.io.ascii.basic.Tab, astropy.io.ascii.core.TableOutputter, astropy.io.ascii.core.WhitespaceSplitter