---
title: "ResourceFunction"
language: "en"
type: "Symbol"
summary: "ResourceFunction[resource] represents the function associated with the specified resource. ResourceFunction[resource, prop] gives the specified property of the resource."
keywords: 
- Function
- Resource Function
- Extensions
- Function Repository
canonical_url: "https://reference.wolfram.com/language/ref/ResourceFunction.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Package Development"
    link: "https://reference.wolfram.com/language/guide/PackageDevelopment.en.md"
  - 
    title: "Wolfram Function Repository"
    link: "https://reference.wolfram.com/language/guide/WolframFunctionRepository.en.md"
  - 
    title: "Wolfram Resource System"
    link: "https://reference.wolfram.com/language/guide/WolframResourceSystem.en.md"
related_functions: 
  - 
    title: "DefineResourceFunction"
    link: "https://reference.wolfram.com/language/ref/DefineResourceFunction.en.md"
  - 
    title: "ResourceObject"
    link: "https://reference.wolfram.com/language/ref/ResourceObject.en.md"
  - 
    title: "ResourceData"
    link: "https://reference.wolfram.com/language/ref/ResourceData.en.md"
  - 
    title: "Function"
    link: "https://reference.wolfram.com/language/ref/Function.en.md"
  - 
    title: "NetModel"
    link: "https://reference.wolfram.com/language/ref/NetModel.en.md"
---
[EXPERIMENTAL]

# ResourceFunction   Wolfram Function Repository »

ResourceFunction[resource] represents the function associated with the specified resource.

ResourceFunction[resource, prop] gives the specified property of the resource.

## Details and Options

* ``ResourceFunction["name"]`` searches in order for a resource function with the specified name in the following locations:

|                                                                             |
| --------------------------------------------------------------------------- |
| locally in the session (for resource functions from DefineResourceFunction) |
| at the locations specified by \$PersistencePath                             |
| in the Wolfram Function Repository                                          |

* In ``ResourceFunction[resource]``, ``resource`` can have the following forms:

|                   |                                                             |
| ----------------- | ----------------------------------------------------------- |
| "name"            | function name, resolved as described                        |
| ResourceObject[…] | a resource object of type "Function" stored at any location |
| CloudObject[…]    | a cloud object containing a function resource object        |
| LocalObject[…]    | a local object containing a function resource object        |

* ``ResourceFunction[resource][args …]`` applies the function to the given arguments.

* The available properties are given by ``ResourceFunction[resource, "Properties"]`` and typically include properties of the ``ResourceObject`` as well as:

|                     |                                                         |
| ------------------- | ------------------------------------------------------- |
| "SymbolName"        | fully qualified string name of the underlying function  |
| "FunctionLocation"  | file, object or method used to store the definition     |
| "DocumentationLink" | URL for documentation of a published function           |

* ``ResourceFunction`` accepts the following options:

|                     |                      |                                           |
| ------------------- | -------------------- | ----------------------------------------- |
| ResourceSystemPath  | \$ResourceSystemPath | where to look for a function              |
| ResourceVersion     | Automatic            | version to select of a published resource |

* Function definitions in a function resource are typically not explicitly retrieved until the function is used.

* When the definitions for a function resource are retrieved, they are usually cached in ``\$LocalBase``.

* ``ResourceObject[ResourceFunction[…]]`` returns the resource object containing the given function.

* ``ResourceFunction[ResourceFunction[…], prop]`` gives a property for an existing resource function.

* ``CloudDeploy[ResourceFunction[…]]`` or ``CloudPublish[ResourceFunction[…]]`` saves a resource function in the cloud.

* ``LocalCache[ResourceFunction[…]]`` saves a resource function as a ``LocalObject[…]``.

* The following functions work on ``ResourceFunction`` objects: ``Attributes``, ``Definition``, ``DownValues``, ``FullDefinition``, ``Options`` and ``SymbolName``.

* New resource functions can be defined with ``DefineResourceFunction`` or with a definition notebook from File ▶ New ▶ Repository Item ▶ Function Repository Item.

---

## Examples (19)

### Basic Examples (5)

Get a resource function using its name:

```wl
In[1]:= ResourceFunction["NestedLookup"]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "NestedLookup", 
   "ShortName" -> "NestedLookup", "UUID" -> "27744439-50d3-4003-9996-278282091cf7", 
   "ResourceType" -> "Function", "Version" -> "1.0.0", 
   "Description" -> 
    "Lookup a s ... 6177d4107869cb5c5f6d20bf3`NestedLookup", 
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/objects/a3fc4cdf-12b6-48a5-b385-12e52c08a9bb"]], 
  {ResourceSystemBase -> "https://www.wolframcloud.com/objects/rsdevel/api/1.0"}]]
```

Apply the resource function to arguments:

```wl
In[2]:= ResourceFunction["NestedLookup"][<|"Flintstones" -> <|"Fred" -> <|"Job" -> "Bronto crane Operator"|>, "Wilma" -> <|"Job" -> "Cavemaker"|>, "Pebbles" -> <|"Job" -> "Child"|>|>|>, {"Flintstones", "Fred", "Job"}]

Out[2]= "Bronto crane Operator"
```

---

Apply a function from a ``ResourceObject`` to a value:

```wl
In[1]:=
ResourceFunction[ResourceObject[Association["Name" -> "GrayCode", "UUID" -> "392603a7-1e9d-46d3-8532-bf09565c732a", 
  "ResourceType" -> "Function", "Version" -> "1.0.0", 
  "Description" -> "Find the Gray code for an integer", "RepositoryLocation" -> 
   URL["http ... nctionRepository`$f2402e26e61b4c54b73496fc57b6504d`GrayCode", 
  "FunctionLocation" -> CloudObject[
    "https://www.wolframcloud.com/objects/0050708c-82d0-490c-b9a9-2c5e6b23a00b"], 
  "ShortName" -> "GrayCode"], {ResourceSystemBase -> Automatic}]][100]

Out[1]= {1, 0, 1, 0, 1, 1, 0}
```

---

Find properties of a resource function:

```wl
In[1]:= ResourceFunction["MoveMouse", "Description"]

Out[1]= "Move the mouse cursor to a specified location"
```

---

Get the web documentation URL for a published function:

```wl
In[1]:= ResourceFunction["MultiNonlinearModelFit", "DocumentationLink"]

Out[1]= URL["https://resources.wolframcloud.com/FunctionRepository/resources/MultiNonlinearModelFit"]
```

---

Create a resource function from an ``Association`` :

```wl
In[1]:= rf = ResourceFunction[<|"Name" -> "Half Squared", "Function" -> ((# / 2) ^ 2&), "ResourceType" -> "Function"|>]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "HalfSquared", "ShortName" -> "HalfSquared", 
   "UUID" -> "6dbb361d-56ce-476a-b1b0-7a5c276aec23", "ResourceType" -> "Function", 
   "Version" -> None, "SymbolName" -> 
    "FunctionRepository`$6dbb361d56ce476ab1b07a5c276aec23`HalfSquared", 
   "FunctionLocation" -> None]]]

In[2]:= rf[20]

Out[2]= 100
```

### Scope (7)

Use the two-argument from of ``ResourceFunction`` to retrieve properties:

```wl
In[1]:= ResourceFunction["PerpendicularSurface", "Description"]

Out[1]= "Compute the perpendicular surface of a curve"
```

---

Get a list of properties:

```wl
In[1]:= ResourceFunction["BirdSay", "Properties"]

Out[1]= {"AllVersions", "AutoUpdate", "Categories", "ContributorInformation", "Definition", "DefinitionNotebook", "DefinitionNotebookObject", "Description", "Details", "Documentation", "DocumentationLink", "DocumentationNotebook", "DownloadedVersion", "Exa ... tions", "ResourceObject", "ResourceType", "SeeAlso", "ShortName", "SourceMetadata", "Symbol", "SymbolName", "TestReport", "Usage", "UUID", "VerificationTests", "Version", "VersionInformation", "VersionsAvailable", "WolframLanguageVersionRequired"}
```

---

Obtain information on a resource function:

```wl
In[1]:= Information[ResourceFunction["BirdSay"]]

Out[1]=
InformationData[Association["Name" -> "BirdSay", "Description" -> "Have a bird say an expression", 
  "Usage" -> "\!\(\*StyleBox[RowBox[{StyleBox[RowBox[{StyleBox[\"ResourceFunction\", \
\"ResourceFunctionSymbol\"], \"[\", StyleBox[\"\\\"BirdSay\\\ ...  "Version" -> "3.0.0", "RepositoryLocation" -> 
   URL["https://www.wolframcloud.com/objects/resourcesystem/api/1.0"], 
  "SymbolName" -> "FunctionRepository`$55711938e45341c08ca516066b27f30c`BirdSay", 
  "ObjectType" -> "ResourceFunction"], True]
```

---

View basic usage:

```wl
In[1]:= ResourceFunction["BirdSay", "Usage"]

Out[1]= ResourceFunction[BirdSay][thing] ask a cool bird to say Cell[BoxData[thing], InlineFormula, FontFamily -> Source Sans Pro].ResourceFunction[BirdSay][thing, pos] positions the bird according to the position specified by Cell[BoxData[pos], InlineFormula, FontFamily -> Source Sans Pro].
```

---

Run all verification tests defined for a resource function to generate a ``TestReportObject`` :

```wl
In[1]:= ResourceFunction["UUIDQ", "TestReport"]

Out[1]=
TestReportObject[Association["TestResults" -> 
   Association[1 -> TestResultObject[Association["TestClass" -> None, "TestIndex" -> 1, 
       "TestID" -> "UUIDQ-0001", "Outcome" -> "Success", 
       "Input" -> HoldForm[ResourceFunction[ResourceOb ... 537582268, "Seconds"], "TestsSucceededCount" -> 7, 
  "TestsFailedCount" -> 0, "TestsFailedWrongResultsCount" -> 0, 
  "TestsFailedWithMessagesCount" -> 0, "TestsFailedWithErrorsCount" -> 0, "Aborted" -> False, 
  "Title" -> "Test Report: UUIDQ"]]
```

A ``Missing`` object is returned for resource functions that do not have defined tests:

```wl
In[2]:= ResourceFunction["BirdSay", "TestReport"]

Out[2]= Missing["NotAvailable"]
```

---

See all the tests defined for a resource function in a testing notebook:

```wl
In[1]:= ResourceFunction["UUIDQ", "TestNotebook"]

Out[1]= NotebookObject["3fd3a85d-aac2-46af-93e3-1495f9c318cc"]
```

---

See when a resource function was first published to the Wolfram Function Repository:

```wl
In[1]:= ResourceFunction["GrayCode", "ReleaseDate"]

Out[1]= DateObject[{2018, 8, 15}, "Day", "Gregorian", -5.]
```

Get the date of the most recent update:

```wl
In[2]:= ResourceFunction["GrayCode", "LatestUpdate"]

Out[2]= DateObject[{2020, 2, 3}, "Day", "Gregorian", -6.]
```

Get a list of available versions:

```wl
In[3]:= ResourceFunction["GrayCode", "VersionsAvailable"]

Out[3]= {"2.0.0", "1.0.0"}
```

### Options (3)

#### ResourceSystemPath (2)

Use ``ResourceSystemPath`` to limit the result to only find functions published in the function repository:

```wl
In[1]:= ResourceFunction["InspectNotebook", ResourceSystemPath -> {URL["https://resources.wolframcloud.com"]}]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "InspectNotebook", 
   "ShortName" -> "InspectNotebook", "UUID" -> "4a949b70-c901-41f9-ad12-9a5ce79f67f6", 
   "ResourceType" -> "Function", "Version" -> "1.0.0", 
   "Description" -> "Launch a  ... d844f70b573b89dcd0025a3`InspectNotebook", 
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/788bdbd2-c78c-49bb-b59f-9d501027681d"]], 
  {ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"}]]
```

---

Create a new resource function with the same name as a deployed function:

```wl
In[1]:= DefineResourceFunction["A bird said: " <> #&, "BirdSay"]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "BirdSay", "ShortName" -> "BirdSay", 
   "ResourceType" -> "Function", "UUID" -> "b54d097e-595d-460c-9040-3fb06c00f14f", 
   "FunctionLocation" -> None, "SymbolName" -> 
    "FunctionRepository`$b54d097e595d460c90403fb06c00f14f`BirdSay", "Version" -> None]]]
```

Use ``ResourceSystemPath`` to ensure this resource is found:

```wl
In[2]:= myrf = ResourceFunction["BirdSay", ResourceSystemPath -> {PersistenceLocation["KernelSession"]}]

Out[2]=
ResourceFunction[ResourceObject[Association["Name" -> "BirdSay", "ShortName" -> "BirdSay", 
   "UUID" -> "b54d097e-595d-460c-9040-3fb06c00f14f", "ResourceType" -> "Function", 
   "Version" -> None, "SymbolName" -> 
    "FunctionRepository`$b54d097e595d460c90403fb06c00f14f`BirdSay", "FunctionLocation" -> None], 
  ResourceSystemBase -> Automatic, ResourceSystemPath -> 
   {PersistenceLocation["KernelSession", Hold[Persistence`Data`$kernelStore], 
     Hold[Persistence`Data`a20810188790656466735$9]]}]]

In[3]:= myrf["Chirp"]

Out[3]= "A bird said: Chirp"
```

Instead, find the published function:

```wl
In[4]:= publicrf = ResourceFunction["BirdSay", ResourceSystemPath -> {URL["https://resources.wolframcloud.com"]}]

Out[4]=
ResourceFunction[ResourceObject[Association["Name" -> "BirdSay", "ShortName" -> "BirdSay", 
   "UUID" -> "a24858c8-45c5-4020-a8c2-c23bd5d26f04", "ResourceType" -> "Function", 
   "Version" -> "3.0.0", "Description" -> "Have a bird say an expression ... 5711938e45341c08ca516066b27f30c`BirdSay", 
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/9d5d3776-baed-4a5d-bf38-e857d53825e1"]], 
  {ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"}]]

In[5]:= publicrf["Tweet"]

Out[5]= "Tweet"
```

#### ResourceVersion (1)

Get two versions of the same resource from the function repository using ``ResourceVersion`` :

```wl
In[1]:= new = ResourceFunction["EasterSunday", ResourceVersion -> "3.0.0"]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "EasterSunday", 
   "ShortName" -> "EasterSunday", "UUID" -> "21b5a586-e091-465c-bc04-56691a679d8c", 
   "ResourceType" -> "Function", "Version" -> "3.0.0", 
   "Description" -> "Find the date o ... onRepository`$0d6f71d9816d49fda8dba2c6e0859964`EasterSunday", 
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/130dea84-85b8-43ab-9c4e-6ecf0cb45898"]], 
  {ResourceSystemBase -> Automatic, ResourceVersion -> "3.0.0"}]]

In[2]:= old = ResourceFunction["EasterSunday", ResourceVersion -> "2.0.0"]

Out[2]=
ResourceFunction[ResourceObject[Association["Name" -> "EasterSunday", 
   "ShortName" -> "EasterSunday", "UUID" -> "21b5a586-e091-465c-bc04-56691a679d8c", 
   "ResourceType" -> "Function", "Version" -> "2.0.0", 
   "Description" -> "Find the date o ... onRepository`$b990cec17cb04d1883dac878b6202613`EasterSunday", 
   "FunctionLocation" -> CloudObject[
     "https://www.wolframcloud.com/obj/9bc5e344-db63-4e75-9ed4-259b7f02f8cb"]], 
  {ResourceSystemBase -> Automatic, ResourceVersion -> "2.0.0"}]]
```

Only the newer version supports a zero-argument form:

```wl
In[3]:= new[]

Out[3]= DateObject[{2021, 4, 4}, "Day", "Gregorian", -5.]

In[4]:= old[]

Out[4]= DateObject[Calendar`EasterSunday[]]
```

### Properties & Relations (3)

The two-argument form of ``ResourceFunction`` provides the same values as ``ResourceObject`` :

```wl
In[1]:= ResourceFunction["GrayCode", "Description"]

Out[1]= "Find the Gray code for an integer"

In[2]:= ResourceObject["GrayCode"]["Description"]

Out[2]= "Find the Gray code for an integer"
```

---

The underlying symbol belonging to a ``ResourceFunction`` can be obtained using the ``"Function"`` property:

```wl
In[1]:= grayCode = ResourceFunction["GrayCode", "Function"]

Out[1]= ResourceFunction["GrayCode"]

In[2]:= grayCode//InputForm
```

Out[2]//InputForm= FunctionRepository\`\$1a1ff62303064af1aaf07893e973be41\`GrayCode

Using the symbol directly can often be faster:

```wl
In[3]:= RepeatedTiming[grayCode[25]]

Out[3]= {8.94525146484375`*^-6, {1, 0, 1, 0, 1}}

In[4]:= RepeatedTiming[ResourceFunction["GrayCode"][25]]

Out[4]= {0.000569236, {1, 0, 1, 0, 1}}
```

---

Many functions that work on symbols also work on resource functions, for example, ``DownValues`` :

```wl
In[1]:= DownValues[ResourceFunction["RankedTimeSeriesBarChart"]]

Out[1]= {HoldPattern[ResourceFunction["RankedTimeSeriesBarChart"][FunctionRepository`$6abac87e11e24d958c36a6eea062cabe`args___]] :> Catch[FunctionRepository`$6abac87e11e24d958c36a6eea062cabe`rankedTimeseriesBarchart[FunctionRepository`$6abac87e11e24d958c36a6eea062cabe`args], "rtbc"]}
```

And ``Attributes`` :

```wl
In[2]:= Attributes[ResourceFunction["TraceInteractive"]]

Out[2]= {HoldFirst}
```

And ``Options`` :

```wl
In[3]:= Options[ResourceFunction["MonitoredDownload"]]

Out[3]= {OverwriteTarget -> False, "FinishedDownloadHandler" -> None, "OpenWhenFinished" -> False, Authentication -> Automatic, CharacterEncoding -> Automatic, CookieFunction -> Automatic, FollowRedirects -> True, Interactive -> False, TimeConstraint -> ∞, ... e, "IncludePlot" -> False, "ExpectedFileHash" -> None, "DeleteOnHashFailure" -> False, "KeepPanelOpen" -> False, "ShowPanel" -> True, Asynchronous -> True, "ConnectionSettings" -> <|"MaxUploadSpeed" -> Automatic, "MaxDownloadSpeed" -> Automatic|>}
```

### Possible Issues (1)

Resource functions that have holding attributes will only hold arguments if ``ResourceFunction[…]`` is explicitly used as the head:

```wl
In[1]:=
SetAttributes[myHold, HoldFirst];
rf = DefineResourceFunction[myHold]

Out[1]=
ResourceFunction[ResourceObject[Association["Name" -> "myHold", "ShortName" -> "myHold", 
   "SymbolName" -> "FunctionRepository`$3e2ace5ed1264d908cf92e630fa2161d`myHold", 
   "ResourceType" -> "Function", "UUID" -> "3e2ace5e-d126-4d90-8cf9-2e630fa2161d", 
   "FunctionLocation" -> None, "Version" -> None]]]

In[2]:= rf[1 + 1]

Out[2]= ResourceFunction["myHold"][2]
```

Use ``ResourceFunction[…][…]`` instead to ensure attributes will work:

```wl
In[3]:= ResourceFunction["myHold"][1 + 1]

Out[3]= ResourceFunction["myHold"][1 + 1]
```

Using the formatted form will also work:

```wl
In[4]:= ResourceFunction["myHold"][1 + 1]

Out[4]= ResourceFunction["myHold"][1 + 1]
```

Alternatively, set the symbol to the underlying function instead:

```wl
In[5]:= func = ResourceFunction["myHold", "Function"]

Out[5]= ResourceFunction["myHold"]

In[6]:= func[1 + 1]

Out[6]= ResourceFunction["myHold"][1 + 1]
```

## See Also

* [`DefineResourceFunction`](https://reference.wolfram.com/language/ref/DefineResourceFunction.en.md)
* [`ResourceObject`](https://reference.wolfram.com/language/ref/ResourceObject.en.md)
* [`ResourceData`](https://reference.wolfram.com/language/ref/ResourceData.en.md)
* [`Function`](https://reference.wolfram.com/language/ref/Function.en.md)
* [`NetModel`](https://reference.wolfram.com/language/ref/NetModel.en.md)

## Related Guides

* [Package Development](https://reference.wolfram.com/language/guide/PackageDevelopment.en.md)
* [Wolfram Function Repository](https://reference.wolfram.com/language/guide/WolframFunctionRepository.en.md)
* [Wolfram Resource System](https://reference.wolfram.com/language/guide/WolframResourceSystem.en.md)

## Related Links

* [Wolfram Data Repository](http://datarepository.wolframcloud.com)

## History

* [Introduced in 2019 (12.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn120.en.md)