Skip to main content

Data models for IVOA protocols

Project description

vo-models

vo-models an open-source project to provide Python models and OpenAPI specifications 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.

  • OpenAPI Specifications: The project includes OpenAPI definitions for IVOA protocols. The use of OpenAPI provides a standardized and machine-readable way to describe the IVOA protocols. OpenAPI specifications offer benefits such as automatic documentation generation, and automatic client and server code generation.

  • Expandability: The project is designed with future expansion in mind. Plans include extending the schema and models to cover other IVOA standards.

Protocols

The following IVOA protocols are currently supported / under development:

  • UWS (Universal Worker Service) version 1.1:
    • Active development:
      • OpenAPI Models
      • Pydantic-XML Models
    • Planned:
      • OpenAPI Service Definition

Installation

Conda

To install the project using Conda, you can use the provided environment file:

git clone https://github.com/spacetelescope/vo-models.git
cd vo-models
conda env create -f environment.yml
conda activate vo-models
pip install -r requirements.txt
pip install .

For active development, install the project in development mode:

pip install -e .

Pip

If you prefer to use pip, you can install the project directly from the repository:

pip install -r requirements.txt
pip install .

Usage

OpenAPI Schema

OpenAPI schema files representing IVOA protocol transactions can be found in the vo/models/openapi directory.

For each protocol, two files are provided: a components.yml file containing the JSON/XML schema definitions for request / response transactions, and a file named after the protocol (e.g. uws.yml) containing the OpenAPI specification for the protocol. The schema models, and the OpenAPI specification, are viewable in the Swagger Editor.

Note: Currently, the OpenAPI API definition files are not guaranteed to be complete. They are provided as a starting point for future development, and an example of how the schema definitions can be used.

Pydantic-XML Models

Python models using pydantic-xml, a library based on Pydantic, are provided in the vo/models/xml directory.

These models can be used to parse and validate XML data into Python objects, as well as serialize Python objects into XML data. These models can be used with any Python web framework, but are particularly useful when used libraries that leverage the power of Pydantic, such as FastAPI.

Contributing

Contributions to the project are more than welcome. Collaboration and discussion with other IVOA members, service implementors, and developers is what started this project, and is what makes the IVOA great.

If you are interested in contributing, whether that be adding a new protocol, improving the schema, fixing a bug or even a typo, please feel free to open an issue or pull request.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vo-models-0.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

vo_models-0.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file vo-models-0.0.1.tar.gz.

File metadata

  • Download URL: vo-models-0.0.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vo-models-0.0.1.tar.gz
Algorithm Hash digest
SHA256 891e029a79505f3608da66fb081d6c5e592cac6b331386f93dc86641a00361da
MD5 7bc1b73f81affdd7142dafcbe1105a1a
BLAKE2b-256 3fda732fd977afdec4645f6ee32c0c78952703f4f073c6fcc467f676f99d2d34

See more details on using hashes here.

File details

Details for the file vo_models-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: vo_models-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for vo_models-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc118dabcc472dc31e8cf2f0f3393541c6764e8123e948911d2cadf95cfc5ce
MD5 9a71e3ce54775c9937f969c4ba32e496
BLAKE2b-256 57db1259c17942b4a7f36862ea9d33c78cafc409295bfcd1dbd15e60f3d99208

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page