Resource

class astropy.io.votable.tree.Resource(name=None, ID=None, utype=None, type='results', id=None, config=None, pos=None, **kwargs)[source]

Bases: Element, _IDProperty, _NameProperty, _UtypeProperty, _DescriptionProperty

RESOURCE element: Groups TABLE and RESOURCE elements.

The keyword arguments correspond to setting members of the same name, documented below.

Attributes Summary

coordinate_systems

A list of coordinate system definitions (COOSYS elements) for the RESOURCE.

extra_attributes

A dictionary of string keys to string values containing any extra attributes of the RESOURCE element that are not defined in the specification.

groups

A list of groups

infos

A list of informational parameters (key-value pairs) for the resource.

links

A list of links (pointers to other documents or servers through a URI) for the resource.

params

A list of parameters (constant-valued columns) for the resource.

resources

A list of nested resources inside this resource.

tables

A list of tables in the resource.

time_systems

A list of time system definitions (TIMESYS elements) for the RESOURCE.

type

[required] The type of the resource.

Methods Summary

iter_coosys()

Recursively iterates over all the COOSYS elements in the resource and nested resources.

iter_fields_and_params()

Recursively iterates over all FIELD and PARAM elements in the resource, its tables and nested resources.

iter_info()

Recursively iterates over all the INFO elements in the resource and nested resources.

iter_tables()

Recursively iterates over all tables in the resource and nested resources.

iter_timesys()

Recursively iterates over all the TIMESYS elements in the resource and nested resources.

parse(votable, iterator, config)

For internal use.

to_xml(w, **kwargs)

For internal use.

Attributes Documentation

coordinate_systems

A list of coordinate system definitions (COOSYS elements) for the RESOURCE. Must contain only CooSys objects.

extra_attributes

A dictionary of string keys to string values containing any extra attributes of the RESOURCE element that are not defined in the specification. (The specification explicitly allows for extra attributes here, but nowhere else.)

groups

A list of groups

infos

A list of informational parameters (key-value pairs) for the resource. Must only contain Info objects.

A list of links (pointers to other documents or servers through a URI) for the resource. Must contain only Link objects.

params

A list of parameters (constant-valued columns) for the resource. Must contain only Param objects.

resources

A list of nested resources inside this resource. Must contain only Resource objects.

tables

A list of tables in the resource. Must contain only Table objects.

time_systems

A list of time system definitions (TIMESYS elements) for the RESOURCE. Must contain only TimeSys objects.

type

[required] The type of the resource. Must be either:

  • ‘results’: This resource contains actual result values (default)

  • ‘meta’: This resource contains only datatype descriptions (FIELD elements), but no actual data.

Methods Documentation

iter_coosys()[source]

Recursively iterates over all the COOSYS elements in the resource and nested resources.

iter_fields_and_params()[source]

Recursively iterates over all FIELD and PARAM elements in the resource, its tables and nested resources.

iter_info()[source]

Recursively iterates over all the INFO elements in the resource and nested resources.

iter_tables()[source]

Recursively iterates over all tables in the resource and nested resources.

iter_timesys()[source]

Recursively iterates over all the TIMESYS elements in the resource and nested resources.

parse(votable, iterator, config)[source]

For internal use. Parse the XML content of the children of the element.

Parameters:
iteratorxml python:iterable

An iterator over XML elements as returned by get_xml_iterator.

configpython:dict

The configuration dictionary that affects how certain elements are read.

Returns:
selfElement

Returns self as a convenience.

to_xml(w, **kwargs)[source]

For internal use. Output the element to XML.

Parameters:
wastropy.utils.xml.writer.XMLWriter object

An XML writer to write to.

**kwargspython:dict

Any configuration parameters to control the output.