Exports
exports
Service class for handling data exports from Kaleidoscope.
This class provides methods to export and download data from the Kaleidoscope API, specifically for pulling record search data and saving it as CSV files.
Classes:
| Name | Description |
|---|---|
ExportsService |
Service class for exporting and downloading record search data as CSV. |
Example
# Pull data and download as CSV
file_path = client.exports_service.pull_data(
filename="my_export.csv",
entity_slice_id="some-uuid",
download_path="/path/to/downloads",
search_text="example"
)
ExportsService
ExportsService(client: KaleidoscopeClient)
Service class for handling data exports from Kaleidoscope.
This class provides methods to export and download data from the Kaleidoscope API, specifically for pulling record search data and saving it as CSV files.
Example
# Pull data and download as CSV
file_path = client.exports_service.pull_data(
filename="my_export.csv",
entity_slice_id="some-uuid",
download_path="/path/to/downloads",
search_text="example"
)
Methods:
| Name | Description |
|---|---|
pull_data |
Pull record search data and download it as a CSV file. |
Source code in kalpy/exports.py
44 45 | |
pull_data
pull_data(filename: str, entity_slice_id: str, download_path: str | None = None, record_view_id: str | None = None, view_field_ids: str | None = None, identifier_ids: str | None = None, record_set_id: str | None = None, program_id: str | None = None, operation_id: str | None = None, record_set_filters: str | None = None, view_field_filters: str | None = None, view_field_sorts: str | None = None, entity_field_filters: str | None = None, entity_field_sorts: str | None = None, search_text: str | None = None) -> str | None
Pull record search data and download it as a CSV file.
This method interacts with the Kaleidoscope API to export records as a CSV file based on the provided parameters. It supports filtering, sorting, and searching records, and allows specifying various identifiers and filters to customize the export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The name of the CSV file to be downloaded. |
required |
entity_slice_id
|
str
|
The ID of the entity slice to export records from. |
required |
download_path
|
str
|
The directory path where the CSV file will be saved. Defaults to None (uses '/tmp'). |
None
|
record_view_id
|
str
|
The ID of the record view to filter records. Defaults to None. |
None
|
view_field_ids
|
str
|
Comma-separated IDs of view fields to include in the export. Defaults to None. |
None
|
identifier_ids
|
str
|
Comma-separated IDs of identifiers to filter records. Defaults to None. |
None
|
record_set_id
|
str
|
The ID of the record set to filter records. Defaults to None. |
None
|
program_id
|
str
|
The ID of the program to filter records. Defaults to None. |
None
|
operation_id
|
str
|
The ID of the operation to filter records. Defaults to None. |
None
|
record_set_filters
|
str
|
Filters to apply to the record set. Defaults to None. |
None
|
view_field_filters
|
str
|
Filters to apply to view fields. Defaults to None. |
None
|
view_field_sorts
|
str
|
Sorting options for view fields. Defaults to None. |
None
|
entity_field_filters
|
str
|
Filters to apply to entity fields. Defaults to None. |
None
|
entity_field_sorts
|
str
|
Sorting options for entity fields. Defaults to None. |
None
|
search_text
|
str
|
Text to search within records. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
str | None
|
The file path of the downloaded CSV file, or None if not successful. |
API Reference
https://kaleidoscope.readme.io/reference/get_records-export-csv
Source code in kalpy/exports.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |