Function Repository Resource:

UUIDPythonObjectConfiguration

Source Notebook

Configure a Python object for the UUID package

Contributed by: Wolfram Staff

ResourceFunction["UUIDPythonObjectConfiguration"]["Configuration"]

returns a possible configuaration for the resource function PythonObject.

Details

A resource function "rf" that defines a configuration for a Python package "pkg" object created with the resource function PythonObject is expected to be applied as PythonObject["pkg","Configuration"ResourceFunction["rf"]].
PythonObject["uuid","Configuration"ResourceFunction["rf"]] specifies that objects in the Python UUID class should be returned as strings.

Examples

Basic Examples (2) 

With no configuration, Python's uuid4() function in the resource function PythonObject returns an instance of the UUID class:

In[1]:=
p = ResourceFunction["PythonObject"]["uuid.uuid4", "Configuration" -> None]
Out[1]=
In[2]:=
p[All][]
Out[2]=

Configure the resource function PythonObject to give a String instead:

In[3]:=
p = ResourceFunction["PythonObject"]["uuid.uuid4", "Configuration" -> ResourceFunction["UUIDPythonObjectConfiguration"]
   ]
Out[3]=
In[4]:=
p[All][]
Out[4]=

Version History

  • 1.0.1 – 08 March 2022
  • 1.0.0 – 23 November 2021

Related Resources

License Information