aito.client.AitoClient

class aito.client.AitoClient(instance_url: str, api_key: str, check_credentials: bool = True)

A versatile client that connects to the Aito Database Instance

Parameters
  • instance_url (str) – Aito instance url

  • api_key (str) – Aito instance API key

  • check_credentials (bool) – check the given credentials by requesting the Aito instance version, defaults to True

Raises

BaseError – an error occurred during the creation of AitoClient

Methods

async_requests(methods, endpoints, queries)

async multiple requests

check_table_exists(table_name)

check if a table exists in the instance

copy_table(table_name, copy_table_name[, …])

copy a table

create_database(database_schema)

create a database using the specified database schema

create_job(job_endpoint, query)

Create a job for a query that takes longer than 30 seconds to run

create_table(table_name, table_schema)

create a table with the specified table name and schema

delete_database()

delete the whole database

delete_table(table_name)

delete the specified table

download_table(table_name, output_folder[, …])

download a table to a NDJSON file or a gzipped NDJSON file

get_database_schema()

get the schema of the database

get_existing_tables()

get a list of existing tables in the instance

get_job_result(job_id)

Get the result of a job with the specified job id

get_job_status(job_id)

Get the status of a job with the specified job id

get_table_schema(table_name)

get the schema of the specified table

get_table_size(table_name)

return the number of entries of the specified table

get_version()

get the aito instance version

job_request(job_endpoint[, query, polling_time])

make a request to an Aito API endpoint using job

naive_predict(predicting_field, from_table)

generate an example predict query to predict a field

optimize_table(table_name)

optimize the specified table

query_all_entries(table_name[, select, …])

query all entries of the specified table

query_entries(table_name[, offset, limit, …])

query entries of the specified table

rename_table(old_name, new_name[, replace])

rename a table

request(method, endpoint[, query])

make a request to an Aito API endpoint

upload_binary_file(table_name, binary_file)

upload a binary file object to a table

upload_entries(table_name, entries[, …])

populate table entries by batches of batch_size

upload_entries_by_batches(table_name, entries)

Deprecated since version 0.2.1.

upload_file(table_name, file_path[, …])

upload a file to the specfied table