Skip to content

store

delete

delete(module_name, code_version=None, all=False, keep_only_latest=False, outer=None)

Deletes a module from the OakVar store and fetches the OakVar store.

PARAMETER DESCRIPTION
module_name

Module name

TYPE: str

code_version

Version number of the module

TYPE: Optional[str] DEFAULT: None

all

True will delete all versions of the module.

TYPE: bool DEFAULT: False

keep_only_latest

True will delete all but the latest version of the module.

TYPE: bool DEFAULT: False

outer

DEFAULT: None

RETURNS DESCRIPTION
bool

True if successful. False if not.

fetch

fetch(refresh_db=False, clean_cache_files=False, clean=False, publish_time='', outer=None)

Fetches OakVar store cache.

PARAMETER DESCRIPTION
refresh_db

True will fetch a clean copy of OakVar store database.

TYPE: bool DEFAULT: False

clean_cache_files

True will fetch a clean copy of OakVar store cache files.

TYPE: bool DEFAULT: False

clean

True will install OakVar store cache from scratch.

TYPE: bool DEFAULT: False

publish_time

YYYY-MM-DDTHH:MM:SS format datetime string. Fetch will be done for new entries newer than this datetime.

TYPE: str DEFAULT: ''

outer

DEFAULT: None

RETURNS DESCRIPTION
bool

True if successful. False if not.

login

login(email=None, pw=None, interactive=False, relogin=False, outer=None)

Logs in to the OakVar store.

PARAMETER DESCRIPTION
email

Email of an OakVar store account

TYPE: Optional[str] DEFAULT: None

pw

Password of an OakVar store account

TYPE: Optional[str] DEFAULT: None

interactive

If True and email or pw is not given, missing fields will be interactvely received with prompts.

TYPE: bool DEFAULT: False

relogin

If True, fresh login will be performed.

TYPE: bool DEFAULT: False

outer

DEFAULT: None

RETURNS DESCRIPTION
Dict[str, Any]

Result of login as a dict, with the fields success, status_code, msg, and email.

logout

logout(outer=None)

Logs out from the OakVar store.

PARAMETER DESCRIPTION
outer

DEFAULT: None

RETURNS DESCRIPTION
bool

True if successful. False if not.

register

register(module_name, url_file=None, code_url=[], data_url=[], overwrite=False, outer=None)

Register a module in the OakVar store.

PARAMETER DESCRIPTION
module_name

Module name

TYPE: str

code_url

URLs of code zip files

TYPE: List[str] DEFAULT: []

data_url

URLs of data zip files

TYPE: List[str] DEFAULT: []

url_file

Path to a yaml file which contains the URLs of code and data zip files.

TYPE: Optional[str] DEFAULT: None

overwrite

overwrite

TYPE: bool DEFAULT: False

outer

DEFAULT: None

error

RETURNS DESCRIPTION
bool

True if successful. False if not.

Examples:

Pack custommodule module to produce custommodule__1.0.0__code.zip and custommodule__1.0.0__data.zip.

>>> oakvar.api.module.pack("custommodule")

Upload the two files to https://module.storage.com/annotators/custommodule__1.0.0__code.zip and https://module.storage.com/annotators/custommodule__1.0.0__data.zip.

Then, register the module.

>>> oakvar.api.store.register("custommodule",\
    code_url=\
        ["https://module.storage.com/annotators/custommodule__1.0.0__code.zip"],\
    data_url=\
        ["https://module.storage.com/annotators/custommodule__1.0.0__data.zip"])

url_file.yml for this registration can be made:

- code:
  - https://module.storage.com/annotators/custommodule__1.0.0__code.zip
- data:
  - https://module.storage.com/annotators/custommodule__1.0.0__data.zip

and used:

>>> oakvar.api.store.register("custommodule", url_file="url_file.yml")

url

url(url='', outer=None)

Gets or sets the URL of the OakVar store.

PARAMETER DESCRIPTION
url

OakVar Store URL to use

TYPE: str DEFAULT: ''

outer

DEFAULT: None

RETURNS DESCRIPTION
str

str of the OakVar Store URL