From 5e8dc968a43e06d3471b9a26b73e07b2e13e89ff Mon Sep 17 00:00:00 2001 From: vinicvaz Date: Mon, 18 Dec 2023 10:00:19 -0300 Subject: [PATCH 1/5] ydataprofiling piece --- dependencies/requirements_0.txt | 3 ++- pieces/YDataProfilingPiece/metadata.json | 15 ++++++++++++++ pieces/YDataProfilingPiece/models.py | 10 +++++++++ pieces/YDataProfilingPiece/piece.py | 26 ++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 pieces/YDataProfilingPiece/metadata.json create mode 100644 pieces/YDataProfilingPiece/models.py create mode 100644 pieces/YDataProfilingPiece/piece.py diff --git a/dependencies/requirements_0.txt b/dependencies/requirements_0.txt index 0bead8f..13c194a 100644 --- a/dependencies/requirements_0.txt +++ b/dependencies/requirements_0.txt @@ -3,4 +3,5 @@ pandas==2.1.2 Pillow==10.1.0 beautifulsoup4==4.12.2 python-lorem==1.3.0.post1 -scikit-learn==1.3.2 \ No newline at end of file +scikit-learn==1.3.2 +ydata-profiling==4.6.3 \ No newline at end of file diff --git a/pieces/YDataProfilingPiece/metadata.json b/pieces/YDataProfilingPiece/metadata.json new file mode 100644 index 0000000..658da38 --- /dev/null +++ b/pieces/YDataProfilingPiece/metadata.json @@ -0,0 +1,15 @@ +{ + "name": "YDataProfilingPiece", + "description": "Piece that uses ydata-profiling to create fast EDA.", + "dependency": { + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "eda" + ], + "style": { + "node_label": "Data Profiling", + "icon_class_name": "mingcute:profile-line" + } +} \ No newline at end of file diff --git a/pieces/YDataProfilingPiece/models.py b/pieces/YDataProfilingPiece/models.py new file mode 100644 index 0000000..186f4e6 --- /dev/null +++ b/pieces/YDataProfilingPiece/models.py @@ -0,0 +1,10 @@ +from pydantic import BaseModel, Field +from typing import Optional + + +class InputModel(BaseModel): + data_path: str = Field(title='CSV file path', description='Path to the CSV file to be profiled') + report_tile: Optional[str] = Field(title='Report title', description='Title of the report', default='Profiling Report') + +class OutputModel(BaseModel): + profile_file_path: str = Field(title='Output file path', description='Path to the output file.') diff --git a/pieces/YDataProfilingPiece/piece.py b/pieces/YDataProfilingPiece/piece.py new file mode 100644 index 0000000..6604fdb --- /dev/null +++ b/pieces/YDataProfilingPiece/piece.py @@ -0,0 +1,26 @@ +import pandas as pd +from domino.base_piece import BasePiece +from .models import InputModel, OutputModel +from pathlib import Path +from ydata_profiling import ProfileReport + + +class YDataProfilingPiece(BasePiece): + + def piece_function(self, input_data: InputModel): + df = pd.read_csv(input_data.data_path) + + profile = ProfileReport(df, title=input_data.report_tile) + + file_path = str(Path(self.results_path) / 'report.html') + profile.to_file(file_path) + + self.display_result = { + "file_path": file_path, + "file_type": "html" + } + + return OutputModel( + profile_file_path=file_path + ) + From 90b9819b81bb01f837e5916de2e770d0c960b2d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 18 Dec 2023 13:08:55 +0000 Subject: [PATCH 2/5] auto-organize --- .domino/compiled_metadata.json | 1861 +++++++++++++++++--------------- .domino/dependencies_map.json | 17 +- 2 files changed, 973 insertions(+), 905 deletions(-) diff --git a/.domino/compiled_metadata.json b/.domino/compiled_metadata.json index e67b75b..85412cf 100644 --- a/.domino/compiled_metadata.json +++ b/.domino/compiled_metadata.json @@ -1,404 +1,300 @@ { - "StringOperationsPiece": { - "name": "StringOperationsPiece", + "LoremIpsumGeneratorPiece": { + "name": "LoremIpsumGeneratorPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "string" + "text" ], "style": { - "node_label": "String Operations", + "node_label": "Lorem Ipsum Generator", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "tabler:sort-a-z", + "icon_class_name": "carbon:character-sentence-case", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that performs string operations", + "description": "A Piece that generates Lorem Ipsum text.", "input_schema": { "$defs": { - "OperationItem": { - "properties": { - "operation": { - "allOf": [ - { - "$ref": "#/$defs/OperationsTypes" - } - ], - "description": "Operation to perform. Options: `concatenate`, `lower_case`, `upper_case`, `split_by`, `replace_by`.", - "from_upstream": "never" - }, - "second_argument": { - "default": "", - "description": "Value for the second argument.", - "title": "Second Argument", - "type": "string" - }, - "auxiliary_argument": { - "default": "", - "description": "Auxiliary argument for `split_by` and `replace_by` operations.\nIf `split_by` is selected, this argument will be used as the index of the split array.\nIf `replace_by` is selected, this argument will be used as the string to replace.\n", - "title": "Auxiliary Argument", - "type": "string" - } - }, - "required": [ - "operation" - ], - "title": "OperationItem", - "type": "object" - }, - "OperationsTypes": { + "ItemsType": { "enum": [ - "concatenate", - "lower_case", - "upper_case", - "split_by", - "replace_by", - "strip_spaces" + "words", + "sentences", + "paragraphs" ], - "title": "OperationsTypes", + "title": "ItemsType", "type": "string" } }, + "description": "LoremIpsumGeneratorPiece Input Model", "properties": { - "first_argument": { - "description": "Value for the first argument.", - "title": "First Argument", - "type": "string" + "items": { + "allOf": [ + { + "$ref": "#/$defs/ItemsType" + } + ], + "default": "words", + "description": "Type of items to generate." }, - "operations": { - "description": "Sequence of operations to perform.", - "items": { - "$ref": "#/$defs/OperationItem" - }, - "title": "Operations", - "type": "array" + "number_of_items": { + "default": 1, + "description": "Number of items to generate.", + "title": "Number Of Items", + "type": "integer" } }, - "required": [ - "first_argument", - "operations" - ], "title": "InputModel", "type": "object" }, "output_schema": { + "description": "LoremIpsumGeneratorPiece Output Model", "properties": { - "output_string": { - "description": "Output string.", - "title": "Output String", + "output_text": { + "description": "Generated text.", + "title": "Output Text", "type": "string" } }, "required": [ - "output_string" + "output_text" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/StringOperationsPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/LoremIpsumGeneratorPiece" }, - "SleepPiece": { - "name": "SleepPiece", + "ImageFilterPiece": { + "name": "ImageFilterPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "sleep" + "image" ], "style": { - "node_label": "Sleep", + "node_label": "Image Filter", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "fa-solid:hourglass-start", + "icon_class_name": "ic:twotone-filter", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that sleeps for a given number of seconds.", + "description": "A Piece that applies selected image filters to an image.", "input_schema": { - "description": "Sleep Piece Input Model", + "$defs": { + "OutputTypeType": { + "description": "Output type for the result text", + "enum": [ + "file", + "base64_string", + "both" + ], + "title": "OutputTypeType", + "type": "string" + } + }, "properties": { - "sleep_time": { - "default": 1, - "description": "Number of seconds to sleep", - "title": "Sleep Time", - "type": "number" + "input_image": { + "description": "Input image. It should be either a path to a file, or a base64 encoded string.", + "from_upstream": "always", + "title": "Input Image", + "type": "string" + }, + "sepia": { + "default": false, + "description": "Apply sepia effect.", + "title": "Sepia", + "type": "boolean" + }, + "black_and_white": { + "default": false, + "description": "Apply black and white effect.", + "title": "Black And White", + "type": "boolean" + }, + "brightness": { + "default": false, + "description": "Apply brightness effect.", + "title": "Brightness", + "type": "boolean" + }, + "darkness": { + "default": false, + "description": "Apply darkness effect.", + "title": "Darkness", + "type": "boolean" + }, + "contrast": { + "default": false, + "description": "Apply contrast effect.", + "title": "Contrast", + "type": "boolean" + }, + "red": { + "default": false, + "description": "Apply red effect.", + "title": "Red", + "type": "boolean" + }, + "green": { + "default": false, + "description": "Apply green effect.", + "title": "Green", + "type": "boolean" + }, + "blue": { + "default": false, + "description": "Apply blue effect.", + "title": "Blue", + "type": "boolean" + }, + "cool": { + "default": false, + "description": "Apply cool effect.", + "title": "Cool", + "type": "boolean" + }, + "warm": { + "default": false, + "description": "Apply warm effect.", + "title": "Warm", + "type": "boolean" + }, + "output_type": { + "allOf": [ + { + "$ref": "#/$defs/OutputTypeType" + } + ], + "default": "both", + "description": "Format of the output image. Options are: `file`, `base64_string`, `both`." } }, + "required": [ + "input_image" + ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "Sleep Piece Output Model", "properties": { - "message": { - "description": "Sleep piece executed", - "title": "Message", + "image_base64_string": { + "default": "", + "description": "Base64 encoded string of the output image.", + "title": "Image Base64 String", + "type": "string" + }, + "image_file_path": { + "default": "", + "description": "Path to the output image file.", + "title": "Image File Path", "type": "string" } }, - "required": [ - "message" - ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/SleepPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ImageFilterPiece" }, - "LoremIpsumGeneratorPiece": { - "name": "LoremIpsumGeneratorPiece", + "DataConversionPiece": { + "name": "DataConversionPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ - "default", - "text" + "data", + "conversion", + "default" ], "style": { - "node_label": "Lorem Ipsum Generator", + "node_label": "Data Conversion Piece", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "carbon:character-sentence-case", + "icon_class_name": "icon-park-outline:file-conversion", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that generates Lorem Ipsum text.", + "description": "Convert data from one format to another", "input_schema": { "$defs": { - "ItemsType": { + "DataFormatOption": { "enum": [ - "words", - "sentences", - "paragraphs" + "csv", + "json" ], - "title": "ItemsType", + "title": "DataFormatOption", "type": "string" } }, - "description": "LoremIpsumGeneratorPiece Input Model", "properties": { - "items": { + "input_data": { + "description": "Input data to be converted. Can be a file path or data as string.", + "title": "Input Data", + "type": "string" + }, + "input_data_format": { "allOf": [ { - "$ref": "#/$defs/ItemsType" + "$ref": "#/$defs/DataFormatOption" } ], - "default": "words", - "description": "Type of items to generate." - }, - "number_of_items": { - "default": 1, - "description": "Number of items to generate.", - "title": "Number Of Items", - "type": "integer" - } - }, - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "description": "LoremIpsumGeneratorPiece Output Model", - "properties": { - "output_text": { - "description": "Generated text.", - "title": "Output Text", - "type": "string" - } - }, - "required": [ - "output_text" - ], - "title": "OutputModel", - "type": "object" - }, - "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/LoremIpsumGeneratorPiece" - }, - "SaveImagePiece": { - "name": "SaveImagePiece", - "dependency": { - "dockerfile": null, - "requirements_file": "requirements_0.txt" - }, - "tags": [ - "default", - "image" - ], - "style": { - "node_label": "Save Image", - "node_type": "default", - "node_style": { - "backgroundColor": "#ebebeb" - }, - "useIcon": true, - "icon_class_name": "material-symbols:image-outline", - "iconStyle": { - "cursor": "pointer" - } - }, - "description": "Save base64 as image file to results folder.", - "input_schema": { - "properties": { - "base64_data": { - "description": "Input data to be saved as image.", - "title": "Base64 Data", - "type": "string" - } - }, - "required": [ - "base64_data" - ], - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "properties": { - "output_image_path": { - "description": "Output file path of the saved image.", - "title": "Output Image Path", - "type": "string" - } - }, - "required": [ - "output_image_path" - ], - "title": "OutputModel", - "type": "object" - }, - "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/SaveImagePiece" - }, - "GetDateTimePiece": { - "name": "GetDateTimePiece", - "dependency": { - "dockerfile": null, - "requirements_file": "requirements_0.txt" - }, - "tags": [ - "default", - "datetime" - ], - "style": { - "node_label": "Get Datetime", - "node_type": "default", - "node_style": { - "backgroundColor": "#ebebeb" - }, - "useIcon": true, - "icon_class_name": "fa:calendar-o", - "iconStyle": { - "cursor": "pointer" - } - }, - "description": "A Piece that gets system's current date and time.", - "input_schema": { - "$defs": { - "TZOptions": { - "enum": [ - "(UTC-11) - Pacific/Pago_Pago", - "(UTC-10) - US/Hawaii", - "(UTC-09) - Pacific/Gambier", - "(UTC-08) - US/Alaska", - "(UTC-07) - US/Pacific", - "(UTC-06) - US/Mountain", - "(UTC-05) - US/Central", - "(UTC-04) - US/Eastern", - "(UTC-03) - Canada/Atlantic", - "(UTC-02) - Atlantic/South_Georgia", - "(UTC-01) - Atlantic/Cape_Verde", - "(UTC+00) - UTC", - "(UTC+01) - Europe/London", - "(UTC+02) - Europe/Zurich", - "(UTC+03) - Indian/Mayotte", - "(UTC+04) - Asia/Tehran", - "(UTC+05) - Asia/Kathmandu", - "(UTC+06) - Indian/Cocos", - "(UTC+07) - Indian/Christmas", - "(UTC+08) - Australia/Eucla", - "(UTC+09) - Australia/Darwin", - "(UTC+10) - Australia/Lord_Howe", - "(UTC+11) - Pacific/Pohnpei", - "(UTC+12) - Pacific/Chatham", - "(UTC+13) - Pacific/Tongatapu", - "(UTC+14) - Pacific/Kiritimati" - ], - "title": "TZOptions", - "type": "string" - } - }, - "description": "GetDateTimePiece Input Model", - "properties": { - "use_timezone": { - "default": false, - "description": "Whether to use a timezone for the timestamp.", - "title": "Use Timezone", - "type": "boolean" + "default": "csv", + "description": "Input data format to be converted." }, - "timezone": { + "output_data_format": { "allOf": [ { - "$ref": "#/$defs/TZOptions" + "$ref": "#/$defs/DataFormatOption" } ], - "default": "(UTC+00) - UTC", - "description": "Timezone to use for timestamp." + "default": "json", + "description": "Output data format." } }, + "required": [ + "input_data" + ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "GetDateTimePiece Output Model", "properties": { - "date": { - "description": "Date of the timestamp, in ISO format.", - "format": "date", - "title": "Date", - "type": "string" - }, - "time": { - "description": "Time of the timestamp, in ISO format.", - "format": "time", - "title": "Time", - "type": "string" - }, - "datetime": { - "description": "Datetime of the timestamp, in ISO format.", - "format": "date-time", - "title": "Datetime", + "output_file_path": { + "description": "Path to the converted file.", + "title": "Output File Path", "type": "string" } }, "required": [ - "date", - "time", - "datetime" + "output_file_path" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetDateTimePiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/DataConversionPiece" }, "CustomPythonPiece": { "name": "CustomPythonPiece", @@ -586,1039 +482,1210 @@ "secrets_schema": null, "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/CustomPythonPiece" }, - "GetItemFromArrayPiece": { - "name": "GetItemFromArrayPiece", + "LogPiece": { + "name": "LogPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "array" + "log" ], "style": { - "node_label": "Get Item From Array", + "node_label": "Log", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "fluent:tray-item-remove-24-filled", + "icon_class_name": "fa-solid:file-alt", "iconStyle": { "cursor": "pointer" } }, - "description": "Get one item from an input array.", + "description": "A Piece that logs its inputs.", "input_schema": { "$defs": { - "IndexType": { + "InputEnum": { "enum": [ - "first", - "last", - "random", - "another" + "option1", + "option2", + "option3" ], - "title": "IndexType", + "title": "InputEnum", "type": "string" } }, - "description": "GetItemFromArrayPiece Input Model", + "description": "LogPiece Input Model", "properties": { - "input_array": { - "description": "Input array to get item from.", - "from_upstream": "always", - "items": {}, - "title": "Input Array", - "type": "array" + "input_str": { + "default": "default value", + "description": "Input string to be logged.", + "title": "Input Str", + "type": "string" }, - "index": { + "input_int": { + "default": 10, + "description": "Input integer to be logged.", + "title": "Input Int", + "type": "integer" + }, + "input_float": { + "default": 10.5, + "description": "Input float to be logged.", + "title": "Input Float", + "type": "number" + }, + "input_bool": { + "default": false, + "description": "Input boolean to be logged.", + "title": "Input Bool", + "type": "boolean" + }, + "input_enum": { "allOf": [ { - "$ref": "#/$defs/IndexType" + "$ref": "#/$defs/InputEnum" } ], - "default": "first", - "description": "Index of item to get from input array." + "default": "option1", + "description": "Input enum to be logged." }, - "another_index": { - "default": 1, - "description": "Index number of item to get from input array.", - "minimum": 1, - "title": "Another Index", - "type": "integer" + "input_date": { + "default": "2023-01-01", + "description": "Input date to be logged.", + "format": "date", + "title": "Input Date", + "type": "string" + }, + "input_time": { + "default": "16:20:00", + "description": "Input time to be logged.", + "format": "time", + "title": "Input Time", + "type": "string" + }, + "input_datetime": { + "default": "2023-01-01T16:20:00", + "description": "Input datetime to be logged.", + "format": "date-time", + "title": "Input Datetime", + "type": "string" + }, + "input_array": { + "default": [ + "default_1", + "default_2", + "default_3" + ], + "description": "Input array to be logged.", + "items": { + "type": "string" + }, + "title": "Input Array", + "type": "array" + }, + "input_code": { + "default": "print('Hello world!')", + "description": "Input code to be logged.", + "title": "Input Code", + "type": "string", + "widget": "codeeditor" } }, - "required": [ - "input_array" - ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "GetItemFromArrayPiece Output Model", + "description": "LogPiece Output Model", "properties": { - "output_value": { + "output_log": { + "description": "All values logged.", + "title": "Output Log", + "type": "string" + }, + "output_str": { "anyOf": [ { "type": "string" }, { - "items": {}, - "type": "array" - }, + "type": "null" + } + ], + "description": "Output string logged.", + "title": "Output Str" + }, + "output_int": { + "anyOf": [ { "type": "integer" }, + { + "type": "null" + } + ], + "description": "Output integer logged.", + "title": "Output Int" + }, + "output_float": { + "anyOf": [ { "type": "number" }, { - "type": "boolean" - }, + "type": "null" + } + ], + "description": "Output float logged.", + "title": "Output Float" + }, + "output_bool": { + "anyOf": [ { - "type": "object" + "type": "boolean" }, { - "format": "date", - "type": "string" - }, + "type": "null" + } + ], + "description": "Output boolean logged.", + "title": "Output Bool" + }, + "output_enum": { + "anyOf": [ { - "format": "time", "type": "string" }, { - "format": "date-time", - "type": "string" + "type": "null" } ], - "description": "Item from input array at specified index.", - "title": "Output Value" + "description": "Output enum logged.", + "title": "Output Enum" + }, + "output_date": { + "description": "Output date logged.", + "format": "date", + "title": "Output Date", + "type": "string" + }, + "output_time": { + "description": "Output time logged.", + "format": "time", + "title": "Output Time", + "type": "string" + }, + "output_datetime": { + "description": "Output datetime logged.", + "format": "date-time", + "title": "Output Datetime", + "type": "string" + }, + "output_array": { + "description": "Output array logged.", + "items": { + "type": "string" + }, + "title": "Output Array", + "type": "array" + }, + "output_code": { + "description": "Output code logged.", + "title": "Output Code", + "type": "string", + "widget": "codeeditor" } }, "required": [ - "output_value" + "output_log", + "output_str", + "output_int", + "output_float", + "output_bool", + "output_enum", + "output_date", + "output_time", + "output_datetime", + "output_array", + "output_code" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetItemFromArrayPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/LogPiece" }, - "DataConversionPiece": { - "name": "DataConversionPiece", + "SleepPiece": { + "name": "SleepPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ - "data", - "conversion", - "default" + "default", + "sleep" ], "style": { - "node_label": "Data Conversion Piece", + "node_label": "Sleep", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "icon-park-outline:file-conversion", + "icon_class_name": "fa-solid:hourglass-start", "iconStyle": { "cursor": "pointer" } }, - "description": "Convert data from one format to another", + "description": "A Piece that sleeps for a given number of seconds.", "input_schema": { - "$defs": { - "DataFormatOption": { - "enum": [ - "csv", - "json" - ], - "title": "DataFormatOption", - "type": "string" - } - }, + "description": "Sleep Piece Input Model", "properties": { - "input_data": { - "description": "Input data to be converted. Can be a file path or data as string.", - "title": "Input Data", - "type": "string" - }, - "input_data_format": { - "allOf": [ - { - "$ref": "#/$defs/DataFormatOption" - } - ], - "default": "csv", - "description": "Input data format to be converted." - }, - "output_data_format": { - "allOf": [ - { - "$ref": "#/$defs/DataFormatOption" - } - ], - "default": "json", - "description": "Output data format." + "sleep_time": { + "default": 1, + "description": "Number of seconds to sleep", + "title": "Sleep Time", + "type": "number" } }, - "required": [ - "input_data" - ], "title": "InputModel", "type": "object" }, "output_schema": { + "description": "Sleep Piece Output Model", "properties": { - "output_file_path": { - "description": "Path to the converted file.", - "title": "Output File Path", + "message": { + "description": "Sleep piece executed", + "title": "Message", "type": "string" } }, "required": [ - "output_file_path" + "message" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/DataConversionPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/SleepPiece" }, - "ToStringPiece": { - "name": "ToStringPiece", + "GetDateTimePiece": { + "name": "GetDateTimePiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "string" + "datetime" ], "style": { - "node_label": "To String", + "node_label": "Get Datetime", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "solar:text-bold", + "icon_class_name": "fa:calendar-o", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that transforms any input to string.", + "description": "A Piece that gets system's current date and time.", "input_schema": { - "description": "ToStringPiece Input Model", - "properties": { - "input_value": { - "anyOf": [ - { - "type": "string" - }, - { - "items": {}, - "type": "array" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "format": "date", - "type": "string" - }, - { - "format": "time", - "type": "string" - }, + "$defs": { + "TZOptions": { + "enum": [ + "(UTC-11) - Pacific/Pago_Pago", + "(UTC-10) - US/Hawaii", + "(UTC-09) - Pacific/Gambier", + "(UTC-08) - US/Alaska", + "(UTC-07) - US/Pacific", + "(UTC-06) - US/Mountain", + "(UTC-05) - US/Central", + "(UTC-04) - US/Eastern", + "(UTC-03) - Canada/Atlantic", + "(UTC-02) - Atlantic/South_Georgia", + "(UTC-01) - Atlantic/Cape_Verde", + "(UTC+00) - UTC", + "(UTC+01) - Europe/London", + "(UTC+02) - Europe/Zurich", + "(UTC+03) - Indian/Mayotte", + "(UTC+04) - Asia/Tehran", + "(UTC+05) - Asia/Kathmandu", + "(UTC+06) - Indian/Cocos", + "(UTC+07) - Indian/Christmas", + "(UTC+08) - Australia/Eucla", + "(UTC+09) - Australia/Darwin", + "(UTC+10) - Australia/Lord_Howe", + "(UTC+11) - Pacific/Pohnpei", + "(UTC+12) - Pacific/Chatham", + "(UTC+13) - Pacific/Tongatapu", + "(UTC+14) - Pacific/Kiritimati" + ], + "title": "TZOptions", + "type": "string" + } + }, + "description": "GetDateTimePiece Input Model", + "properties": { + "use_timezone": { + "default": false, + "description": "Whether to use a timezone for the timestamp.", + "title": "Use Timezone", + "type": "boolean" + }, + "timezone": { + "allOf": [ { - "format": "date-time", - "type": "string" + "$ref": "#/$defs/TZOptions" } ], - "description": "Input value to be turned into string.", - "from_upstream": "always", - "title": "Input Value" + "default": "(UTC+00) - UTC", + "description": "Timezone to use for timestamp." } }, - "required": [ - "input_value" - ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "ToStringPiece Output Model", + "description": "GetDateTimePiece Output Model", "properties": { - "output_value": { - "description": "Input value as a string.", - "title": "Output Value", + "date": { + "description": "Date of the timestamp, in ISO format.", + "format": "date", + "title": "Date", + "type": "string" + }, + "time": { + "description": "Time of the timestamp, in ISO format.", + "format": "time", + "title": "Time", + "type": "string" + }, + "datetime": { + "description": "Datetime of the timestamp, in ISO format.", + "format": "date-time", + "title": "Datetime", "type": "string" } }, "required": [ - "output_value" + "date", + "time", + "datetime" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ToStringPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetDateTimePiece" }, - "HttpRequestPiece": { - "name": "HttpRequestPiece", + "StringOperationsPiece": { + "name": "StringOperationsPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "http", - "request" + "string" ], "style": { - "node_label": "HTTP Request", + "node_label": "String Operations", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "material-symbols:send", + "icon_class_name": "tabler:sort-a-z", "iconStyle": { "cursor": "pointer" } }, - "description": "Makes a HTTP request to a given URL.", + "description": "A Piece that performs string operations", "input_schema": { "$defs": { - "MethodTypes": { + "OperationItem": { + "properties": { + "operation": { + "allOf": [ + { + "$ref": "#/$defs/OperationsTypes" + } + ], + "description": "Operation to perform. Options: `concatenate`, `lower_case`, `upper_case`, `split_by`, `replace_by`.", + "from_upstream": "never" + }, + "second_argument": { + "default": "", + "description": "Value for the second argument.", + "title": "Second Argument", + "type": "string" + }, + "auxiliary_argument": { + "default": "", + "description": "Auxiliary argument for `split_by` and `replace_by` operations.\nIf `split_by` is selected, this argument will be used as the index of the split array.\nIf `replace_by` is selected, this argument will be used as the string to replace.\n", + "title": "Auxiliary Argument", + "type": "string" + } + }, + "required": [ + "operation" + ], + "title": "OperationItem", + "type": "object" + }, + "OperationsTypes": { "enum": [ - "GET", - "POST", - "PUT", - "DELETE" + "concatenate", + "lower_case", + "upper_case", + "split_by", + "replace_by", + "strip_spaces" ], - "title": "MethodTypes", + "title": "OperationsTypes", "type": "string" } }, "properties": { - "url": { - "description": "URL to make a request to.", - "title": "Url", - "type": "string" - }, - "method": { - "allOf": [ - { - "$ref": "#/$defs/MethodTypes" - } - ], - "default": "GET", - "description": "HTTP method to use." - }, - "bearer_token": { - "default": null, - "description": "Bearer token to use for authentication.", - "title": "Bearer Token", + "first_argument": { + "description": "Value for the first argument.", + "title": "First Argument", "type": "string" }, - "body_json_data": { - "default": "{\n \"key_1\": \"value_1\",\n \"key_2\": \"value_2\"\n}\n", - "description": "JSON data to send in the request body.", - "title": "Body Json Data", - "type": "string", - "widget": "codeeditor-json" + "operations": { + "description": "Sequence of operations to perform.", + "items": { + "$ref": "#/$defs/OperationItem" + }, + "title": "Operations", + "type": "array" } }, "required": [ - "url" + "first_argument", + "operations" ], "title": "InputModel", "type": "object" }, "output_schema": { "properties": { - "base64_bytes_data": { - "description": "Output data as base64 encoded string.", - "title": "Base64 Bytes Data", + "output_string": { + "description": "Output string.", + "title": "Output String", "type": "string" } }, "required": [ - "base64_bytes_data" + "output_string" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/HttpRequestPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/StringOperationsPiece" }, - "ToyDatasetsPiece": { - "name": "ToyDatasetsPiece", + "StringConditionChecksPiece": { + "name": "StringConditionChecksPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "datasets" + "string" ], "style": { - "node_label": "Toy Datasets", + "node_label": "String Conditions Checks", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "lucide:toy-brick", + "icon_class_name": "mdi:format-letter-matches", "iconStyle": { "cursor": "pointer" } }, - "description": "Load toy datasets from scikit-learn", + "description": "A Piece that checks conditions on a string", "input_schema": { "$defs": { - "DatasetName": { + "ChecksTypes": { "enum": [ - "iris", - "diabetes", - "digits", - "wine", - "breast_cancer", - "linnerrud" + "contains_case_sensitive", + "contains_case_insensitive", + "length_greater_than", + "length_greater_than_or_equal_to", + "length_less_than", + "length_less_than_or_equal_to", + "length_equal_to", + "regex_match" ], - "title": "DatasetName", + "title": "ChecksTypes", "type": "string" - } - }, - "properties": { - "dataset": { - "allOf": [ - { - "$ref": "#/$defs/DatasetName" - } - ], - "default": "iris", - "title": "Dataset name" - } - }, - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "properties": { - "file_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + }, + "LogicalOperators": { + "enum": [ + "and", + "or" ], - "default": null, - "title": "File path" - } - }, - "title": "OutputModel", - "type": "object" + "title": "LogicalOperators", + "type": "string" + }, + "OperationItem": { + "properties": { + "operation": { + "allOf": [ + { + "$ref": "#/$defs/ChecksTypes" + } + ], + "description": "Operation to perform.\nOptions: `contains_case_sensitive`, `contains_case_insensitive`, `length_greater_than`, `length_greater_than_or_equal_to`, `length_less_than`, `length_less_than_or_equal_to`, `length_equal_to`, `regex_match`.\n", + "from_upstream": "never" + }, + "second_argument": { + "default": "", + "description": "Value for the second argument.\nIf `contains_case_sensitive` or `contains_case_insensitive` are selected, this argument will be used as the string to search for.\nIf `length_greater_than`, `length_greater_than_or_equal_to`, `length_less_than`, `length_less_than_or_equal_to` or `length_equal_to` are selected, this argument will be used as the integer value to compare with.\nIf `regex_match` is selected, this argument will be used as the string to match with the regex pattern.\n", + "title": "Second Argument", + "type": "string" + }, + "next_logical_operator": { + "allOf": [ + { + "$ref": "#/$defs/LogicalOperators" + } + ], + "default": "and", + "description": "Logical operator to use with the next operation result." + } + }, + "required": [ + "operation" + ], + "title": "OperationItem", + "type": "object" + } + }, + "properties": { + "input_string": { + "description": "Input string.", + "title": "Input String", + "type": "string" + }, + "operations": { + "description": "Sequence of operations to perform.", + "items": { + "$ref": "#/$defs/OperationItem" + }, + "title": "Operations", + "type": "array" + } + }, + "required": [ + "input_string", + "operations" + ], + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "properties": { + "check_result": { + "description": "Result of the checks.", + "title": "Check Result", + "type": "boolean" + } + }, + "required": [ + "check_result" + ], + "title": "OutputModel", + "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ToyDatasetsPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/StringConditionChecksPiece" }, - "PageScrapperPiece": { - "name": "PageScrapperPiece", + "YDataProfilingPiece": { + "name": "YDataProfilingPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "scrapper" + "eda" ], "style": { - "node_label": "Page Scrapper", + "node_label": "Data Profiling", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "lucide:text-selection", + "icon_class_name": "mingcute:profile-line", "iconStyle": { "cursor": "pointer" } }, - "description": "Scrapes text from a web page, given a URL and a list of HTML tags.", + "description": "Piece that uses ydata-profiling to create fast EDA.", "input_schema": { - "$defs": { - "ItemType": { - "properties": { - "tag": { - "default": "p", - "description": "HTML tag name.", - "title": "Tag", - "type": "string" - }, - "class_name": { - "default": "", - "description": "HTML tag class name.", - "title": "Class Name", - "type": "string" - } - }, - "title": "ItemType", - "type": "object" - } - }, - "description": "PageScrapperPiece Input Model", "properties": { - "url": { - "default": "", - "description": "URL to retrieve content from.", - "title": "Url", + "data_path": { + "description": "Path to the CSV file to be profiled", + "title": "CSV file path", "type": "string" }, - "search_items": { - "default": [ + "report_tile": { + "anyOf": [ { - "class_name": "", - "tag": "p" + "type": "string" + }, + { + "type": "null" } ], - "description": "List of HTML tags and class names to search for.", - "items": { - "$ref": "#/$defs/ItemType" - }, - "title": "Search Items", - "type": "array" + "default": "Profiling Report", + "description": "Title of the report", + "title": "Report title" } }, + "required": [ + "data_path" + ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "PageScrapperPiece Output Model", "properties": { - "scrapped_text": { - "description": "Scrapped text from the URL.", - "title": "Scrapped Text", + "profile_file_path": { + "description": "Path to the output file.", + "title": "Output file path", "type": "string" } }, "required": [ - "scrapped_text" + "profile_file_path" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/PageScrapperPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/YDataProfilingPiece" }, - "LogPiece": { - "name": "LogPiece", + "GetItemFromArrayPiece": { + "name": "GetItemFromArrayPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "log" + "array" ], "style": { - "node_label": "Log", + "node_label": "Get Item From Array", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "fa-solid:file-alt", + "icon_class_name": "fluent:tray-item-remove-24-filled", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that logs its inputs.", + "description": "Get one item from an input array.", "input_schema": { "$defs": { - "InputEnum": { + "IndexType": { "enum": [ - "option1", - "option2", - "option3" + "first", + "last", + "random", + "another" ], - "title": "InputEnum", + "title": "IndexType", "type": "string" } }, - "description": "LogPiece Input Model", + "description": "GetItemFromArrayPiece Input Model", "properties": { - "input_str": { - "default": "default value", - "description": "Input string to be logged.", - "title": "Input Str", - "type": "string" - }, - "input_int": { - "default": 10, - "description": "Input integer to be logged.", - "title": "Input Int", - "type": "integer" - }, - "input_float": { - "default": 10.5, - "description": "Input float to be logged.", - "title": "Input Float", - "type": "number" - }, - "input_bool": { - "default": false, - "description": "Input boolean to be logged.", - "title": "Input Bool", - "type": "boolean" + "input_array": { + "description": "Input array to get item from.", + "from_upstream": "always", + "items": {}, + "title": "Input Array", + "type": "array" }, - "input_enum": { + "index": { "allOf": [ { - "$ref": "#/$defs/InputEnum" + "$ref": "#/$defs/IndexType" } ], - "default": "option1", - "description": "Input enum to be logged." - }, - "input_date": { - "default": "2023-01-01", - "description": "Input date to be logged.", - "format": "date", - "title": "Input Date", - "type": "string" - }, - "input_time": { - "default": "16:20:00", - "description": "Input time to be logged.", - "format": "time", - "title": "Input Time", - "type": "string" - }, - "input_datetime": { - "default": "2023-01-01T16:20:00", - "description": "Input datetime to be logged.", - "format": "date-time", - "title": "Input Datetime", - "type": "string" - }, - "input_array": { - "default": [ - "default_1", - "default_2", - "default_3" - ], - "description": "Input array to be logged.", - "items": { - "type": "string" - }, - "title": "Input Array", - "type": "array" + "default": "first", + "description": "Index of item to get from input array." }, - "input_code": { - "default": "print('Hello world!')", - "description": "Input code to be logged.", - "title": "Input Code", - "type": "string", - "widget": "codeeditor" + "another_index": { + "default": 1, + "description": "Index number of item to get from input array.", + "minimum": 1, + "title": "Another Index", + "type": "integer" } }, + "required": [ + "input_array" + ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "LogPiece Output Model", + "description": "GetItemFromArrayPiece Output Model", "properties": { - "output_log": { - "description": "All values logged.", - "title": "Output Log", - "type": "string" - }, - "output_str": { + "output_value": { "anyOf": [ { "type": "string" }, { - "type": "null" - } - ], - "description": "Output string logged.", - "title": "Output Str" - }, - "output_int": { - "anyOf": [ + "items": {}, + "type": "array" + }, { "type": "integer" }, - { - "type": "null" - } - ], - "description": "Output integer logged.", - "title": "Output Int" - }, - "output_float": { - "anyOf": [ { "type": "number" }, { - "type": "null" + "type": "boolean" + }, + { + "type": "object" + }, + { + "format": "date", + "type": "string" + }, + { + "format": "time", + "type": "string" + }, + { + "format": "date-time", + "type": "string" } ], - "description": "Output float logged.", - "title": "Output Float" - }, - "output_bool": { + "description": "Item from input array at specified index.", + "title": "Output Value" + } + }, + "required": [ + "output_value" + ], + "title": "OutputModel", + "type": "object" + }, + "secrets_schema": null, + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetItemFromArrayPiece" + }, + "ToStringPiece": { + "name": "ToStringPiece", + "dependency": { + "dockerfile": null, + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "string" + ], + "style": { + "node_label": "To String", + "node_type": "default", + "node_style": { + "backgroundColor": "#ebebeb" + }, + "useIcon": true, + "icon_class_name": "solar:text-bold", + "iconStyle": { + "cursor": "pointer" + } + }, + "description": "A Piece that transforms any input to string.", + "input_schema": { + "description": "ToStringPiece Input Model", + "properties": { + "input_value": { "anyOf": [ + { + "type": "string" + }, + { + "items": {}, + "type": "array" + }, + { + "type": "integer" + }, + { + "type": "number" + }, { "type": "boolean" }, { - "type": "null" - } - ], - "description": "Output boolean logged.", - "title": "Output Bool" - }, - "output_enum": { - "anyOf": [ + "type": "object" + }, { + "format": "date", "type": "string" }, { - "type": "null" + "format": "time", + "type": "string" + }, + { + "format": "date-time", + "type": "string" } ], - "description": "Output enum logged.", - "title": "Output Enum" - }, - "output_date": { - "description": "Output date logged.", - "format": "date", - "title": "Output Date", + "description": "Input value to be turned into string.", + "from_upstream": "always", + "title": "Input Value" + } + }, + "required": [ + "input_value" + ], + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "description": "ToStringPiece Output Model", + "properties": { + "output_value": { + "description": "Input value as a string.", + "title": "Output Value", "type": "string" - }, - "output_time": { - "description": "Output time logged.", - "format": "time", - "title": "Output Time", + } + }, + "required": [ + "output_value" + ], + "title": "OutputModel", + "type": "object" + }, + "secrets_schema": null, + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ToStringPiece" + }, + "HttpRequestPiece": { + "name": "HttpRequestPiece", + "dependency": { + "dockerfile": null, + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "http", + "request" + ], + "style": { + "node_label": "HTTP Request", + "node_type": "default", + "node_style": { + "backgroundColor": "#ebebeb" + }, + "useIcon": true, + "icon_class_name": "material-symbols:send", + "iconStyle": { + "cursor": "pointer" + } + }, + "description": "Makes a HTTP request to a given URL.", + "input_schema": { + "$defs": { + "MethodTypes": { + "enum": [ + "GET", + "POST", + "PUT", + "DELETE" + ], + "title": "MethodTypes", "type": "string" - }, - "output_datetime": { - "description": "Output datetime logged.", - "format": "date-time", - "title": "Output Datetime", + } + }, + "properties": { + "url": { + "description": "URL to make a request to.", + "title": "Url", "type": "string" }, - "output_array": { - "description": "Output array logged.", - "items": { - "type": "string" - }, - "title": "Output Array", - "type": "array" + "method": { + "allOf": [ + { + "$ref": "#/$defs/MethodTypes" + } + ], + "default": "GET", + "description": "HTTP method to use." }, - "output_code": { - "description": "Output code logged.", - "title": "Output Code", + "bearer_token": { + "default": null, + "description": "Bearer token to use for authentication.", + "title": "Bearer Token", + "type": "string" + }, + "body_json_data": { + "default": "{\n \"key_1\": \"value_1\",\n \"key_2\": \"value_2\"\n}\n", + "description": "JSON data to send in the request body.", + "title": "Body Json Data", "type": "string", - "widget": "codeeditor" + "widget": "codeeditor-json" } }, "required": [ - "output_log", - "output_str", - "output_int", - "output_float", - "output_bool", - "output_enum", - "output_date", - "output_time", - "output_datetime", - "output_array", - "output_code" + "url" ], + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "properties": { + "base64_bytes_data": { + "description": "Output data as base64 encoded string.", + "title": "Base64 Bytes Data", + "type": "string" + } + }, + "required": [ + "base64_bytes_data" + ], + "title": "OutputModel", + "type": "object" + }, + "secrets_schema": null, + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/HttpRequestPiece" + }, + "ToyDatasetsPiece": { + "name": "ToyDatasetsPiece", + "dependency": { + "dockerfile": null, + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "datasets" + ], + "style": { + "node_label": "Toy Datasets", + "node_type": "default", + "node_style": { + "backgroundColor": "#ebebeb" + }, + "useIcon": true, + "icon_class_name": "lucide:toy-brick", + "iconStyle": { + "cursor": "pointer" + } + }, + "description": "Load toy datasets from scikit-learn", + "input_schema": { + "$defs": { + "DatasetName": { + "enum": [ + "iris", + "diabetes", + "digits", + "wine", + "breast_cancer", + "linnerrud" + ], + "title": "DatasetName", + "type": "string" + } + }, + "properties": { + "dataset": { + "allOf": [ + { + "$ref": "#/$defs/DatasetName" + } + ], + "default": "iris", + "title": "Dataset name" + } + }, + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "properties": { + "file_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "File path" + } + }, "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/LogPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ToyDatasetsPiece" }, - "ImageFilterPiece": { - "name": "ImageFilterPiece", + "PageScrapperPiece": { + "name": "PageScrapperPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "image" + "scrapper" ], "style": { - "node_label": "Image Filter", + "node_label": "Page Scrapper", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "ic:twotone-filter", + "icon_class_name": "lucide:text-selection", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that applies selected image filters to an image.", + "description": "Scrapes text from a web page, given a URL and a list of HTML tags.", "input_schema": { "$defs": { - "OutputTypeType": { - "description": "Output type for the result text", - "enum": [ - "file", - "base64_string", - "both" - ], - "title": "OutputTypeType", - "type": "string" + "ItemType": { + "properties": { + "tag": { + "default": "p", + "description": "HTML tag name.", + "title": "Tag", + "type": "string" + }, + "class_name": { + "default": "", + "description": "HTML tag class name.", + "title": "Class Name", + "type": "string" + } + }, + "title": "ItemType", + "type": "object" } }, + "description": "PageScrapperPiece Input Model", "properties": { - "input_image": { - "description": "Input image. It should be either a path to a file, or a base64 encoded string.", - "from_upstream": "always", - "title": "Input Image", + "url": { + "default": "", + "description": "URL to retrieve content from.", + "title": "Url", "type": "string" }, - "sepia": { - "default": false, - "description": "Apply sepia effect.", - "title": "Sepia", - "type": "boolean" - }, - "black_and_white": { - "default": false, - "description": "Apply black and white effect.", - "title": "Black And White", - "type": "boolean" - }, - "brightness": { - "default": false, - "description": "Apply brightness effect.", - "title": "Brightness", - "type": "boolean" - }, - "darkness": { - "default": false, - "description": "Apply darkness effect.", - "title": "Darkness", - "type": "boolean" - }, - "contrast": { - "default": false, - "description": "Apply contrast effect.", - "title": "Contrast", - "type": "boolean" - }, - "red": { - "default": false, - "description": "Apply red effect.", - "title": "Red", - "type": "boolean" - }, - "green": { - "default": false, - "description": "Apply green effect.", - "title": "Green", - "type": "boolean" - }, - "blue": { - "default": false, - "description": "Apply blue effect.", - "title": "Blue", - "type": "boolean" - }, - "cool": { - "default": false, - "description": "Apply cool effect.", - "title": "Cool", - "type": "boolean" - }, - "warm": { - "default": false, - "description": "Apply warm effect.", - "title": "Warm", - "type": "boolean" - }, - "output_type": { - "allOf": [ + "search_items": { + "default": [ { - "$ref": "#/$defs/OutputTypeType" + "class_name": "", + "tag": "p" } ], - "default": "both", - "description": "Format of the output image. Options are: `file`, `base64_string`, `both`." + "description": "List of HTML tags and class names to search for.", + "items": { + "$ref": "#/$defs/ItemType" + }, + "title": "Search Items", + "type": "array" } }, - "required": [ - "input_image" - ], "title": "InputModel", "type": "object" }, "output_schema": { + "description": "PageScrapperPiece Output Model", "properties": { - "image_base64_string": { - "default": "", - "description": "Base64 encoded string of the output image.", - "title": "Image Base64 String", - "type": "string" - }, - "image_file_path": { - "default": "", - "description": "Path to the output image file.", - "title": "Image File Path", + "scrapped_text": { + "description": "Scrapped text from the URL.", + "title": "Scrapped Text", "type": "string" } }, + "required": [ + "scrapped_text" + ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ImageFilterPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/PageScrapperPiece" }, - "StringConditionChecksPiece": { - "name": "StringConditionChecksPiece", + "SaveImagePiece": { + "name": "SaveImagePiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "string" + "image" ], "style": { - "node_label": "String Conditions Checks", + "node_label": "Save Image", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "mdi:format-letter-matches", + "icon_class_name": "material-symbols:image-outline", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that checks conditions on a string", + "description": "Save base64 as image file to results folder.", "input_schema": { - "$defs": { - "ChecksTypes": { - "enum": [ - "contains_case_sensitive", - "contains_case_insensitive", - "length_greater_than", - "length_greater_than_or_equal_to", - "length_less_than", - "length_less_than_or_equal_to", - "length_equal_to", - "regex_match" - ], - "title": "ChecksTypes", - "type": "string" - }, - "LogicalOperators": { - "enum": [ - "and", - "or" - ], - "title": "LogicalOperators", - "type": "string" - }, - "OperationItem": { - "properties": { - "operation": { - "allOf": [ - { - "$ref": "#/$defs/ChecksTypes" - } - ], - "description": "Operation to perform.\nOptions: `contains_case_sensitive`, `contains_case_insensitive`, `length_greater_than`, `length_greater_than_or_equal_to`, `length_less_than`, `length_less_than_or_equal_to`, `length_equal_to`, `regex_match`.\n", - "from_upstream": "never" - }, - "second_argument": { - "default": "", - "description": "Value for the second argument.\nIf `contains_case_sensitive` or `contains_case_insensitive` are selected, this argument will be used as the string to search for.\nIf `length_greater_than`, `length_greater_than_or_equal_to`, `length_less_than`, `length_less_than_or_equal_to` or `length_equal_to` are selected, this argument will be used as the integer value to compare with.\nIf `regex_match` is selected, this argument will be used as the string to match with the regex pattern.\n", - "title": "Second Argument", - "type": "string" - }, - "next_logical_operator": { - "allOf": [ - { - "$ref": "#/$defs/LogicalOperators" - } - ], - "default": "and", - "description": "Logical operator to use with the next operation result." - } - }, - "required": [ - "operation" - ], - "title": "OperationItem", - "type": "object" - } - }, "properties": { - "input_string": { - "description": "Input string.", - "title": "Input String", + "base64_data": { + "description": "Input data to be saved as image.", + "title": "Base64 Data", "type": "string" - }, - "operations": { - "description": "Sequence of operations to perform.", - "items": { - "$ref": "#/$defs/OperationItem" - }, - "title": "Operations", - "type": "array" } }, "required": [ - "input_string", - "operations" + "base64_data" ], "title": "InputModel", "type": "object" }, "output_schema": { "properties": { - "check_result": { - "description": "Result of the checks.", - "title": "Check Result", - "type": "boolean" + "output_image_path": { + "description": "Output file path of the saved image.", + "title": "Output Image Path", + "type": "string" } }, "required": [ - "check_result" + "output_image_path" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/StringConditionChecksPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/SaveImagePiece" } } \ No newline at end of file diff --git a/.domino/dependencies_map.json b/.domino/dependencies_map.json index 15c4b62..ab9eda8 100644 --- a/.domino/dependencies_map.json +++ b/.domino/dependencies_map.json @@ -5,21 +5,22 @@ "requirements_file": "requirements_0.txt" }, "pieces": [ - "StringOperationsPiece", - "SleepPiece", "LoremIpsumGeneratorPiece", - "SaveImagePiece", - "GetDateTimePiece", + "ImageFilterPiece", + "DataConversionPiece", "CustomPythonPiece", + "LogPiece", + "SleepPiece", + "GetDateTimePiece", + "StringOperationsPiece", + "StringConditionChecksPiece", + "YDataProfilingPiece", "GetItemFromArrayPiece", - "DataConversionPiece", "ToStringPiece", "HttpRequestPiece", "ToyDatasetsPiece", "PageScrapperPiece", - "LogPiece", - "ImageFilterPiece", - "StringConditionChecksPiece" + "SaveImagePiece" ], "secrets": [], "source_image": "ghcr.io/tauffer-consulting/default_domino_pieces:development-group0" From 218f6d75ced42432f46c592c0166163b17ac53d7 Mon Sep 17 00:00:00 2001 From: vinicvaz Date: Mon, 18 Dec 2023 10:12:18 -0300 Subject: [PATCH 3/5] fix model --- pieces/YDataProfilingPiece/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pieces/YDataProfilingPiece/models.py b/pieces/YDataProfilingPiece/models.py index 186f4e6..b242c21 100644 --- a/pieces/YDataProfilingPiece/models.py +++ b/pieces/YDataProfilingPiece/models.py @@ -3,7 +3,13 @@ class InputModel(BaseModel): - data_path: str = Field(title='CSV file path', description='Path to the CSV file to be profiled') + data_path: str = Field( + title='CSV file path', + description='Path to the CSV file to be profiled', + json_schema_extra={ + "from_upstream": "always" + } + ) report_tile: Optional[str] = Field(title='Report title', description='Title of the report', default='Profiling Report') class OutputModel(BaseModel): From 96110cbed46919cf505cd1842a49f64fcc6d1686 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 18 Dec 2023 13:21:25 +0000 Subject: [PATCH 4/5] auto-organize --- .domino/compiled_metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.domino/compiled_metadata.json b/.domino/compiled_metadata.json index 85412cf..2414d12 100644 --- a/.domino/compiled_metadata.json +++ b/.domino/compiled_metadata.json @@ -1137,6 +1137,7 @@ "properties": { "data_path": { "description": "Path to the CSV file to be profiled", + "from_upstream": "always", "title": "CSV file path", "type": "string" }, From 754a5f6c9308427be5c38ddcc792ae4b2d236c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Vaz?= Date: Tue, 19 Dec 2023 07:15:35 -0300 Subject: [PATCH 5/5] Update config.toml --- config.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index b8e9e59..33f2f4d 100644 --- a/config.toml +++ b/config.toml @@ -4,4 +4,5 @@ REGISTRY_NAME = "tauffer-consulting" REPOSITORY_NAME = "default_domino_pieces" REPOSITORY_LABEL = "Default Pieces Repository" -VERSION = "0.8.0" \ No newline at end of file +VERSION = "0.8.0" +