Wolfram Research

Function Repository Resource:

UUIDPythonObjectConfiguration (1.0.0) current version: 1.0.1 »

Source Notebook

Configure a Python object for the UUID package

Contributed by: Wolfram Staff

ResourceFunction["UUIDPythonObjectConfiguration"][]

returns a possible configuaration for PythonObject["uuid"].

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 ResourceFunction["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 ResourceFunction["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