Python Pandas
Pandas is a Python library that enables fast, flexible, and expressive data analysis and manipulation of structured data.
Python Pandas is a leading open-source data analysis and manipulation library, widely used for transforming and processing structured data. This connector enables Swimlane Turbine users to seamlessly read, write, and transform Excel files and DataFrames within automated workflowsβwithout writing code. With robust actions for converting between Excel and DataFrame formats, extracting sheet names, and applying advanced formatting, users can automate complex data handling tasks directly in their security playbooks. Integrating Python Pandas with Swimlane Turbine empowers security teams to streamline data enrichment, reporting, and analysis, accelerating decision-making and operational efficiency.
Limitations
None to date.
Supported Versions
This Python Pandas Connector uses the version pandas sdk.
Additional Docs
Configuration
Prerequisites
- Authentication is not Required.
Capabilities
This Connector provides the following capabilities:
- DataFrame to Excel
- Excel Sheet Names
- ExcelFile
- ExcelFile Book
- ExcelWriter
- Parse Specific Sheet
- Read Excel File
- Styler to an Excel
DataFrame to Excel
- Converts a DataFrame into an Excel file, allowing data manipulation and analysis within Python Pandas Click Here.
Excel Sheet Names
- Retrieve a list of sheet names from the specified Excel file using Python Pandas Click Here.
ExcelFile
- Parse tabular Excel sheets into DataFrame objects for data manipulation and analysis using Python Pandas Click Here.
ExcelFile Book
- Imports all sheets from an Excel file into a dictionary with sheet names as keys, requiring the 'files' input Click Here.
ExcelWriter
- Write DataFrame objects into Excel sheets using Python Pandas, requiring a 'dataframes' input Click Here.
Parse Specific Sheet
- Converts a specified sheet from an Excel file into a dictionary format using Python Pandas Click Here.
Read Excel File
- Converts an Excel file into a dictionary format for data manipulation and analysis using Python Pandas Click Here.
Styler to an Excel
- Write a Pandas Styler object to an Excel sheet, requiring a specified file as input Click Here.
Actions
DataFrame to Excel
Convert a specified DataFrame into an Excel file for easy data manipulation and analysis using Python Pandas.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
dataframe | object | Required | DataFrame to be written to the Excel file. |
input_parameters | object | Optional | Parameters for the Excel file. |
Input Example
{"dataframe":{},"input_parameters":{}}
Output
Parameter | Type | Description |
|---|---|---|
file | object | Output field: file |
file.file | string | Output field: file.file |
file.file_name | string | Name of the resource |
Output Example
{"file":{"file":"string","file_name":"Example Name"}}
Excel Sheet Names
Retrieve all sheet names from an uploaded Excel file using Python Pandas by providing the required file input.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
files | object | Required | Retrieve a list of sheet names from the specified Excel file using Python Pandas. |
files.file | string | Optional | Parameter for Excel Sheet Names |
files.file_name | string | Optional | Name of the resource |
Input Example
{"files":{"file":"string","file_name":"Example Name"}}
Output
Parameter | Type | Description |
|---|---|---|
sheet_names | array | Name of the resource |
Output Example
{"sheet_names":["Math","Science","English"]}
ExcelFile
Convert Excel files into Python Pandas DataFrame objects for streamlined data analysis and manipulation.
Endpoint
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
files | object | Required | Parse tabular Excel sheets into DataFrame objects for data manipulation and analysis using Python Pandas. |
files.file | string | Optional | Parameter for ExcelFile |
files.file_name | string | Optional | Name of the resource |
input_parameters | object | Optional | Parameters for the ExcelFile action |
Input Example
{"files":{"file":"string","file_name":"Example Name"},"input_parameters":{}}
Output
Parameter | Type | Description |
|---|---|---|
Sheet Names | object | Name of the resource |
Sheet Names.Math | array | Name of the resource |
Sheet Names.Math.Name | string | Name of the resource |
Sheet Names.Math.Score | number | Name of the resource |
Sheet Names.Science | array | Name of the resource |
Sheet Names.Science.Name | string | Name of the resource |
Sheet Names.Science.Score | number | Name of the resource |
Sheet Names.English | array | Name of the resource |
Sheet Names.English.Name | string | Name of the resource |
Sheet Names.English.Score | number | Name of the resource |
Output Example
{"Sheet Names":{"Math":[{},{},{}],"Science":[{},{},{}],"English":[{},{},{}]}}
ExcelFile Book
Import all sheets from an Excel file into a dictionary, using each sheet's name as the key. Requires the 'files' input.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
files | object | Required | Imports all sheets from an Excel file into a dictionary with sheet names as keys, requiring the file input. |
files.file | string | Optional | Parameter for ExcelFile Book |
files.file_name | string | Optional | Name of the resource |
Input Example
{"files":{"file":"string","file_name":"Example Name"}}
Output
Parameter | Type | Description |
|---|---|---|
sheets_data | object | Response data |
sheets_data.Math | array | Response data |
sheets_data.Math.Name | string | Response data |
sheets_data.Math.Score | number | Response data |
sheets_data.Science | array | Response data |
sheets_data.Science.Name | string | Response data |
sheets_data.Science.Score | number | Response data |
sheets_data.English | array | Response data |
sheets_data.English.Name | string | Response data |
sheets_data.English.Score | number | Response data |
total_sheets | number | Output field: total_sheets |
Output Example
{"sheets_data":{"Math":[{},{},{}],"Science":[{},{},{}],"English":[{},{},{}]},"total_sheets":3}
ExcelWriter
Write DataFrame objects to Excel sheets using Python Pandas, requiring a 'dataframes' input for successful operation.
Endpoint
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
dataframes | array | Required | List of DataFrames to be written to the Excel file. |
input_parameters | object | Optional | Parameters for the Excel file. |
Input Example
{"dataframes":[],"input_parameters":{}}
Output
Parameter | Type | Description |
|---|---|---|
file | object | Output field: file |
file.file | string | Output field: file.file |
file.file_name | string | Name of the resource |
Output Example
{"file":{"file":"string","file_name":"Example Name"}}
Parse Specific Sheet
Convert a specified sheet from an uploaded Excel file into a dictionary format using Python Pandas by providing the file and sheet name.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
files | object | Required | Converts a specified sheet from an Excel file into a dictionary format using Python Pandas. |
files.file | string | Optional | Parameter for Parse Specific Sheet |
files.file_name | string | Optional | Name of the resource |
sheet_name | string | Required | The name of the sheet to be parsed from the Excel file. |
Input Example
{"sheet_name":"Math"}
Output
Parameter | Type | Description |
|---|---|---|
Name | object | Name of the resource |
Name.0 | string | Name of the resource |
Name.1 | string | Name of the resource |
Name.2 | string | Name of the resource |
Score | object | Score value |
Score.0 | number | Output field: Score.0 |
Score.1 | number | Output field: Score.1 |
Score.2 | number | Output field: Score.2 |
Output Example
{"Name":{"0":"Alice","1":"Bob","2":"Charlie"},"Score":{"0":95,"1":88,"2":72}}
Read Excel File
Convert an Excel file into a dictionary format for data manipulation and analysis using Python Pandas, requiring the 'files' input.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
files | object | Required | Converts a specified sheet from an Excel file into a dictionary format using Python Pandas. |
files.file | string | Optional | Parameter for Read Excel File |
files.file_name | string | Optional | Name of the resource |
file_inputs | object | Optional | File inputs to be used in the action. |
Input Example
{"files":{"file":"string","file_name":"Example Name"},"file_inputs":{}}
Output
Parameter | Type | Description |
|---|---|---|
Name | object | Name of the resource |
Name.0 | string | Name of the resource |
Name.1 | string | Name of the resource |
Name.2 | string | Name of the resource |
Score | object | Score value |
Score.0 | number | Output field: Score.0 |
Score.1 | number | Output field: Score.1 |
Score.2 | number | Output field: Score.2 |
Output Example
{"Name":{"0":"Alice","1":"Bob","2":"Charlie"},"Score":{"0":95,"1":88,"2":72}}
Styler to an Excel
Write a Pandas Styler object to an Excel sheet using the specified input file.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
newdataframe | object | Optional | New Sheet to be created in the Excel file. |
files | object | Required | Existing Excel file to be modified. |
files.file | string | Optional | Parameter for Styler to an Excel |
files.file_name | string | Optional | Name of the resource |
sheet_inputs_1 | object | Optional | Inputs for the any one of existing sheet. |
sheet_inputs_2 | object | Optional | Inputs for the new sheet. |
Input Example
{"newdataframe":{},"files":{"file":"string","file_name":"Example Name"},"sheet_inputs_1":{},"sheet_inputs_2":{}}
Output
Parameter | Type | Description |
|---|---|---|
file | object | Output field: file |
file.file | string | Output field: file.file |
file.file_name | string | Name of the resource |
Output Example
{"file":{"file":"string","file_name":"Example Name"}}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |