Explorer Module#

Note

If you haven’t yet, please check the section How to configure your auth key before running the code snippets in this page.

The Explorer module is built to manage and explore (oh really) your Jai environment.

The methods of this module function to manage collections and get general information about your Jai environment.

For more information, see the full Explorer class reference.

Explorer#

Bellow, a simple example to instantiate the Explorer class:

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

user#

You can check the user information with user method.

Note

If you wish to check whether the authentication key is valid or not, we recommend the usage of this method.

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

environments#

This method returns the list of available environments.

Check the section Working with environments for more information.

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

names#

You can use the property names to get the names of all databases on the current environment.

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

info#

You can use the property info to get more info about all databases on the curent environment.

The information current version returns are the name, type, date of creation, databases parents, size and dimension of the vectors.

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

It’s possible to trim the information returned with the parameter get_size=False. It will remove the size and dimension information from the response.

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.info(get_size=False)

describe#

Provides a full description of the database’s setup configuration.

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

rename#

Renames a database.

Note

We recommend not changing database’s names if it’s already being used as a parent base for another databases.

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.rename(original_name, new_name)

transfer#

Transfers a collection from one environment to another.

Note

We recommend not changing database’s names if it’s already being used as a parent base for another databases. If a database has parents, you’ll need to transfer one by one.

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

import_database#

It imports a database from another user/environment.

Note

We recommend not changing database’s names if it’s already being used as a parent base for another databases. If a database has parents, you’ll need to transfer one by one. The environment must be PUBLIC type.

>>> from jai import Explorer
...
>>> explorer = Explorer()
>>> explorer.import_database(
...     database_name,
...     owner_id,
...     import_name
... )