Skip to main content

CAOM-2.3 repo access and tools

Project description

https://img.shields.io/pypi/v/caom2repo.svg

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


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.4.2.tar.gz (26.6 kB view details)

Uploaded Source

File details

Details for the file caom2repo-1.4.2.tar.gz.

File metadata

  • Download URL: caom2repo-1.4.2.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for caom2repo-1.4.2.tar.gz
Algorithm Hash digest
SHA256 5015fff2db897696d03f4487a6dd373b00595626694eb28cff5c0298cebb60fe
MD5 e6fe3ac60c170bd26d6b0f2b10ebe9b8
BLAKE2b-256 90d67a4cb8326b217349b24837db2e4556a1de30dfd28f670a63ff5f15efc9d4

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