squirrel.catalog.catalog
¶
Module Contents¶
Classes¶
Init a Catalog object. |
|
Defines a key in a catalog consisting of the identifier and the version of a source. |
-
class
squirrel.catalog.catalog.
Catalog
¶ Bases:
MutableMapping
Init a Catalog object.
-
__getitem__
(self, identifier: Union[str, CatalogKey, Tuple[str, int]]) → CatalogSource¶
-
__iter__
(self) → Iterator[Tuple[str, squirrel.catalog.source.Source]]¶
-
__setitem__
(self, identifier: Union[str, CatalogKey, Tuple[str, int]], value: squirrel.catalog.source.Source) → None¶
-
difference
(self, other: Catalog) → Catalog¶ Return a Catalog which consists of the difference of the input Catalogs.
-
filter
(self: Catalog, predicate: Callable[[CatalogSource], bool]) → Catalog¶ Filter catalog sources based on a predicate.
-
static
from_dirs
(paths: List[str]) → Catalog¶ Create a Catalog based on a list of folders containing yaml files.
-
static
from_files
(paths: List[str]) → Catalog¶ Create a Catalog based on a list of paths to yaml files.
-
intersection
(self, other: Catalog) → Catalog¶ Return a Catalog which consists of the intersection of the input Catalogs.
-
items
(self) → Iterator[Tuple[str, squirrel.catalog.source.Source]]¶ D.items() -> a set-like object providing a view on D’s items
-
-
class
squirrel.catalog.catalog.
CatalogKey
¶ Bases:
NamedTuple
Defines a key in a catalog consisting of the identifier and the version of a source.
-
identifier
:str¶
-
version
:int¶
-
classmethod
from_yaml
(cls, constructor: ruamel.yaml.Constructor, node: ruamel.yaml.SequenceNode) → CatalogKey¶ Deserializes object from SequenceNode.
-
classmethod
to_yaml
(cls, representer: ruamel.yaml.Representer, obj: CatalogKey) → ruamel.yaml.SequenceNode¶ Serializes object to SequenceNode.
-