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 specified 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 (2) 

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 (3) 

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 (2) 

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[8]=

Possible Issues (2) 

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

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

To access a function in another user's account, the permissions need to be given to your cloud account. This can only be done by the person who deployed the function:

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

Version History

  • 1.0.0 – 15 July 2019

Related Resources

License Information