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]=
Image

Use the function:

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

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]=
Image

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

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

Use the username and file path:

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

Properties and Relations (2) 

CloudResourceFunction retrieves new definitions every time it is called:

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

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]=
Image

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]=
Image
In[10]:=
CloudConnect[]
Out[10]=
Image
In[11]:=
ResourceFunction[
 "CloudResourceFunction"]["https://www.wolframcloud.com/objects/documentation/DeployedResources/Function/RainbowText"]
Out[11]=
Image

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"}]
Image
Out[12]=
Image

Version History

  • 1.0.0 – 15 July 2019

Related Resources

License Information