vo-models¶
vo-models
an open-source project to provide Python models for IVOA service protocols.
The project is designed to be used by IVOA members, service implementors, and developers to help facilitate the development of IVOA-compliant services and clients.
Features¶
Pydantic-xml Models: The project includes Python models for IVOA protocols, using pydantic-xml. Based on Pydantic, these models describe transactions for an IVOA protocol, such as UWS, and feature automatic validation, parsing and serialization of XML data for use with Python clients and web frameworks.
Using the models in your project for validation and serialization to XML is as simple as:
from vo_models.uws import ShortJobDescription
from vo_models.uws.types import ExecutionPhase
job = ShortJobDescription(
phase=ExecutionPhase.PENDING, # or use "PENDING"
run_id = "run_1",
job_id = "job_1",
creation_time = "2021-01-01T00:00:00Z",
)
job.to_xml()
<uws:jobref id="job_1" xlink:type="simple">
<uws:phase>PENDING</uws:phase>
<uws:runId>run_1</uws:runId>
</uws:jobref>
For more information on getting started with vo-models
, see Quickstart.