Wolfram Research

Function Repository Resource:

CloudResourceFunction

Source Notebook

Access functions deployed to your own or another user’s Wolfram Cloud account that are not in the official function repository

Contributed by: Katja Della Libera

ResourceFunction["CloudResourceFunction"]["name"]

gets a resource function name from your personal cloud account.

ResourceFunction["CloudResourceFunction"]["/path"]

gets a function from your personal cloud at a given path.

ResourceFunction["CloudResourceFunction"]["uri"]

gets a function from a specified uri.

ResourceFunction["CloudResourceFunction"][{"user","name"}]

gets function name deployed by the specified user.

ResourceFunction["CloudResourceFunction"][{"user","/path"}]

gets a resource function deployed by user and speciefied by file path.

Details and Options

When the function is specified with "name", ResourceFunction["CloudResourceFunction"] attempts to retrieve the function from the default deployment path used by the function resource definition notebook. For functions deployed using CloudDeploy the path or URI is needed.

Examples

Basic Examples

Retrieve a function deployed to your cloud:

In[1]:=
rt = ResourceFunction["CloudResourceFunction"]["RainbowText"]
Out[1]=

Use the function:

In[2]:=
rt["rainbows are awesome"]
Out[2]=

Scope

Use a URL of your own or another user’s function to retrieve it:

In[3]:=
ResourceFunction[
 "CloudResourceFunction"]["https://www.wolframcloud.com/objects/\
documentation/DeployedResources/Function/RainbowText"]
Out[3]=

Use the Wolfram user account and name of the function instead:

In[4]:=
ResourceFunction[
 "CloudResourceFunction"][{"documentation@wolfram.com", "RainbowText"}]
Out[4]=

Use the username and file path:

In[5]:=
ResourceFunction[
 "CloudResourceFunction"][{"documentation@wolfram.com", "/DeployedResources/Function/RainbowText"}]
Out[5]=

Properties and Relations

CloudResourceFunction retrieves new definitions every time it is called:

In[6]:=
AbsoluteTiming[
 ResourceFunction["CloudResourceFunction"]["RainbowText"][
  "abcdefghi"]]
Out[6]=
In[7]:=
AbsoluteTiming[
 ResourceFunction["CloudResourceFunction"]["RainbowText"][
  "jklmnopqr"]]
Out[7]=

Assign the function to a symbol for faster performance:

In[8]:=
rainbowText = ResourceFunction["CloudResourceFunction"]["RainbowText"];
AbsoluteTiming[rainbowText["this is a faster function now"]]
Out[9]=

Possible Issues

A cloud connection is required to use the function, which can be easily done with CloudConnect:

In[10]:=
CloudDisconnect[];
ResourceFunction["CloudResourceFunction"]["RainbowFunction"]
Out[11]=
In[12]:=
CloudConnect[]
Out[12]=
In[13]:=
ResourceFunction[
 "CloudResourceFunction"]["https://www.wolframcloud.com/objects/\
documentation/DeployedResources/Function/RainbowText"]
Out[13]=

To access a function in another users account, the permissions need to be given to your cloud account, which can only be done by the person who deployed the function:

In[14]:=
ResourceFunction[
 "CloudResourceFunction"][{"documentation@wolfram.com", "PrivateFunction"}]
Out[14]=

Resource History

See Also

License Information