=========
Caom2Repo
=========
.. image:: https://img.shields.io/pypi/v/caom2repo.svg
:target: https://pypi.python.org/pypi/caom2repo
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'))
Raw data
{
"_id": null,
"home_page": "http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2",
"name": "caom2repo",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7, <4",
"maintainer_email": "",
"keywords": "",
"author": "Canadian Astronomy Data Centre",
"author_email": "cadc@nrc-cnrc.gc.ca",
"download_url": "https://files.pythonhosted.org/packages/1e/9b/41a68fb19d4f697c80d20c75efb7783f4fdb6c4f74da77876916f289b2ef/caom2repo-1.6.1.tar.gz",
"platform": null,
"description": "=========\nCaom2Repo\n=========\n\n.. image:: https://img.shields.io/pypi/v/caom2repo.svg\n :target: https://pypi.python.org/pypi/caom2repo\n\nClient caom2-repo\n=================\ncaom2Repo provides a client (caom2-repo) to perform CRUD (Create, Read, Update, Delete) on an observation in a collection in a repository.\n\nVisitor Plugin\n==============\nThe 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/. ::\n\n from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\n from caom2.observation import Observation\n from caom2.plane import Plane\n\n\n class ObservationUpdater(object):\n \"\"\"ObservationUpdater that adds a plane to the observation.\"\"\"\n\n def update(self, observation, **kwargs):\n \"\"\"\n Processes an observation and updates it\n \"\"\"\n assert isinstance(observation, Observation), (\n \"observation %s is not an Observation\".format(observation))\n observation.planes.add(Plane('PREVIEW'))\n",
"bugtrack_url": null,
"license": "AGPLv3",
"summary": "CAOM-2.4 repo access and tools",
"version": "1.6.1",
"project_urls": {
"Homepage": "http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c9e9c017d86fd6d4b9e56c611152afa5165c7e738c72660f3ccae183fc7f274",
"md5": "70743d0c565fde92fcd3bf48cf189bd3",
"sha256": "8f7ecb77c2f51f8be9322d453158339e281cacad1fde7f75e5d345eafcb09a23"
},
"downloads": -1,
"filename": "caom2repo-1.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "70743d0c565fde92fcd3bf48cf189bd3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7, <4",
"size": 46643,
"upload_time": "2023-11-17T18:35:10",
"upload_time_iso_8601": "2023-11-17T18:35:10.242977Z",
"url": "https://files.pythonhosted.org/packages/8c/9e/9c017d86fd6d4b9e56c611152afa5165c7e738c72660f3ccae183fc7f274/caom2repo-1.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e9b41a68fb19d4f697c80d20c75efb7783f4fdb6c4f74da77876916f289b2ef",
"md5": "dd620f926bc5887d32de10505d7deec8",
"sha256": "a43bd38330479cf29234bd31b0d984c8263229f76294821aa07667f284f36c7d"
},
"downloads": -1,
"filename": "caom2repo-1.6.1.tar.gz",
"has_sig": false,
"md5_digest": "dd620f926bc5887d32de10505d7deec8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7, <4",
"size": 43160,
"upload_time": "2023-11-17T18:35:12",
"upload_time_iso_8601": "2023-11-17T18:35:12.083255Z",
"url": "https://files.pythonhosted.org/packages/1e/9b/41a68fb19d4f697c80d20c75efb7783f4fdb6c4f74da77876916f289b2ef/caom2repo-1.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-17 18:35:12",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "caom2repo"
}