| |
- abc.ABC(builtins.object)
-
- JsonCodec(abc.ABC, vcorelib.schemas.mixins.SchemaMixin)
-
- DictCodec
-
- BasicDictCodec
- vcorelib.schemas.mixins.SchemaMixin(builtins.object)
-
- JsonCodec(abc.ABC, vcorelib.schemas.mixins.SchemaMixin)
-
- DictCodec
-
- BasicDictCodec
class BasicDictCodec(DictCodec) |
|
BasicDictCodec(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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
The simplest possible dictionary codec implementation. |
|
- Method resolution order:
- BasicDictCodec
- DictCodec
- JsonCodec
- abc.ABC
- vcorelib.schemas.mixins.SchemaMixin
- builtins.object
Methods defined here:
- asdict(self) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
- Obtain a dictionary representing this instance.
- 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 instance.
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
- __annotations__ = {}
Methods inherited from DictCodec:
- __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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
- Initialize this instance.
Class methods inherited from DictCodec:
- create(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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> ~V from abc.ABCMeta
- A factory method to create an instance.
Data and other attributes inherited from DictCodec:
- default_schemas = None
Methods inherited from JsonCodec:
- __copy__(self: ~T) -> ~T
- Create another instance based on this instance's data.
- __eq__(self, other) -> bool
- Determine if this instance is equal to another.
- __str__(self) -> str
- Use the dictionary representation of this instance for string
representation.
- encode(self, pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, **kwargs) -> Tuple[bool, int]
- Encode this object instance to a file.
Class methods inherited from JsonCodec:
- decode(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True, require_success: bool = True, default_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, **kwargs) -> ~T from abc.ABCMeta
- Decode an object instance from data loaded from a file.
- file_cache(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, encode_kwargs: Dict[str, Any] = None, require_success: bool = False, **kwargs) -> Iterator[~T] from abc.ABCMeta
- Manage an instance of this class as a disk-backed file.
- normalize(data: Union[Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], ~T]) -> ~T from abc.ABCMeta
- Ensure that some object is an instance of this class.
Data descriptors inherited from JsonCodec:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes inherited from JsonCodec:
- __hash__ = None
Methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- validate(self, valid_attr: str = 'data') -> None
- Validate an instance attribute based on this instance's schema.
Class methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- schema_name() -> str from abc.ABCMeta
- A default name for this class's schema.
|
class DictCodec(JsonCodec) |
|
DictCodec(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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
A class implementing an interface for objects that can be decoded from
disk and encoded back to disk. |
|
- Method resolution order:
- DictCodec
- JsonCodec
- abc.ABC
- vcorelib.schemas.mixins.SchemaMixin
- builtins.object
Methods defined here:
- __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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> None
- Initialize this instance.
- 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
- Perform implementation-specific initialization.
Class methods defined here:
- create(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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> ~V from abc.ABCMeta
- A factory method to create an instance.
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'asdict', 'init'})
- __annotations__ = {'default_schemas': typing.Optional[vcorelib.schemas.base.SchemaMap]}
- default_schemas = None
Methods inherited from JsonCodec:
- __copy__(self: ~T) -> ~T
- Create another instance based on this instance's data.
- __eq__(self, other) -> bool
- Determine if this instance is equal to another.
- __str__(self) -> str
- Use the dictionary representation of this instance for string
representation.
- asdict(self) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
- Obtain a dictionary representing this instance.
- encode(self, pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, **kwargs) -> Tuple[bool, int]
- Encode this object instance to a file.
Class methods inherited from JsonCodec:
- decode(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True, require_success: bool = True, default_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, **kwargs) -> ~T from abc.ABCMeta
- Decode an object instance from data loaded from a file.
- file_cache(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, encode_kwargs: Dict[str, Any] = None, require_success: bool = False, **kwargs) -> Iterator[~T] from abc.ABCMeta
- Manage an instance of this class as a disk-backed file.
- normalize(data: Union[Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], ~T]) -> ~T from abc.ABCMeta
- Ensure that some object is an instance of this class.
Data descriptors inherited from JsonCodec:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes inherited from JsonCodec:
- __hash__ = None
Methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- validate(self, valid_attr: str = 'data') -> None
- Validate an instance attribute based on this instance's schema.
Class methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- schema_name() -> str from abc.ABCMeta
- A default name for this class's schema.
|
class JsonCodec(abc.ABC, vcorelib.schemas.mixins.SchemaMixin) |
|
JsonCodec(schemas: vcorelib.schemas.base.SchemaMap, valid_attr: str = 'data') -> None
A simple JSON codec interface. |
|
- Method resolution order:
- JsonCodec
- abc.ABC
- vcorelib.schemas.mixins.SchemaMixin
- builtins.object
Methods defined here:
- __copy__(self: ~T) -> ~T
- Create another instance based on this instance's data.
- __eq__(self, other) -> bool
- Determine if this instance is equal to another.
- __str__(self) -> str
- Use the dictionary representation of this instance for string
representation.
- asdict(self) -> Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]]
- Obtain a dictionary representing this instance.
- encode(self, pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, **kwargs) -> Tuple[bool, int]
- Encode this object instance to a file.
Class methods defined here:
- create(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, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True) -> ~T from abc.ABCMeta
- A factory method to create an instance.
- decode(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, schemas: vcorelib.schemas.base.SchemaMap = None, dest_attr: str = 'data', verify: bool = True, require_success: bool = True, default_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, **kwargs) -> ~T from abc.ABCMeta
- Decode an object instance from data loaded from a file.
- file_cache(pathlike: Union[pathlib.Path, str, NoneType], arbiter: vcorelib.io.arbiter.DataArbiter = <vcorelib.io.arbiter.DataArbiter object at 0x7effe79b8470>, encode_kwargs: Dict[str, Any] = None, require_success: bool = False, **kwargs) -> Iterator[~T] from abc.ABCMeta
- Manage an instance of this class as a disk-backed file.
- normalize(data: Union[Dict[str, Union[str, int, float, bool, NoneType, Dict[str, Union[str, int, float, bool, NoneType]], List[Union[str, int, float, bool, NoneType]]]], ~T]) -> ~T from abc.ABCMeta
- Ensure that some object is an instance of this class.
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({'asdict', 'create'})
- __annotations__ = {}
- __hash__ = None
Methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- __init__(self, schemas: vcorelib.schemas.base.SchemaMap, valid_attr: str = 'data') -> None
- Initialize this object instance by performing schema validation.
- validate(self, valid_attr: str = 'data') -> None
- Validate an instance attribute based on this instance's schema.
Class methods inherited from vcorelib.schemas.mixins.SchemaMixin:
- schema_name() -> str from abc.ABCMeta
- A default name for this class's schema.
| |