dal.plugins.classes package

Submodules

dal.plugins.classes.persistence module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Alexandre Pires (alexandre.pires@mov.ai) - 2020

class dal.plugins.classes.persistence.Persistence

Bases: PluginManager

Implements an interface for accessing the persistance layer

logger = <Logger persistence.mov.ai (INFO)>
classmethod plugin_class()

Get current class plugin

class dal.plugins.classes.persistence.PersistencePlugin(**kwargs)

Bases: Plugin

A interface for a workspace plugin

abstract backup(**kwargs)

archive a scope/scopes into a zip file

abstract create_workspace(ref: str, **kwargs)

creates a new workspace

abstract delete(data: object, **kwargs)

delete data in the persistent layer

abstract delete_workspace(ref: str)

deletes a existing workspace

Get a list of all related objects

abstract get_scope_info(**kwargs)

get the information of a scope

abstract list_scopes(**kwargs)

list all existing scopes

abstract list_versions(**kwargs)

list all existing scopes

abstract list_workspaces()

list available workspaces

abstract read(**kwargs)

read data from the persistent layer

abstract rebuild_indexes(**kwargs)

force the database layer to rebuild all indexes

abstract restore(**kwargs)

restore a scope/scopes from a zip file

abstract property versioning

returns if this plugin supports versioning

abstract workspace_info(ref: str)

get information about a workspace

abstract write(data: object, **kwargs)

write data to the persistent layer

class dal.plugins.classes.persistence.PersistentObject

Bases: ABC

This class represents a interface for a persistent object A persistent object is a object that can be stored on a persistent media like disc, database, key-value store

abstract delete(**kwargs)

Delte object from the persistant layer

abstract write(**kwargs)

Writes object on the persistant layer

dal.plugins.classes.plugin module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Alexandre Pires (alexandre.pires@mov.ai) - 2020

class dal.plugins.classes.plugin.Plugin

Bases: object

A abstract class for plugins

abstract property plugin_name

Get current plugin class

abstract property plugin_version

Get current plugin class

class dal.plugins.classes.plugin.PluginManager

Bases: object

A abstract class for plugin managers

classmethod get_plugin(key: str)

Get the plugin implementation

classmethod get_plugin_class(key: str)

Get the plugin implementation

classmethod plugin_class()

Get current class plugin

classmethod register_plugin(key: str, drv: type)

Register a new plugin

dal.plugins.classes.resource module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Alexandre Pires (alexandre.pires@mov.ai) - 2020

class dal.plugins.classes.resource.Resource

Bases: PluginManager

This class represents a resources, a resources can be a image file, a python script, a map, or any other kind of file that needs to be accessed

A resources might be located on the local filesystem, or a external filesystem.

We provide one interface to implement a plugin to access the physical resources

static exists(url: str)

check if resources exists, returns True/False

classmethod get_plugin(key: str)

Get the plugin implementation

static list_resources(url: str, recursive: bool = False)

returns a list of available resources at location, returns a list

classmethod plugin_class()

Get current class plugin

static read_binary(url: str)

load a binary file, returns a BytesIO

static read_json(url: str)

load a json file, returns a dict

static read_text(url: str)

load a text file, returns a StringIO

static read_yaml(url: str)

load a yaml file, returns a dict

static validate_url(url: str)

validate an url (schema)://(net location), ie: file://node.json

exception dal.plugins.classes.resource.ResourceException

Bases: Exception

A resources handling exception

class dal.plugins.classes.resource.ResourcePlugin

Bases: Plugin

Exposes a simple interface to implement a plugin to access physical resources

abstract exists(url: str)

check if resources exists, returns True/False

abstract list_resources(url: str, recursive: bool = False)

returns a list of available resources at location, returns a list

abstract read_binary(url: str)

read a binary file, returns a IOBytes

abstract read_json(url: str)

read a json file, returns a dict

abstract read_text(url: str)

read a text file, returns a StringIO

Module contents

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Moawiya Mograbi (Moawiya@mov.ai) - 2022

class dal.plugins.classes.Persistence

Bases: PluginManager

Implements an interface for accessing the persistance layer

logger = <Logger persistence.mov.ai (INFO)>
classmethod plugin_class()

Get current class plugin

class dal.plugins.classes.PersistencePlugin(**kwargs)

Bases: Plugin

A interface for a workspace plugin

abstract backup(**kwargs)

archive a scope/scopes into a zip file

abstract create_workspace(ref: str, **kwargs)

creates a new workspace

abstract delete(data: object, **kwargs)

delete data in the persistent layer

abstract delete_workspace(ref: str)

deletes a existing workspace

Get a list of all related objects

abstract get_scope_info(**kwargs)

get the information of a scope

abstract list_scopes(**kwargs)

list all existing scopes

abstract list_versions(**kwargs)

list all existing scopes

abstract list_workspaces()

list available workspaces

abstract read(**kwargs)

read data from the persistent layer

abstract rebuild_indexes(**kwargs)

force the database layer to rebuild all indexes

abstract restore(**kwargs)

restore a scope/scopes from a zip file

abstract property versioning

returns if this plugin supports versioning

abstract workspace_info(ref: str)

get information about a workspace

abstract write(data: object, **kwargs)

write data to the persistent layer

class dal.plugins.classes.PersistentObject

Bases: ABC

This class represents a interface for a persistent object A persistent object is a object that can be stored on a persistent media like disc, database, key-value store

abstract delete(**kwargs)

Delte object from the persistant layer

abstract write(**kwargs)

Writes object on the persistant layer

class dal.plugins.classes.Plugin

Bases: object

A abstract class for plugins

abstract property plugin_name

Get current plugin class

abstract property plugin_version

Get current plugin class

class dal.plugins.classes.PluginManager

Bases: object

A abstract class for plugin managers

classmethod get_plugin(key: str)

Get the plugin implementation

classmethod get_plugin_class(key: str)

Get the plugin implementation

classmethod plugin_class()

Get current class plugin

classmethod register_plugin(key: str, drv: type)

Register a new plugin

class dal.plugins.classes.Resource

Bases: PluginManager

This class represents a resources, a resources can be a image file, a python script, a map, or any other kind of file that needs to be accessed

A resources might be located on the local filesystem, or a external filesystem.

We provide one interface to implement a plugin to access the physical resources

static exists(url: str)

check if resources exists, returns True/False

classmethod get_plugin(key: str)

Get the plugin implementation

static list_resources(url: str, recursive: bool = False)

returns a list of available resources at location, returns a list

classmethod plugin_class()

Get current class plugin

static read_binary(url: str)

load a binary file, returns a BytesIO

static read_json(url: str)

load a json file, returns a dict

static read_text(url: str)

load a text file, returns a StringIO

static read_yaml(url: str)

load a yaml file, returns a dict

static validate_url(url: str)

validate an url (schema)://(net location), ie: file://node.json

exception dal.plugins.classes.ResourceException

Bases: Exception

A resources handling exception

class dal.plugins.classes.ResourcePlugin

Bases: Plugin

Exposes a simple interface to implement a plugin to access physical resources

abstract exists(url: str)

check if resources exists, returns True/False

abstract list_resources(url: str, recursive: bool = False)

returns a list of available resources at location, returns a list

abstract read_binary(url: str)

read a binary file, returns a IOBytes

abstract read_json(url: str)

read a json file, returns a dict

abstract read_text(url: str)

read a text file, returns a StringIO