Explorer Class#

class Explorer(auth_key: str | None = None, environment: str = 'default', env_var: str = 'JAI_AUTH', safe_mode: bool = False)#

Explorer task class.

This is a general class for managing databases on Jai API.

An authorization key is needed to use the Jai API.

Parameters:
  • environment (str) – Jai environment id or name to use. Defaults to “default”

  • env_var (str) – Name of the Environment Variable to get the value of your auth key. Defaults to “JAI_AUTH”.

  • safe_mode (bool) – When safe_mode is True, responses from Jai API are validated. If the validation fails, the current version you are using is probably incompatible with the current API version. We advise updating it to a newer version. If the problem persists and you are on the latest SDK version, please open an issue so we can work on a fix. Defaults to False.

delete_database()#

Delete a database and everything that goes with it (I thank you all).

Parameters:

name (str) – String with the name of a database in your JAI environment.

Returns:

response – Dictionary with the API response.

Return type:

dict

Example

>>> from jai import Trainer
...
>>> trainer = Trainer(name)
>>> trainer.delete_database()
delete_ids(ids)#

Delete the specified ids from database.

Parameters:

ids (list) – List of ids to be removed from database.

Returns:

response – Dictionary with the API response.

Return type:

dict

Example

>>> from jai import Trainer
...
>>> trainer = Trainer(name)
>>> trainer.delete_ids([0, 1])
delete_raw_data()#

Delete raw data. It is good practice to do this after training a model.

Returns:

response – Dictionary with the API response.

Return type:

dict

Example

>>> from jai import Trainer
...
>>> trainer = Trainer(name)
>>> trainer.delete_raw_data()
describe(name: str)#

Get the database hyperparameters and parameters of a specific database.

Parameters:

name (str) – String with the name of a database in your JAI environment.

Returns:

response – Dictionary with database description.

Return type:

dict

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.describe(name)
environments()#

Return names of available environments.

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.environments()
import_database(database_name: str, owner_id: str, owner_email: str, import_name: str | None = None)#

It imports a database from another user/environment.

Parameters:
  • database_name (str) – The name of the database to import.

  • owner_id (str) – The ID of the user who own the database.

  • owner_email (str) – The email address of the user who own the database. This is an alternative to owner_id.

  • import_name (str) – The name of the database to be imported, in case of renaming. Defaults to None (the database is not renamed).

Return type:

A string confirming the import process.

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.import_database(
...     database_name,
...     owner_id,
...     import_name
... )
info(get_size=True)#

Get name and type of each database in your environment.

Returns:

Pandas dataframe with name, type, creation date and parent databases of each database in your environment.

Return type:

pandas.DataFrame

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.info()
property names#

Retrieves databases already created for the provided Auth Key.

Return type:

List with the sorted names of the databases created so far.

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.names
rename(original_name: str, new_name: str)#

Renames a database.

Args: original_name (str): The name of the database you want to rename. new_name (str): The new name of the database.

Returns: String with message of successful renaming.

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.rename(original_name, new_name)
transfer(original_name: str, to_environment: str, new_name: str | None = None, from_environment: str = 'default')#

Transfers a collection from one environment to another.

Parameters:
  • original_name (str) – The name of the database you want to transfer.

  • to_environment (str) – The environment to transfer the variable to.

  • new_nam (str) – The name of the new environment. If not specified, the original name is used.

  • from_environment (str) – The environment to transfer the variable from. Defaults to default.

Return type:

A string confirming the tranfer.

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.transfer(original_name, to_environment)
property url#

Get name and type of each database in your environment.

user()#

User information.

Returns:

  • userId: string

  • email: string

  • firstName: string

  • lastName: string

  • memberRole: string

  • namespace: string

Return type:

dict

Example

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.user()