pyVO utilities (pyvo.utils)

This subpackage collects a few packages intended to help developing and maintaining pyVO. Almost all of this is not part of pyVO’s public API and may change at any time. It is documented here for the convenience of the maintainers and to help users when the effects of this code becomes user-visible.

There is one piece of public API here: pyvo.utils.http.setup_user_agent. This can be used at the beginning of a program to mark pyVO requests as comming from a specific client, e.g.,:

>>> from pyvo.utils.http import setup_user_agent
>>> setup_user_agent(primary_component="clusterfinder")

Code doing bulk downloads (e.g., for mirroring or archiving) should use:

>>> setup_user_agent(purpose="copy")

Finally, code running for validation or testing should do before making such requests:

>>> setup_user_agent(purpose="test")

See Operational Identification of Software Components for the background of this.

Reference/API

pyvo.utils.http Module

HTTP utils

Functions

setup_user_agent(*[, purpose, primary_component])

Sets up a user agent for http requests made by pyVO.

pyvo.utils.xml.elements Module

Functions

make_add_complexcontent(self, element_name, ...)

Factory for generating add functions for elements with complex content.

make_add_simplecontent(self, element_name, ...)

Factory for generating add functions for elements with simple content.

parse_for_object(source, object_type[, ...])

Parses an xml file (or file-like object), and returns a object of specified object_type.

Classes

xmlattribute([fget, fset, fdel, doc, name])

xmlelement([fget, fset, fdel, fadd, ...])

Element([config, pos, _name, _ns])

A base class for all classes that represent XML elements.

ElementWithXSIType(*args, **kwargs)

An XML element that supports type dispatch through xsi:type.

ContentMixin([config, pos, _name, _ns])

Mixin class for elements with inner content.