Added Pandas at, iat getter and setter nodes.

This commit is contained in:
HowToSD
2025-03-05 18:25:21 -08:00
parent ed1cef099e
commit be88fd6caa
75 changed files with 2826 additions and 47 deletions
+43
View File
@@ -0,0 +1,43 @@
from typing import Any, Dict
from datetime import datetime
class PyDatetimeToString:
"""
Converts a Python datetime.datetime value to a Python string
Refer to [the Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) for date/time format strings.
category: Python wrapper
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the input types for the `create` function.
Returns:
Dict[str, Any]: A dictionary specifying required input types.
"""
return {
"required": {
"value": ("PYDATETIME", {}),
"date_format": ("STRING", {"default":"%Y-%m-%d %H:%M:%S", "multiline": False}),
}
}
RETURN_TYPES: tuple = ("STRING",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, value: datetime, date_format: str) -> tuple:
"""
Converts a Python datetime.datetime value to a Python string
Args:
value (str): String value to convert.
Returns:
tuple: A tuple containing the converted value.
"""
return (datetime.strftime(value, date_format),)