Getting Started Using the Wolfram Language Paclet Repository
The Wolfram Language Paclet Repository is a growing collection of community-contributed paclets that users can install and use on their own systems. We encourage submissions of all kinds, with only a few guidelines that we ask to be followed.
This document is a quick-start guide for those who simply want to use paclets from the Wolfram Language Paclet Repository; a separate document provides a quick start for those who want to contribute their own paclets.
Paclets are units of Wolfram functionality, packaged up in a way that allows them to be discovered, installed, updated and integrated seamlessly into the Wolfram environment. Paclets can contain many types of content, including Wolfram Language files, LibraryLink libraries, front end resources like palettes and stylesheets, documentation notebooks, etc. Documentation for paclet-related functions can be found here and a detailed reference for paclet developers is here.
Version 12.1 or Later Is Required
The Wolfram Language Paclet Repository is intended for use with the Wolfram System 12.1 and later. Some paclets might be compatible with earlier versions, but the functions described here for using the Paclet Repository will only work in Version 12.1 and later. This functionality also works in the Wolfram Cloud, although individual paclets might have features that do not work in the cloud.
Browsing and Finding Paclets
The Wolfram Language Paclet Repository lets you browse all paclets, browse by functional category, see the current Featured paclets as selected by Wolfram staff and search by name, publisher ID, keyword, etc. Each paclet has a description and some documentation on its front page, and will typically have additional documentation like tutorials, guide pages and function reference pages that can be viewed as well. Those documentation pages will appear in the in-product documentation viewer after the paclet is installed.
Finding Paclets from within the Wolfram Language
PacletFindRemote is the function that finds paclets available for download on known paclet sites.
For example, this finds all paclets with “Mockingbird” in their name:
In[]:=
PacletFindRemote["*Mockingbird*"]
Out[]=
PacletObject
Name:Wolfram/Mockingbird
Version:1.0.0
You don’t have to use PacletFindRemote to search for paclets in this way, but it can be a convenient way of searching programmatically. Because the Paclet Repository is integrated into the Resource System framework, you can also use ResourceSearch to find paclets. This searches for all paclets in the Paclet Repository with the publisher ID of “Wolfram”:
ResourceSearch can search across all Wolfram Repositories (Function Repository, Data Repository, Neural Net Repository, Paclet Repository, etc.) and provides advanced searching capabilities.
Installing Paclets
To install a paclet on your own system, simply call PacletInstall, supplying the name of the paclet. Note that the full name of a Paclet Repository paclet begins with the publisher ID:
In[]:=
PacletInstall["Wolfram/Mockingbird"]
Out[]=
PacletObject
Name:Wolfram/Mockingbird
Version:1.0.0
You can get a click-to-copy version of this command from each paclet’s front page.
You normally don’t need to be concerned with details like the precise directory location of the installed paclet, but do not mistake the “/” in a paclet name to be equivalent to a path separator in a file system. In paclet names, “/” is just a special character that separates the publisher ID from the rest of the name.
You can also install a paclet via a ResourceObject specification. When you use a ResourceObject to identify a paclet, you engage a potentially different or larger set of locations from which the paclet can be obtained (see the ResourceSystemPath option):
Once a paclet has been installed, it is ready for use.
It is also possible to install a paclet in a “temporary” way, meaning that it is only visible in the current session. See the PacletSymbol section below for more information on this feature.
Using Paclets
Loading the Paclet’s Code
Once a paclet has been installed with PacletInstall, it is ready for use in the current session and all future sessions. Installing a paclet “wires” it into the system so that Wolfram Language functions that look for files within the paclet automatically succeed and resources like palettes and documentation pages automatically show up where expected. The paclet’s Wolfram Language code is just made available and is not loaded; load it with Needs like any other package.
The Wolfram/Mockingbird paclet was installed earlier, so to use its functions, load its main context:
Needs["Wolfram`Mockingbird`"]
Note that a Paclet Repository paclet’s main context is, by convention, derived directly from the paclet’s name in this way.
Managing Name Conflicts
When you call Needs to load a context, the system puts the named context on $ContextPath, which makes the functions within that context visible in your session without you having to type the full context prefix for each symbol. This leads to a big soup of visible functions in your session, and conflicts can occur if two contexts declare a symbol of the same name (we say that one symbol “shadows” the other, effectively making it invisible). This problem is generally rare because so much of the Wolfram ecosystem is provided by Wolfram Research itself and function names are carefully curated to avoid conflicts. With the growth of the community-contributed Paclet Repository, it is expected that function name conflicts will become much more common.
Starting in Version 13 of the Wolfram System, there is a new feature called Context Aliasing, which solves this problem by letting you designate a short “alias” for a long context so that you can enter function names unambiguously without having to type a long context prefix. This declares that “mb`” is an alias for the “Wolfram`Mockingbird`” context:
In[]:=
$ContextAliases["mb`"]="Wolfram`Mockingbird`";
Now when you type mb`MockEvaluate, it expands automatically to the full, unambiguous Wolfram`Mockingbird`MockEvaluate:
In[]:=
mb`MockEvaluate
Out[]=
Wolfram`Mockingbird`MockEvaluate
The real usefulness of context aliasing comes with a new syntax for Needs:
Needs["Wolfram`Mockingbird`"->"mb`"]
This behaves like the usual Needs function, with two important differences: it establishes a context alias of mb` for Wolfram`Mockingbird` and it does not put Wolfram`Mockingbird` on $ContextPath. Because Wolfram`Mockingbird` is not on $ContextPath, you cannot use undecorated names to refer to its functions. You either use the mb` alias or the full context. This provides the best possible isolation of functions from one paclet and any other paclet. It is highly recommended to use this new syntax for Needs when loading contexts from paclets and to get used to typing short aliases when entering function names.
Another solution to the name-conflict problem is provided by the PacletSymbol function, described next.
The PacletSymbol Function
The PacletSymbol function was introduced in Version 13.0 of the Wolfram System, but has been made available in Version 12.1 and later (via an automatic paclet update, of course!). It encapsulates a number of useful operations into a single function call. Let’s say that you want to try the CodeEquivalentQ function from the Wolfram/CodeEquivalenceUtilities paclet. You can simply write this:
The expression PacletSymbol[“Wolfram/CodeEquivalenceUtilities”, ”CodeEquivalentQ”] evaluates to the symbol Wolfram`CodeEquivalenceUtilities`CodeEquivalentQ, and along the way it does two other things:
◼
It installs the Wolfram/CodeEquivalenceUtilities paclet, but in a special way that makes it only visible in the current session.
◼
It calls Needs on the Wolfram`CodeEquivalenceUtilities` context, but in such a way that it does not put it on $ContextPath.
One way to think about PacletSymbol is as a way to sample the functionality of a paclet in the least-invasive way possible. It won’t permanently install the paclet and it won’t clutter up your $ContextPath with the paclet’s context. If you decide you don’t like the paclet you can call PacletUninstall on it to completely delete it from your system or just ignore it—the next time you start the kernel, it will not be available (but still present so that it won’t have to be downloaded if you call PacletSymbol again).
Updating Paclets
The PacletInstall function does double duty: it installs the given paclet if it is not already present and it updates a previously installed paclet if a new version is found. There is no automatic updating for paclets from the Paclet Repository, so to get updates you must call PacletInstall. This function is very fast if you already have the paclet installed and no update is available.
Uninstalling Paclets
If you decide you no longer want a paclet, you can remove it from your system with PacletUninstall:
PacletUninstall["Wolfram/Mockingbird"]
This deletes the paclet and its resources from your system.