plesty.server.model.catalogue ============================= .. py:module:: plesty.server.model.catalogue .. autoapi-nested-parse:: What the hub catalogue says about a module — the data, not the fetching. hub-registry serves ``/api/modules/`` (a JSON document with a ``modules`` list). :class:`CatalogueEntry` is one such module as the bench cares about it: what it is called, where it lives, its last release, its compliance standard and how its last check and field tests went. Searching and installing from it is :mod:`plesty.server.services.catalogue` and the presenter; this module only reads the JSON. Attributes ---------- .. autoapisummary:: plesty.server.model.catalogue.DEFAULT_INDEX_URL plesty.server.model.catalogue.REQUIRED_STANDARD Classes ------- .. autoapisummary:: plesty.server.model.catalogue.CatalogueEntry Functions --------- .. autoapisummary:: plesty.server.model.catalogue.parse_catalogue Module Contents --------------- .. py:data:: DEFAULT_INDEX_URL :value: 'https://hub.plesty.net/api/modules/' .. py:data:: REQUIRED_STANDARD :value: 'quantum' .. py:class:: CatalogueEntry One module of the hub catalogue. :ivar name: Distribution name (``plesty-pm100d``). :ivar slug: Project slug. :ivar namespace: GitLab path (``plesty/hub/devices/thorlab/pm100d``). :ivar description: One line. :ivar category: ``devices``, ``analyzers`` or ``experiments``. :ivar vendor: Vendor group for devices (``thorlab``), else empty. :ivar repo_url: Clone URL — what a git install uses. :ivar web_url: Project page. :ivar version: Latest release version, or empty. :ivar latest_tag: Latest tag (``v0.2.1``), or empty. :ivar standard: Compliance standard the module pins (``quantum``), or empty. :ivar checked: Whether a ``plesty check`` report is published. :ivar gates_ok: Whether that report passed. :ivar gates_passed: Gates passed in it. :ivar gates_failed: Gates failed in it. :ivar field_tests: Number of published field-test reports. .. py:attribute:: name :type: str .. py:attribute:: slug :type: str :value: '' .. py:attribute:: namespace :type: str :value: '' .. py:attribute:: description :type: str :value: '' .. py:attribute:: category :type: str :value: '' .. py:attribute:: vendor :type: str :value: '' .. py:attribute:: repo_url :type: str :value: '' .. py:attribute:: web_url :type: str :value: '' .. py:attribute:: version :type: str :value: '' .. py:attribute:: latest_tag :type: str :value: '' .. py:attribute:: standard :type: str :value: '' .. py:attribute:: checked :type: bool :value: False .. py:attribute:: gates_ok :type: bool :value: False .. py:attribute:: gates_passed :type: int :value: 0 .. py:attribute:: gates_failed :type: int :value: 0 .. py:attribute:: field_tests :type: int :value: 0 .. py:property:: installable :type: bool a device at the required standard with a repository. :type: Whether the bench offers it .. py:property:: ref :type: str | None the latest tag, else the default branch. :type: The git ref a fresh install checks out .. py:property:: quality :type: str ``ok``, ``failing``, ``unchecked``. :type: One word for listings .. py:method:: matches(query: str) -> bool Case-insensitive substring match on name, slug, vendor and description. .. py:method:: from_registry(raw: collections.abc.Mapping[str, Any]) -> CatalogueEntry :classmethod: Build from one element of the registry's ``modules`` list. .. py:function:: parse_catalogue(document: Any) -> list[CatalogueEntry] Every entry of a ``/api/modules/`` document (a mapping with ``modules`` or a bare list).