astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- VOTable XML handling (`astropy.io.votable`) »
- Resource

# Resource

class `astropy.io.votable.tree.``Resource`

  Bases: `astropy.io.votable.tree.Element`, `astropy.io.votable.tree._IDProperty`, `astropy.io.votable.tree._NameProperty`, `astropy.io.votable.tree._UtypeProperty`, `astropy.io.votable.tree._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.
  `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.
  `type` | [required] The type of the resource. Must be either:

  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.
  `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.)

  `infos`

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

  `links`

    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.

  `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`()

    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.

  `parse`(votable, iterator, config)

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

    Parameters:

    iterator : xml iterator

    > An iterator over XML elements as returned by `get_xml_iterator`.

    config : dict

    > The configuration dictionary that affects how certain elements are read.

    Returns:

    self : Element

    > Returns self as a convenience.

  `to_xml`(w, **kwargs)

    For internal use. Output the element to XML.

    Parameters:

    w : astropy.utils.xml.writer.XMLWriter object

    > An XML writer to write to.

    kwargs : dict

    > Any configuration parameters to control the output.