vcorelib.schemas.base
index
/home/vkottler/src/vkottler/workspace/vcorelib/vcorelib/schemas/base.py

A module defining interfaces for schema enforcement.

 
Modules
       
abc

 
Classes
       
abc.ABC(builtins.object)
Schema
builtins.Exception(builtins.BaseException)
SchemaValidationError
collections.UserDict(collections.abc.MutableMapping)
SchemaMap(collections.UserDict, collections.abc.MutableMapping, typing.Generic)
collections.abc.MutableMapping(collections.abc.Mapping)
SchemaMap(collections.UserDict, collections.abc.MutableMapping, typing.Generic)
typing.Generic(builtins.object)
SchemaMap(collections.UserDict, collections.abc.MutableMapping, typing.Generic)

 
class Schema(abc.ABC)
    Schema(data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], **_) -> None
 
A base class for schema enforcement.
 
 
Method resolution order:
Schema
abc.ABC
builtins.object

Methods defined here:
__call__(self, data: Any) -> Any
Validate input data and return the result.
__init__(self, data: Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], **_) -> None
Initialize this schema.

Class methods defined here:
from_path(path: Union[pathlib.Path, str, NoneType], includes_key: str = None, **kwargs) -> ~T from abc.ABCMeta
Load a schema from a data file on disk.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__abstractmethods__ = frozenset({'__call__'})

 
class SchemaMap(collections.UserDict, collections.abc.MutableMapping, typing.Generic)
    SchemaMap() -> None
 
A class for managing multiple schema objects.
 
 
Method resolution order:
SchemaMap
collections.UserDict
collections.abc.MutableMapping
collections.abc.Mapping
collections.abc.Collection
collections.abc.Sized
collections.abc.Iterable
collections.abc.Container
typing.Generic
builtins.object

Methods defined here:
__init__(self) -> None
Initialize this schema map.
load_directory(self, path: Union[pathlib.Path, str, NoneType], includes_key: str = None, **kwargs) -> Iterator[Tuple[str, vcorelib.schemas.base.Schema]]
Load a directory of schema files into the map.
load_file(self, path: Union[pathlib.Path, str, NoneType], includes_key: str = None, **kwargs) -> Tuple[str, ~T]
Load a schema file into the map.
load_package(self, package: str, path: Union[pathlib.Path, str, NoneType] = 'schemas', package_subdir: str = 'data', includes_key: str = None, **kwargs) -> Iterator[Tuple[str, vcorelib.schemas.base.Schema]]
Load schemas from package data.

Class methods defined here:
from_package(package: str, includes_key: str = None, **kwargs) -> ~V from abc.ABCMeta
Create a new JSON-schema map from package data.
kind() -> Type[vcorelib.schemas.base.Schema] from abc.ABCMeta
Implement this to determine the concrete schema type.

Data and other attributes defined here:
__abstractmethods__ = frozenset({'kind'})
__orig_bases__ = (<class 'collections.UserDict'>, typing.MutableMapping[str, vcorelib.schemas.base.Schema])
__parameters__ = ()

Methods inherited from collections.UserDict:
__contains__(self, key)
# Modify __contains__ and get() to work like dict
# does when __missing__ is present.
__copy__(self)
__delitem__(self, key)
__getitem__(self, key)
__ior__(self, other)
__iter__(self)
__len__(self)
__or__(self, other)
Return self|value.
__repr__(self)
Return repr(self).
__ror__(self, other)
Return value|self.
__setitem__(self, key, item)
copy(self)
get(self, key, default=None)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.

Class methods inherited from collections.UserDict:
fromkeys(iterable, value=None) from abc.ABCMeta

Data descriptors inherited from collections.UserDict:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Methods inherited from collections.abc.MutableMapping:
clear(self)
D.clear() -> None.  Remove all items from D.
pop(self, key, default=<object object at 0x7f60ec6501c0>)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
popitem(self)
D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
setdefault(self, key, default=None)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(self, other=(), /, **kwds)
D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v

Methods inherited from collections.abc.Mapping:
__eq__(self, other)
Return self==value.
items(self)
D.items() -> a set-like object providing a view on D's items
keys(self)
D.keys() -> a set-like object providing a view on D's keys
values(self)
D.values() -> an object providing a view on D's values

Data and other attributes inherited from collections.abc.Mapping:
__hash__ = None
__reversed__ = None

Class methods inherited from collections.abc.Collection:
__subclasshook__(C) from abc.ABCMeta
Abstract classes can override this to customize issubclass().
 
This is invoked early on by abc.ABCMeta.__subclasscheck__().
It should return True, False or NotImplemented.  If it returns
NotImplemented, the normal algorithm is used.  Otherwise, it
overrides the normal algorithm (and the outcome is cached).

Class methods inherited from collections.abc.Iterable:
__class_getitem__ = GenericAlias(...) from abc.ABCMeta
Represent a PEP 585 generic type
 
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).

Class methods inherited from typing.Generic:
__init_subclass__(...) from abc.ABCMeta
Function to initialize subclasses.

 
class SchemaValidationError(builtins.Exception)
    An exception type for schema errors.
 
 
Method resolution order:
SchemaValidationError
builtins.Exception
builtins.BaseException
builtins.object

Data descriptors defined here:
__weakref__
list of weak references to the object

Methods inherited from builtins.Exception:
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from builtins.Exception:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from builtins.BaseException:
__delattr__(self, name, /)
Implement delattr(self, name).
__getattribute__(self, name, /)
Return getattr(self, name).
__reduce__(...)
Helper for pickle.
__repr__(self, /)
Return repr(self).
__setattr__(self, name, value, /)
Implement setattr(self, name, value).
__setstate__(...)
__str__(self, /)
Return str(self).
add_note(...)
Exception.add_note(note) --
add a note to the exception
with_traceback(...)
Exception.with_traceback(tb) --
set self.__traceback__ to tb and return self.

Data descriptors inherited from builtins.BaseException:
__cause__
exception cause
__context__
exception context
__dict__
__suppress_context__
__traceback__
args

 
Data
        T = ~T
V = ~V