diff --git a/.domino/compiled_metadata.json b/.domino/compiled_metadata.json index dc0e6ee..dce9ea4 100644 --- a/.domino/compiled_metadata.json +++ b/.domino/compiled_metadata.json @@ -1,170 +1,4 @@ { - "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" - }, - "timezone": { - "allOf": [ - { - "$ref": "#/$defs/TZOptions" - } - ], - "default": "(UTC+00) - UTC", - "description": "Timezone to use for timestamp." - } - }, - "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", - "type": "string" - } - }, - "required": [ - "date", - "time", - "datetime" - ], - "title": "OutputModel", - "type": "object" - }, - "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetDateTimePiece" - }, "CustomPythonPiece": { "name": "CustomPythonPiece", "dependency": { @@ -309,7 +143,7 @@ "type": "array" }, "script": { - "default": "# Do not modify the function definition line\ndef custom_function(kwarg_1, kwarg_2):\n # Write your code here\n print(f\"First argument: {kwarg_1}\")\n print(f\"Second argument: {kwarg_2}\")\n\n # Return the output of the function as an object,\n # Matching the Output Args defined in the Form below\n return {\n \"output_1\": \"this is a string\",\n \"output_2\": 420\n }\n", + "default": "# Do not modify the function name in definition line\ndef custom_function(kwarg_1, kwarg_2):\n # Write your code here\n print(f\"First argument: {kwarg_1}\")\n print(f\"Second argument: {kwarg_2}\")\n\n # Return the output of the function as an object,\n # Matching the Output Args defined in the Form below\n return {\n \"output_1\": \"this is a string\",\n \"output_2\": 420\n }\n", "description": "Python script.", "from_upstream": "never", "title": "Script", @@ -351,178 +185,179 @@ "secrets_schema": null, "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/CustomPythonPiece" }, - "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" + "default": "first", + "description": "Index of item to get from input array." }, - "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" + "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" - } - ], - "description": "Output float logged.", - "title": "Output Float" - }, - "output_bool": { - "anyOf": [ { "type": "boolean" }, { - "type": "null" + "type": "object" + }, + { + "format": "date", + "type": "string" + }, + { + "format": "time", + "type": "string" + }, + { + "format": "date-time", + "type": "string" } ], - "description": "Output boolean logged.", - "title": "Output Bool" - }, - "output_enum": { + "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" + }, + "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" @@ -531,60 +366,69 @@ "type": "null" } ], - "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", + "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/ToyDatasetsPiece" + }, + "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" - }, - "output_datetime": { - "description": "Output datetime logged.", - "format": "date-time", - "title": "Output Datetime", + } + }, + "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" - }, - "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_log", - "output_str", - "output_int", - "output_float", - "output_bool", - "output_enum", - "output_date", - "output_time", - "output_datetime", - "output_array", - "output_code" + "output_image_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/SaveImagePiece" }, "ImageFilterPiece": { "name": "ImageFilterPiece", @@ -726,175 +570,24 @@ "secrets_schema": null, "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ImageFilterPiece" }, - "DataConversionPiece": { - "name": "DataConversionPiece", + "StringConditionChecksPiece": { + "name": "StringConditionChecksPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ - "data", - "conversion", - "default" + "default", + "string" ], "style": { - "node_label": "Data Conversion Piece", + "node_label": "String Conditions Checks", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "icon-park-outline:file-conversion", - "iconStyle": { - "cursor": "pointer" - } - }, - "description": "Convert data from one format to another", - "input_schema": { - "$defs": { - "DataFormatOption": { - "enum": [ - "csv", - "json" - ], - "title": "DataFormatOption", - "type": "string" - } - }, - "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." - } - }, - "required": [ - "input_data" - ], - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "properties": { - "output_file_path": { - "description": "Path to the converted file.", - "title": "Output File Path", - "type": "string" - } - }, - "required": [ - "output_file_path" - ], - "title": "OutputModel", - "type": "object" - }, - "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/DataConversionPiece" - }, - "YDataProfilingPiece": { - "name": "YDataProfilingPiece", - "dependency": { - "dockerfile": null, - "requirements_file": "requirements_0.txt" - }, - "tags": [ - "default", - "eda" - ], - "style": { - "node_label": "Data Profiling", - "node_type": "default", - "node_style": { - "backgroundColor": "#ebebeb" - }, - "useIcon": true, - "icon_class_name": "mingcute:profile-line", - "iconStyle": { - "cursor": "pointer" - } - }, - "description": "Piece that uses ydata-profiling to create fast EDA.", - "input_schema": { - "properties": { - "data_path": { - "description": "Path to the CSV file to be profiled", - "from_upstream": "always", - "title": "CSV file path", - "type": "string" - }, - "report_tile": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "Profiling Report", - "description": "Title of the report", - "title": "Report title" - } - }, - "required": [ - "data_path" - ], - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "properties": { - "profile_file_path": { - "description": "Path to the output file.", - "title": "Output file path", - "type": "string" - } - }, - "required": [ - "profile_file_path" - ], - "title": "OutputModel", - "type": "object" - }, - "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/YDataProfilingPiece" - }, - "StringConditionChecksPiece": { - "name": "StringConditionChecksPiece", - "dependency": { - "dockerfile": null, - "requirements_file": "requirements_0.txt" - }, - "tags": [ - "default", - "string" - ], - "style": { - "node_label": "String Conditions Checks", - "node_type": "default", - "node_style": { - "backgroundColor": "#ebebeb" - }, - "useIcon": true, - "icon_class_name": "mdi:format-letter-matches", + "icon_class_name": "mdi:format-letter-matches", "iconStyle": { "cursor": "pointer" } @@ -997,330 +690,756 @@ "secrets_schema": null, "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/StringConditionChecksPiece" }, - "PageScrapperPiece": { - "name": "PageScrapperPiece", + "LoremIpsumGeneratorPiece": { + "name": "LoremIpsumGeneratorPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "scrapper" + "text" ], "style": { - "node_label": "Page Scrapper", + "node_label": "Lorem Ipsum Generator", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "lucide:text-selection", + "icon_class_name": "carbon:character-sentence-case", "iconStyle": { "cursor": "pointer" } }, - "description": "Scrapes text from a web page, given a URL and a list of HTML tags.", + "description": "A Piece that generates Lorem Ipsum text.", "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" + "ItemsType": { + "enum": [ + "words", + "sentences", + "paragraphs" + ], + "title": "ItemsType", + "type": "string" } }, - "description": "PageScrapperPiece Input Model", + "description": "LoremIpsumGeneratorPiece Input Model", "properties": { - "url": { - "default": "", - "description": "URL to retrieve content from.", - "title": "Url", - "type": "string" - }, - "search_items": { - "default": [ + "items": { + "allOf": [ { - "class_name": "", - "tag": "p" + "$ref": "#/$defs/ItemsType" } ], - "description": "List of HTML tags and class names to search for.", - "items": { - "$ref": "#/$defs/ItemType" - }, - "title": "Search Items", - "type": "array" + "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": "PageScrapperPiece Output Model", + "description": "LoremIpsumGeneratorPiece Output Model", "properties": { - "scrapped_text": { - "description": "Scrapped text from the URL.", - "title": "Scrapped Text", + "output_text": { + "description": "Generated text.", + "title": "Output Text", "type": "string" } }, "required": [ - "scrapped_text" + "output_text" ], "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/LoremIpsumGeneratorPiece" }, - "SleepPiece": { - "name": "SleepPiece", + "ToStringPiece": { + "name": "ToStringPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "sleep" + "string" ], "style": { - "node_label": "Sleep", + "node_label": "To String", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "fa-solid:hourglass-start", + "icon_class_name": "solar:text-bold", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that sleeps for a given number of seconds.", + "description": "A Piece that transforms any input to string.", "input_schema": { - "description": "Sleep Piece Input Model", - "properties": { - "sleep_time": { - "default": 1, - "description": "Number of seconds to sleep", - "title": "Sleep Time", - "type": "number" - } - }, - "title": "InputModel", - "type": "object" - }, - "output_schema": { - "description": "Sleep Piece Output Model", + "description": "ToStringPiece Input Model", "properties": { - "message": { - "description": "Sleep piece executed", - "title": "Message", + "input_value": { + "anyOf": [ + { + "type": "string" + }, + { + "items": {}, + "type": "array" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object" + }, + { + "format": "date", + "type": "string" + }, + { + "format": "time", + "type": "string" + }, + { + "format": "date-time", + "type": "string" + } + ], + "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" + } + }, + "required": [ + "output_value" + ], + "title": "OutputModel", + "type": "object" + }, + "secrets_schema": null, + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/ToStringPiece" + }, + "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" + }, + "timezone": { + "allOf": [ + { + "$ref": "#/$defs/TZOptions" + } + ], + "default": "(UTC+00) - UTC", + "description": "Timezone to use for timestamp." + } + }, + "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", + "type": "string" + } + }, + "required": [ + "date", + "time", + "datetime" + ], + "title": "OutputModel", + "type": "object" + }, + "secrets_schema": null, + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/GetDateTimePiece" + }, + "LogPiece": { + "name": "LogPiece", + "dependency": { + "dockerfile": null, + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "log" + ], + "style": { + "node_label": "Log", + "node_type": "default", + "node_style": { + "backgroundColor": "#ebebeb" + }, + "useIcon": true, + "icon_class_name": "fa-solid:file-alt", + "iconStyle": { + "cursor": "pointer" + } + }, + "description": "A Piece that logs its inputs.", + "input_schema": { + "$defs": { + "InputEnum": { + "enum": [ + "option1", + "option2", + "option3" + ], + "title": "InputEnum", + "type": "string" + } + }, + "description": "LogPiece 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_enum": { + "allOf": [ + { + "$ref": "#/$defs/InputEnum" + } + ], + "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" + }, + "input_code": { + "default": "print('Hello world!')", + "description": "Input code to be logged.", + "title": "Input Code", + "type": "string", + "widget": "codeeditor" + } + }, + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "description": "LogPiece Output Model", + "properties": { + "output_log": { + "description": "All values logged.", + "title": "Output Log", + "type": "string" + }, + "output_str": { + "anyOf": [ + { + "type": "string" + }, + { + "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": "null" + } + ], + "description": "Output float logged.", + "title": "Output Float" + }, + "output_bool": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Output boolean logged.", + "title": "Output Bool" + }, + "output_enum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "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_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/LogPiece" + }, + "PageScrapperPiece": { + "name": "PageScrapperPiece", + "dependency": { + "dockerfile": null, + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "scrapper" + ], + "style": { + "node_label": "Page Scrapper", + "node_type": "default", + "node_style": { + "backgroundColor": "#ebebeb" + }, + "useIcon": true, + "icon_class_name": "lucide:text-selection", + "iconStyle": { + "cursor": "pointer" + } + }, + "description": "Scrapes text from a web page, given a URL and a list of HTML tags.", + "input_schema": { + "$defs": { + "ItemType": { + "properties": { + "tag": { + "default": "p", + "description": "HTML tag name.", + "title": "Tag", + "type": "string" + }, + "class_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "", + "description": "HTML tag class name.", + "title": "Class Name" + } + }, + "title": "ItemType", + "type": "object" + } + }, + "description": "PageScrapperPiece Input Model", + "properties": { + "url": { + "default": "", + "description": "URL to retrieve content from.", + "title": "Url", + "type": "string" + }, + "search_items": { + "default": [ + { + "class_name": "", + "tag": "p" + } + ], + "description": "List of HTML tags and class names to search for.", + "items": { + "$ref": "#/$defs/ItemType" + }, + "title": "Search Items", + "type": "array" + } + }, + "title": "InputModel", + "type": "object" + }, + "output_schema": { + "description": "PageScrapperPiece Output Model", + "properties": { + "scrapped_text": { + "description": "Scrapped text from the URL.", + "title": "Scrapped Text", "type": "string" } }, "required": [ - "message" + "scrapped_text" ], "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/PageScrapperPiece" }, - "StringOperationsPiece": { - "name": "StringOperationsPiece", + "SleepPiece": { + "name": "SleepPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "string" + "sleep" ], "style": { - "node_label": "String Operations", + "node_label": "Sleep", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "tabler:sort-a-z", + "icon_class_name": "fa-solid:hourglass-start", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that performs string operations", + "description": "A Piece that sleeps for a given number of seconds.", "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": { - "enum": [ - "concatenate", - "lower_case", - "upper_case", - "split_by", - "replace_by", - "strip_spaces" - ], - "title": "OperationsTypes", - "type": "string" - } - }, + "description": "Sleep Piece Input Model", "properties": { - "first_argument": { - "description": "Value for the first argument.", - "title": "First Argument", - "type": "string" - }, - "operations": { - "description": "Sequence of operations to perform.", - "items": { - "$ref": "#/$defs/OperationItem" - }, - "title": "Operations", - "type": "array" + "sleep_time": { + "default": 1, + "description": "Number of seconds to sleep", + "title": "Sleep Time", + "type": "number" } }, - "required": [ - "first_argument", - "operations" - ], "title": "InputModel", "type": "object" }, "output_schema": { + "description": "Sleep Piece Output Model", "properties": { - "output_string": { - "description": "Output string.", - "title": "Output String", + "message": { + "description": "Sleep piece executed", + "title": "Message", "type": "string" } }, "required": [ - "output_string" + "message" ], "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/SleepPiece" }, - "ToyDatasetsPiece": { - "name": "ToyDatasetsPiece", + "HttpRequestPiece": { + "name": "HttpRequestPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "datasets" + "http", + "request" ], "style": { - "node_label": "Toy Datasets", + "node_label": "HTTP Request", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "lucide:toy-brick", + "icon_class_name": "material-symbols:send", "iconStyle": { "cursor": "pointer" } }, - "description": "Load toy datasets from scikit-learn", + "description": "Makes a HTTP request to a given URL.", "input_schema": { "$defs": { - "DatasetName": { + "MethodTypes": { "enum": [ - "iris", - "diabetes", - "digits", - "wine", - "breast_cancer", - "linnerrud" + "GET", + "POST", + "PUT", + "DELETE" ], - "title": "DatasetName", + "title": "MethodTypes", "type": "string" } }, "properties": { - "dataset": { + "url": { + "description": "URL to make a request to.", + "title": "Url", + "type": "string" + }, + "method": { "allOf": [ { - "$ref": "#/$defs/DatasetName" + "$ref": "#/$defs/MethodTypes" } ], - "default": "iris", - "title": "Dataset name" + "default": "GET", + "description": "HTTP method to use." + }, + "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-json" } }, + "required": [ + "url" + ], "title": "InputModel", "type": "object" }, "output_schema": { "properties": { - "file_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "File path" + "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/ToyDatasetsPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/HttpRequestPiece" }, - "ToStringPiece": { - "name": "ToStringPiece", + "StringOperationsPiece": { + "name": "StringOperationsPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" @@ -1330,363 +1449,338 @@ "string" ], "style": { - "node_label": "To String", + "node_label": "String Operations", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "solar:text-bold", + "icon_class_name": "tabler:sort-a-z", "iconStyle": { "cursor": "pointer" } }, - "description": "A Piece that transforms any input to string.", + "description": "A Piece that performs string operations", "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" + "$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" }, - { - "format": "time", + "second_argument": { + "default": "", + "description": "Value for the second argument.", + "title": "Second Argument", "type": "string" }, - { - "format": "date-time", + "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" ], - "description": "Input value to be turned into string.", - "from_upstream": "always", - "title": "Input Value" + "title": "OperationItem", + "type": "object" + }, + "OperationsTypes": { + "enum": [ + "concatenate", + "lower_case", + "upper_case", + "split_by", + "replace_by", + "strip_spaces" + ], + "title": "OperationsTypes", + "type": "string" + } + }, + "properties": { + "first_argument": { + "description": "Value for the first argument.", + "title": "First Argument", + "type": "string" + }, + "operations": { + "description": "Sequence of operations to perform.", + "items": { + "$ref": "#/$defs/OperationItem" + }, + "title": "Operations", + "type": "array" } }, "required": [ - "input_value" + "first_argument", + "operations" ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "ToStringPiece Output Model", "properties": { - "output_value": { - "description": "Input value as a string.", - "title": "Output Value", + "output_string": { + "description": "Output string.", + "title": "Output String", "type": "string" } }, "required": [ - "output_value" + "output_string" ], "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/StringOperationsPiece" }, - "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." + "default": "csv", + "description": "Input data format to be converted." }, - "number_of_items": { - "default": 1, - "description": "Number of items to generate.", - "title": "Number Of Items", - "type": "integer" + "output_data_format": { + "allOf": [ + { + "$ref": "#/$defs/DataFormatOption" + } + ], + "default": "json", + "description": "Output data format." } }, + "required": [ + "input_data" + ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "LoremIpsumGeneratorPiece Output Model", "properties": { - "output_text": { - "description": "Generated text.", - "title": "Output Text", + "output_file_path": { + "description": "Path to the converted file.", + "title": "Output File Path", "type": "string" } }, "required": [ - "output_text" + "output_file_path" ], "title": "OutputModel", "type": "object" }, "secrets_schema": null, - "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/LoremIpsumGeneratorPiece" + "source_url": "https://github.com/Tauffer-Consulting/default_domino_pieces/tree/main/pieces/DataConversionPiece" }, - "GetItemFromArrayPiece": { - "name": "GetItemFromArrayPiece", + "YDataProfilingPiece": { + "name": "YDataProfilingPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "array" + "eda" ], "style": { - "node_label": "Get Item From Array", + "node_label": "Data Profiling", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "fluent:tray-item-remove-24-filled", + "icon_class_name": "mingcute:profile-line", "iconStyle": { "cursor": "pointer" } }, - "description": "Get one item from an input array.", + "description": "Piece that uses ydata-profiling to create fast EDA.", "input_schema": { - "$defs": { - "IndexType": { - "enum": [ - "first", - "last", - "random", - "another" - ], - "title": "IndexType", - "type": "string" - } - }, - "description": "GetItemFromArrayPiece Input Model", "properties": { - "input_array": { - "description": "Input array to get item from.", + "data_path": { + "description": "Path to the CSV file to be profiled", "from_upstream": "always", - "items": {}, - "title": "Input Array", - "type": "array" + "title": "CSV file path", + "type": "string" }, - "index": { - "allOf": [ + "report_tile": { + "anyOf": [ { - "$ref": "#/$defs/IndexType" + "type": "string" + }, + { + "type": "null" } ], - "default": "first", - "description": "Index of item to get from input array." - }, - "another_index": { - "default": 1, - "description": "Index number of item to get from input array.", - "minimum": 1, - "title": "Another Index", - "type": "integer" + "default": "Profiling Report", + "description": "Title of the report", + "title": "Report title" } }, "required": [ - "input_array" + "data_path" ], "title": "InputModel", "type": "object" }, "output_schema": { - "description": "GetItemFromArrayPiece Output Model", "properties": { - "output_value": { - "anyOf": [ - { - "type": "string" - }, - { - "items": {}, - "type": "array" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "object" - }, - { - "format": "date", - "type": "string" - }, - { - "format": "time", - "type": "string" - }, - { - "format": "date-time", - "type": "string" - } - ], - "description": "Item from input array at specified index.", - "title": "Output Value" + "profile_file_path": { + "description": "Path to the output file.", + "title": "Output file path", + "type": "string" } }, "required": [ - "output_value" + "profile_file_path" ], "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/YDataProfilingPiece" }, - "HttpRequestPiece": { - "name": "HttpRequestPiece", + "RenameTabularColumnsPiece": { + "name": "RenameTabularColumnsPiece", "dependency": { "dockerfile": null, "requirements_file": "requirements_0.txt" }, "tags": [ "default", - "http", - "request" + "pandas", + "dataframe" ], "style": { - "node_label": "HTTP Request", + "node_label": "Rename Tabular Columns", "node_type": "default", "node_style": { "backgroundColor": "#ebebeb" }, "useIcon": true, - "icon_class_name": "material-symbols:send", + "icon_class_name": "icon-park-twotone:data-file", "iconStyle": { "cursor": "pointer" } }, - "description": "Makes a HTTP request to a given URL.", + "description": "A piece that receives an dataframe and a dictionary with the columns to rename and returns the dataframe with the columns renamed.", "input_schema": { "$defs": { - "MethodTypes": { - "enum": [ - "GET", - "POST", - "PUT", - "DELETE" + "ColumnsToRename": { + "description": "ColumnsToRename Model", + "properties": { + "old_column_name": { + "title": "Old Column Name", + "type": "string" + }, + "new_column_name": { + "title": "New Column Name", + "type": "string" + } + }, + "required": [ + "old_column_name", + "new_column_name" ], - "title": "MethodTypes", - "type": "string" + "title": "ColumnsToRename", + "type": "object" } }, + "description": "GetDateTimePiece Input Model", "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", + "input_data": { + "description": "Input data.", + "title": "Input Data", "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" + "columns_to_rename": { + "description": "List of columns to rename.", + "items": { + "$ref": "#/$defs/ColumnsToRename" + }, + "title": "Columns to Rename", + "type": "array" } }, "required": [ - "url" + "input_data", + "columns_to_rename" ], "title": "InputModel", "type": "object" }, "output_schema": { + "description": "GetDateTimePiece Output Model", "properties": { - "base64_bytes_data": { - "description": "Output data as base64 encoded string.", - "title": "Base64 Bytes Data", + "output_data": { + "description": "Output data.", + "title": "Output Data", "type": "string" } }, "required": [ - "base64_bytes_data" + "output_data" ], "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/RenameTabularColumnsPiece" } } \ No newline at end of file diff --git a/.domino/dependencies_map.json b/.domino/dependencies_map.json index 0f97926..bfd20b9 100644 --- a/.domino/dependencies_map.json +++ b/.domino/dependencies_map.json @@ -5,24 +5,25 @@ "requirements_file": "requirements_0.txt" }, "pieces": [ - "SaveImagePiece", - "GetDateTimePiece", "CustomPythonPiece", - "LogPiece", + "GetItemFromArrayPiece", + "ToyDatasetsPiece", + "SaveImagePiece", "ImageFilterPiece", - "DataConversionPiece", - "YDataProfilingPiece", "StringConditionChecksPiece", + "LoremIpsumGeneratorPiece", + "ToStringPiece", + "GetDateTimePiece", + "LogPiece", "PageScrapperPiece", "SleepPiece", + "HttpRequestPiece", "StringOperationsPiece", - "ToyDatasetsPiece", - "ToStringPiece", - "LoremIpsumGeneratorPiece", - "GetItemFromArrayPiece", - "HttpRequestPiece" + "DataConversionPiece", + "YDataProfilingPiece", + "RenameTabularColumnsPiece" ], "secrets": [], - "source_image": "ghcr.io/tauffer-consulting/default_domino_pieces:0.8.1-group0" + "source_image": "ghcr.io/tauffer-consulting/default_domino_pieces:development-group0" } } \ No newline at end of file diff --git a/.github/workflows/tests-dev.yml b/.github/workflows/tests-dev.yml index bc8fab0..5f2d905 100644 --- a/.github/workflows/tests-dev.yml +++ b/.github/workflows/tests-dev.yml @@ -20,10 +20,15 @@ jobs: with: python-version: "3.10" - - name: Pip install packages + # - name: Pip install packages + # run: | + # python -m pip install -U pip + # pip install --no-cache-dir domino-py[cli] + # TODO remove + - name: Pip install from branch run: | python -m pip install -U pip - pip install --no-cache-dir domino-py[cli] + pip install git+https://github.com/Tauffer-Consulting/domino@dev#egg=domino-py[cli] - name: Login to GitHub Container Registry uses: docker/login-action@v2 @@ -37,7 +42,7 @@ jobs: - name: Run organize and build images run: | - domino piece organize --build-images --source-url=https://github.com/${{github.repository}} --tag-overwrite=development + domino piece organize --build-images --source-url=https://github.com/${{github.repository}} --tag-overwrite=development --dev - name: Install Tests Dependencies run: pip install -r requirements-tests.txt diff --git a/config.toml b/config.toml index a2aa597..9ae5ce4 100644 --- a/config.toml +++ b/config.toml @@ -5,4 +5,3 @@ REPOSITORY_NAME = "default_domino_pieces" REPOSITORY_LABEL = "Default Pieces Repository" VERSION = "0.8.1" - diff --git a/pieces/CustomPythonPiece/models.py b/pieces/CustomPythonPiece/models.py index 4db34e0..dec8484 100644 --- a/pieces/CustomPythonPiece/models.py +++ b/pieces/CustomPythonPiece/models.py @@ -36,7 +36,7 @@ class InputModel(BaseModel): } ) script: str = Field( - default="""# Do not modify the function definition line + default="""# Do not modify the function name in definition line def custom_function(kwarg_1, kwarg_2): # Write your code here print(f"First argument: {kwarg_1}") diff --git a/pieces/PageScrapperPiece/models.py b/pieces/PageScrapperPiece/models.py index f169810..951ef05 100644 --- a/pieces/PageScrapperPiece/models.py +++ b/pieces/PageScrapperPiece/models.py @@ -1,5 +1,5 @@ from pydantic import BaseModel, Field -from typing import List +from typing import List, Optional class ItemType(BaseModel): @@ -7,7 +7,7 @@ class ItemType(BaseModel): default="p", description='HTML tag name.', ) - class_name: str = Field( + class_name: Optional[str] = Field( default="", description='HTML tag class name.', ) diff --git a/pieces/RenameTabularColumnsPiece/metadata.json b/pieces/RenameTabularColumnsPiece/metadata.json new file mode 100644 index 0000000..fd733e4 --- /dev/null +++ b/pieces/RenameTabularColumnsPiece/metadata.json @@ -0,0 +1,16 @@ +{ + "name": "RenameTabularColumnsPiece", + "description": "A piece that receives an dataframe and a dictionary with the columns to rename and returns the dataframe with the columns renamed.", + "dependency": { + "requirements_file": "requirements_0.txt" + }, + "tags": [ + "default", + "pandas", + "dataframe" + ], + "style": { + "node_label": "Rename Tabular Columns", + "icon_class_name": "icon-park-twotone:data-file" + } +} \ No newline at end of file diff --git a/pieces/RenameTabularColumnsPiece/models.py b/pieces/RenameTabularColumnsPiece/models.py new file mode 100644 index 0000000..28f0ba5 --- /dev/null +++ b/pieces/RenameTabularColumnsPiece/models.py @@ -0,0 +1,35 @@ +from pydantic import BaseModel, Field +from typing import List + +class ColumnsToRename(BaseModel): + """ + ColumnsToRename Model + """ + old_column_name: str = Field( + title='Old Column Name', + ) + new_column_name: str = Field( + title='New Column Name', + ) + +class InputModel(BaseModel): + """ + GetDateTimePiece Input Model + """ + input_data: str = Field( + description='Input data.' + ) + + columns_to_rename: List[ColumnsToRename] = Field( + title='Columns to Rename', + description='List of columns to rename.' + ) + + +class OutputModel(BaseModel): + """ + GetDateTimePiece Output Model + """ + output_data: str = Field( + description='Output data.' + ) \ No newline at end of file diff --git a/pieces/RenameTabularColumnsPiece/piece.py b/pieces/RenameTabularColumnsPiece/piece.py new file mode 100644 index 0000000..0963939 --- /dev/null +++ b/pieces/RenameTabularColumnsPiece/piece.py @@ -0,0 +1,32 @@ +from domino.base_piece import BasePiece +from .models import InputModel, OutputModel +import pandas as pd +from pathlib import Path + + +class RenameTabularColumnsPiece(BasePiece): + + def piece_function(self, input_data: InputModel): + """ + GetDateTimePiece piece function. + """ + input_data_file = input_data.input_data + if input_data_file.endswith('.csv'): + df = pd.read_csv(input_data_file) + elif input_data_file.endswith('.json'): + df = pd.read_json(input_data_file) + else: + raise ValueError("File format not supported. Please pass a CSV or JSON file.") + + columns_to_rename = {} + for columns_data in input_data.columns_to_rename: + columns_to_rename[columns_data.old_column_name] = columns_data.new_column_name + + df.rename(columns=columns_to_rename, inplace=True) + + output_data_path = Path(self.results_path) / 'output_data.csv' + df.to_csv(output_data_path, index=False) + + return OutputModel(output_data=str(output_data_path)) + + \ No newline at end of file diff --git a/pieces/RenameTabularColumnsPiece/test_rename_columns_piece.py b/pieces/RenameTabularColumnsPiece/test_rename_columns_piece.py new file mode 100644 index 0000000..51da940 --- /dev/null +++ b/pieces/RenameTabularColumnsPiece/test_rename_columns_piece.py @@ -0,0 +1,8 @@ +from domino.testing import piece_dry_run + + + + +def test_rename_columns_piece(): + ... +