A piece of python code that can transform data, generate plots or train ML models.
Attributes
| Name | Type | Description |
|---|---|---|
| script_id | uuid.UUID | technical id of the script. |
| name | str | unique name of the script function (unique key within its type). |
| description | str | human-readable description of what the script does. |
| script_type | ScriptType | type of script execution (api, raw, module, wizata). |
| version | str | version string of the script. |
| library | str | key of the ScriptLibrary this script belongs to (module type only). |
| module | str | Python import path for import_module() (module type only, e.g. 'my_lib.transforms'). |
| function | callable | the function as a callable object (not serialized). |
| source | str | python source code of the script (not serialized). |
Methods
api_id()
Id of the script (script_id)
return: string formatted UUID of the script.
api_key()
return current object logical unique key (e.g. hardware_id, key, name).
returns None if the entity has no logical key.
copy()
Copy your function code and decorators to a format executable by the Wizata App.
| Name | Type | Default | Description |
|---|---|---|---|
| myfunction | your function - pass the function itself as parameter |
endpoint()
Name of the endpoints used to manipulate scripts.
return: Endpoint name.
from_json()
Load the Script entity from a dict.
Handles both new format and legacy backend format.
| Name | Type | Default | Description |
|---|---|---|---|
| obj | Dict version of the Script. |
load_function_from_dill()
Deserialize dill bytes into a Function object.
Handles both new format (Function only) and old format (entire Script).
| Name | Type | Default | Description |
|---|---|---|---|
| pkl_bytes | raw dill-serialized bytes. | ||
| return: Function object (or whatever was stored if not a Script). |
set_id()
specify the id_value neutrally
| Name | Type | Default | Description |
|---|---|---|---|
| id_value | |||
| return: |
to_dict()
Serialize Script to a clean dict.
to_json()
Convert the script to a dictionary compatible to JSON format.
| Name | Type | Default | Description |
|---|---|---|---|
| target | str | None |