ewokscore.persistence.proxy.DataProxy#

class ewokscore.persistence.proxy.DataProxy(uri=None, root_uri=None, relative_uri=None, uhash_source=None)[source]#

Bases: Registered, HasUhash

Parameters:
SCHEME = NotImplemented#

name of the DataProxy scheme like json or nexus

classmethod class_registry_name()#
Return type:

Optional[str]

classmethod deserialize(data)[source]#
Parameters:

data (Dict[str, str])

dump(data)[source]#

Dump data to the uri

Parameters:

data (Any)

Return type:

bool

exists()[source]#

return True if the data exists

Return type:

bool

classmethod get_subclass(registry_name, _second_attempt=False)#

Retrieving a derived class

classmethod get_subclass_names()#
Return type:

List[str]

classmethod get_subclasses()#
property identifier: str | None#

Return identifier DataProxy to be used as a string

classmethod instantiate(scheme=None, uri=None, uhash_source=None, root_uri=None, relative_uri=None)[source]#
Parameters:
  • scheme (Optional[str])

  • uri (Optional[DataUri])

  • uhash_source (Union[UniversalHash, HasUhash, None])

  • root_uri (Optional[str])

  • relative_uri (Optional[str])

property is_fixed_uri: bool#
load(raise_error=True)[source]#

Load data from the uri

Parameters:

raise_error (bool)

Return type:

Any

property parsed_root_uri: ParseResult | None#
property root_uri_query: dict#
serialize()[source]#
Return type:

Dict[str, str]

property uhash: UniversalHash | None#
property uri: DataUri | None#

Return an Unified Resource Identifier. Defined as: URI = scheme “:” “//” path [“?” query] [“#” fragment]

see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier

Warning

query can be ?path= which is different from path