Reference
BulkAPI
Data movement: synchronous import and export, batched import for large files, and asynchronous (job-based) import and export. 16 methods.
org = ac.get_org_instance(ORG_ID)
workspace = ac.get_workspace_instance(ORG_ID, WORKSPACE_ID)
view = ac.get_view_instance(ORG_ID, WORKSPACE_ID, VIEW_ID)
bulk = ac.get_bulk_instance(ORG_ID, WORKSPACE_ID)BulkAPI exposes 16 methods. Method names are snake_case and identifiers are str.
Methods#
export_bulk_data, export_bulk_data_stream, export_data, export_data_stream, get_export_job_details, get_import_job_details, import_bulk_data, import_bulk_data_in_new_table, import_data, import_data_as_batches, import_data_in_new_table, import_data_in_new_table_as_batches, import_raw_data, import_raw_data_in_new_table, initiate_bulk_export, initiate_bulk_export_using_sql
export_bulk_data#
export_bulk_data(job_id, file_path)Download the exported data for the mentioned job id.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Id of the job to be exported. |
file_path | string | Path of the file where the data exported to be stored. |
Raises — ServerError; ParseError
export_bulk_data_stream#
export_bulk_data_stream(job_id)Download the exported data for the mentioned job id as stream.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Id of the job to be exported. |
Returns (urllib3.response.HTTPResponse) — A stream object containing the exported data.
Raises — ServerError; ParseError
export_data#
export_data(view_id, response_format, file_path, config = {})Export the mentioned table (or) view data.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view to be exported. |
response_format | string | The format in which the data is to be exported. |
file_path | string | Path of the file where the data exported to be stored. |
config | dictionary | Contains any additional control parameters. Can be null. |
Raises — ServerError; ParseError
export_data_stream#
export_data_stream(view_id, response_format, config={})Export the mentioned table (or) view data.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view to be exported. |
response_format | string | The format in which the data is to be exported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (urllib3.response.HTTPResponse) — A stream object containing the exported data.
Raises — ServerError; ParseError
get_export_job_details#
get_export_job_details(job_id)Returns the details of the export job.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Id of the export job. |
Returns (dictionary) — Export job details
Raises — ServerError; ParseError
get_import_job_details#
get_import_job_details(job_id)Returns the details of the import job.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Id of the job. |
Returns (dictionary) — Import job details
Raises — ServerError; ParseError
import_bulk_data#
import_bulk_data(view_id, import_type, file_type, auto_identify, file_path, config = {})Asynchronously import the data contained in the mentioned file into the table.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view where the data to be imported. |
import_type | string | The type of import. Can be one of - append, truncateadd, updateadd. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (string) — Import job id
Raises — ServerError; ParseError
import_bulk_data_in_new_table#
import_bulk_data_in_new_table(table_name, file_type, auto_identify, file_path, config = {})Asynchronously create a new table and import the data contained in the mentioned file into the created table.
| Parameter | Type | Description |
|---|---|---|
table_name | string | Name of the new table to be created. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (string) — Import job id
Raises — ServerError; ParseError
import_data#
import_data(view_id, import_type, file_type, auto_identify, file_path, config = {})Import the data contained in the mentioned file into the table.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view where the data to be imported. |
import_type | string | The type of import. Can be one of - append, truncateadd, updateadd. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (dictionary) — Import result
Raises — ServerError; ParseError
import_data_as_batches#
import_data_as_batches(view_id, import_type, auto_identify, file_path, batch_size, config={}, tool_config={})Asynchronously import the data contained in the mentioned file into the table.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view where the data to be imported. |
import_type | string | The type of import. Can be one of - append, truncateadd, updateadd. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
batch_size | int | Number of lines per batch. |
config | dictionary | Contains any additional control parameters. Can be null. |
tool_config | dictionary | Contains any additional control parameters for the library. Can be null. |
Returns (string) — Import job id
Raises — ServerError; ParseError
import_data_in_new_table#
import_data_in_new_table(table_name, file_type, auto_identify, file_path, config = {})Create a new table and import the data contained in the mentioned file into the created table.
| Parameter | Type | Description |
|---|---|---|
table_name | string | Name of the new table to be created. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (dictionary) — Import result
Raises — ServerError; ParseError
import_data_in_new_table_as_batches#
import_data_in_new_table_as_batches(table_name, auto_identify, file_path, batch_size, config={}, tool_config={})Create a new table and import the data contained in the mentioned file into the created table.
| Parameter | Type | Description |
|---|---|---|
table_name | string | Name of the new table to be created. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
file_path | string | Path of the file to be imported. |
batch_size | int | Number of lines per batch. |
config | dictionary | Contains any additional control parameters. Can be null. |
tool_config | dictionary | Contains any additional control parameters for the library. Can be null. |
Returns (string) — Import job id
Raises — ServerError; ParseError
import_raw_data#
import_raw_data(view_id, import_type, file_type, auto_identify, data, config = {})Import the raw data provided into the table.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view where the data to be imported. |
import_type | string | The type of import. Can be one of - append, truncateadd, updateadd. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
data | string | Raw data to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (dictionary) — Import result
Raises — ServerError; ParseError
import_raw_data_in_new_table#
import_raw_data_in_new_table(table_name, file_type, auto_identify, data, config={})Create a new table and import the raw data provided into the created table.
| Parameter | Type | Description |
|---|---|---|
table_name | string | Name of the new table to be created. |
file_type | string | Type of the file to be imported. |
auto_identify | string | Used to specify whether to auto identify the CSV format. Allowable values - true/false. |
data | string | Raw data to be imported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (dictionary) — Import result
Raises — ServerError; ParseError
initiate_bulk_export#
initiate_bulk_export(view_id, response_format, config = {})Initiate asynchronous export for the mentioned table (or) view data.
| Parameter | Type | Description |
|---|---|---|
view_id | string | Id of the view to be exported. |
response_format | string | The format in which the data is to be exported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (string) — Export job id
Raises — ServerError; ParseError
initiate_bulk_export_using_sql#
initiate_bulk_export_using_sql(sql_query, response_format, config = {})Initiate asynchronous export with the given SQL Query.
| Parameter | Type | Description |
|---|---|---|
sql_query | string | SQL Query. |
response_format | string | The format in which the data is to be exported. |
config | dictionary | Contains any additional control parameters. Can be null. |
Returns (string) — Export job id
Raises — ServerError; ParseError