Reference/API#

astropy.io.votable Package#

This package reads and writes data formats used by the Virtual Observatory (VO) initiative, particularly the VOTable XML format.

Functions#

parse(source[, columns, invalid, verify, ...])

Parses a VOTABLE xml file (or file-like object), and returns a VOTableFile object.

parse_single_table(source, **kwargs)

Parses a VOTABLE xml file (or file-like object), reading and returning only the first TableElement instance.

validate(source[, output, xmllint, filename])

Prints a validation report for the given file.

from_table(table[, table_id])

Given an Table object, return a VOTableFile file structure containing just that single table.

is_votable(source)

Reads the header of a file to determine if it is a VOTable file.

writeto(table, file[, tabledata_format])

Writes a VOTableFile to a VOTABLE xml file.

Classes#

Conf()

Configuration parameters for astropy.io.votable.

astropy.io.votable.tree Module#

Classes#

Link([ID, title, value, href, action, id, ...])

LINK elements: used to reference external documents and servers through a URI.

Info([ID, name, value, id, xtype, ref, ...])

INFO elements: arbitrary key-value pairs for extensions to the standard.

Values(votable, field[, ID, null, ref, ...])

VALUES element: used within FIELD and PARAM elements to define the domain of values.

Field(votable[, ID, name, datatype, ...])

FIELD element: describes the datatype of a particular column of data.

Param(votable[, ID, name, value, datatype, ...])

PARAM element: constant-valued columns in the data.

CooSys([ID, equinox, epoch, system, id, ...])

COOSYS element: defines a coordinate system.

TimeSys([ID, timeorigin, timescale, ...])

TIMESYS element: defines a time system.

FieldRef(table, ref[, ucd, utype, config, pos])

FIELDref element: used inside of GROUP elements to refer to remote FIELD elements.

ParamRef(table, ref[, ucd, utype, config, pos])

PARAMref element: used inside of GROUP elements to refer to remote PARAM elements.

Group(table[, ID, name, ref, ucd, utype, ...])

GROUP element: groups FIELD and PARAM elements.

TableElement(votable[, ID, name, ref, ucd, ...])

TABLE element: optionally contains data.

Resource([name, ID, utype, type, id, ...])

RESOURCE element: Groups TABLE and RESOURCE elements.

VOTableFile([ID, id, config, pos, version])

VOTABLE element: represents an entire file.

Element()

A base class for all classes that represent XML elements in the VOTABLE file.

MivotBlock([content])

MIVOT Block holder: Processing VO model views on data is out of the scope of Astropy.

astropy.io.votable.converters Module#

This module handles the conversion of various VOTABLE datatypes to/from TABLEDATA and BINARY formats.

Functions#

get_converter(field[, config, pos])

Get an appropriate converter instance for a given field.

table_column_to_votable_datatype(column)

Given a astropy.table.Column instance, returns the attributes necessary to create a VOTable FIELD element that corresponds to the type of the column.

Classes#

Converter(field[, config, pos])

The base class for all converters.

astropy.io.votable.ucd Module#

This file contains routines to verify the correctness of UCD strings.

Functions#

parse_ucd(ucd[, ...])

Parse the UCD into its component parts.

check_ucd(ucd[, ...])

Returns False if ucd is not a valid unified content descriptor.

astropy.io.votable.util Module#

Various utilities and cookbook-like things.

Functions#

convert_to_writable_filelike(fd[, compressed])

Returns a writable file-like object suitable for streaming output.

coerce_range_list_param(p[, frames, numeric])

Coerces and/or verifies the object p into a valid range-list-format parameter.

astropy.io.votable.validator Package#

Validates a large collection of web-accessible VOTable files, and generates a report as a directory tree of HTML files.

Functions#

make_validation_report([urls, destdir, ...])

Validates a large collection of web-accessible VOTable files.

astropy.io.votable.xmlutil Module#

Various XML-related utilities.

Functions#

check_id(ID[, name, config, pos])

Raises a VOTableSpecError if ID is not a valid XML ID.

fix_id(ID[, config, pos])

Given an arbitrary string, create one that can be used as an xml id.

check_token(token, attr_name[, config, pos])

Raises a ValueError if token is not a valid XML token.

check_mime_content_type(content_type[, ...])

Raises a VOTableSpecError if content_type is not a valid MIME content type.

check_anyuri(uri[, config, pos])

Raises a VOTableSpecError if uri is not a valid URI.

validate_schema(filename[, version])

Validates the given file against the appropriate VOTable schema.