Aito SDK¶
The Aito SDK consists of:
schema
: Data structure for the Aito Database Schema
client
: A versatile client to make requests to an Aito Database Instance
client_request
: Request objects used in AitoClient request so that you don’t have to worry about the Aito API endpoint
client_response
: Enriched response objects returned after executing a request with the AitoClient
api
: Different useful functions that uses an AitoClient object to interact with an Aito Database Instance
DataFrameHandler
: Utility to read, write, and convert a Pandas DataFrame in accordance to a Aito Table Schema
Note
We highly recommend you to take a look at the quickstart guide to uploading data if you haven’t already.
AitoSchema¶
Before uploading data into Aito, you need to create a table with a AitoTableSchema
.
You can infer a table schema from a Pandas DataFrame with infer_from_pandas_data_frame()
.
You can also create a table schema column-by-column and infer the AitoColumnTypeSchema
with infer_from_samples()
.
AitoClient¶
The AitoClient
offers different functions to send a Request object
to your Aito instance.
Make a request:
request()
Make a request asynchronously using AIOHTTP ClientSession:
async_request()
Bounded asynchronous request with asyncio semaphore:
bounded_async_request()
Make multiple requests asynchronously:
batch_requests()
AitoAPI¶
aito.api
module offers different functions that takes a Aito Client object
as the first argument
Manipulate the database:
Note
These operations require the client to be setup with the READ-WRITE API key
Create a table:
create_table()
Delete a table:
delete_table()
Create the database:
create_database()
Delete the database:
delete_database()
Copy a table:
copy_table()
Rename a table:
rename_table()
Upload the data:
Note
These operations require the client to be setup with the READ-WRITE API key
Upload a binary file object to a table:
upload_binary_file()
Upload a file to a table:
upload_file()
Upload batches of entries to a table:
upload_entries()
Optimize a table after uploading the data:
optimize_table()
Get information about the database:
Get the instance version:
get_version()
Check if a table exists in the instance:
check_table_exists()
Get a list of existing tables in the instance:
get_existing_tables()
Get a table schema:
get_table_schema()
Find the number of entries in a table:
get_table_size()
Get the database schema:
get_database_schema()
Querying:
Query entries of a table:
query_entries()
Query all entries of a table:
query_all_entries()
Download a table:
download_table()
Make a job request (for query that takes longer than 30 seconds):
job_request()
Make a job request step by step:
create_job()
,get_job_status()
,get_job_result()
Troubleshooting¶
The easiest way to troubleshoot the Aito SDK is by enabling the debug logging. You can enable the debug logging by:
import logging
logging.basicConfig(level=logging.DEBUG)