CAOM-2.4 repo access and tools
Project description
Client caom2-repo
caom2Repo provides a client (caom2-repo) to perform CRUD (Create, Read, Update, Delete) on an observation in a collection in a repository.
Visitor Plugin
The client also provides a visitor function which accepts a plugin. The visitor function iterates the observations of a collection and updates them according to the algorithm of the plugin function. The following is an example plugin to add a ‘PREVIEW’ Plane to an observation. More plugin examples can be found in caom2repo/tests/.
from __future__ import (absolute_import, division, print_function, unicode_literals) from caom2.observation import Observation from caom2.plane import Plane class ObservationUpdater(object): """ObservationUpdater that adds a plane to the observation.""" def update(self, observation, **kwargs): """ Processes an observation and updates it """ assert isinstance(observation, Observation), ( "observation %s is not an Observation".format(observation)) observation.planes.add(Plane('PREVIEW'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
caom2repo-1.5.3.tar.gz
(40.6 kB
view hashes)
Built Distribution
caom2repo-1.5.3-py3-none-any.whl
(46.6 kB
view hashes)
Close
Hashes for caom2repo-1.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8741b93114fbb071234715696fdd2dc1ba7d084f3dc8630e41e4a5d4b1117597 |
|
MD5 | 44d7b9f028b1d032faa1016d61f44880 |
|
BLAKE2b-256 | 7388d2c74fbe77c5124a9936eab6cd3d7c9aed256aec12556ac8bf8f59f0a151 |