How to obtain list of Installed Packages loadable by Get (<<)
There's nothing truly built in, but this is easy to roll if you know how to work with paclets. PacletInformation
will return a "Context"
parameter that specifies contexts for that paclet that may be loaded by Get
. PacletFind[]
will return all paclets. So then just attach the ".m"
and ".wl"
files and you get:
Sort@DeleteDuplicates@Join[
FileBaseName[#] <> "`" & /@
FileNames[WordCharacter .. ~~ (".m" | ".wl"), $Path],
Select[
Flatten@Lookup[PacletInformation /@ PacletFind[], "Context"],
StringMatchQ[(WordCharacter | "`") ..]
]
]
{"Alexa`", "AmhCode`", "AnatomyGraphics3D`", \
"AnatomyGraphics3DLoader`", "ArduinoCompile`", "ArduinoLink`", \
"ArduinoUpload`", "Arxiv`", "ArXivLoad`", \
"AstronomyConvenienceFunctions`", \
"AstronomyConvenienceFunctionsLoader`", "AuthDialogs`", \
"Authentication`", "AVRCCompiler`", "AWSLink`", "Benchmarking`", \
"BingSearch`", "BingSearchFunctions`", "BingSearchLoad`", \
"BlockBuilder`", "BTools`", "CacheManager`", "CCodeGenerator`", \
"CCompilerDriver`", "ChannelFramework`", "ChannelFrameworkLoader`", \
"ChatSystem`", "ChatTools`", "ChatToolsLoader`", "ChemSpider`", \
"ChemSpiderLoad`", "ChemTools`", "CloudExpression`", \
"CloudExpressionLoader`", "CloudObject`", "CloudObjectLoader`", \
"CodeSeal`", "CodeSeal`Authoring`", "CompiledFunctionTools`", \
"CompoundMatrixMethod`", "CoursewareTools`", "CrossRef`", \
"CrossRefLoad`", "Cryptography`", "CUDALink`", "CURLLink`", \
"DAALLink`", "Databases`", "DataDropClient`", \
"DataDropClientLoader`", "DataResource`", "DataResourceLoader`", \
"Dataset`", "DatasetLoader`", "DemoChannels`Oneliner`", \
"DemoChannels`WIM`", "Developer`", "DeviceFramework`Devices`", \
"DocFind`", "DocGen`", "DocumentationBuild`", "Dropbox`", \
"DynamicWebImage`", "EmbedCode`", "EmbedCodeLoader`", \
"EmbeddedService`", "EmbeddedServiceLoader`", "EncodedCache`", \
"EntityFramework`", "EntityFrameworkLoader`", "ExcelUpdate`", \
"ExceptionHandling`", "Experimental`", "ExtendedTools`", \
"ExternalEvaluate`", "ExternalEvaluateLoader`", \
"ExternalEvaluatePython`", "Facebook`", "FacebookLoad`", "Factual`", \
"FactualFunctions`", "FactualLoad`", "FDLLink`", \
"FederalReserveEconomicData`", "FederalReserveEconomicDataLoad`", \
"FEInfoExtractor`", "FETools`", "FileBrowser`", "Firmata`", \
"Fitbit`", "FitbitFunctions`", "FitbitLoad`", "Flickr`", \
"FlickrLoad`", "Forms`", "FormsLoader`", "FormulaData`", \
"FormulaDataLoader`", "FrontEndGraphics`", "GeneralUtilities`", \
"GeneralUtilitiesLoader`", "GeoFieldModelData`", \
"GeoFieldModelDataLoader`", "GitBookBuilder`", "GitConnection`", \
"GoogleAnalytics`", "GoogleAnalyticsLoad`", "GoogleCalendar`", \
"GoogleCalendarLoad`", "GoogleContacts`", "GoogleContactsLoad`", \
"GoogleCustomSearch`", "GoogleCustomSearchFunctions`", \
"GoogleCustomSearchLoad`", "GooglePlus`", "GooglePlusLoad`", \
"GoogleTranslate`", "GoogleTranslateFunctions`", \
"GoogleTranslateLoad`", "GPUTools`", "HDF5Tools`", "HTTPClient`", \
"HTTPHandling`", "HTTPLink`", "HTTPLinkLoader`", "HTTPListen`", \
"HumanGrowthData`", "HumanGrowthDataLoader`", "Iconize`", \
"IconizeLoader`", "IGraphM`", "IMAPLink`", "IMAPLinkLoader`", \
"InflationAdjust`", "InflationAdjustLoader`", "init`", "Instagram`", \
"InstagramLoad`", "IntegratedServices`", "IntegratedServicesLoader`", \
"Interpreter`", "IPOPTLink`", "JavaGraphics`", "JLink`", \
"JSONStream`", "LightGBMLink`", "LinearAlgebra`", "LinkedIn`", \
"LinkedInLoad`", "MachineLearning`", "MachineLearningLoader`", \
"Macros`", "MacrosLoader`", "MailChimp`", "MailChimpLoad`", \
"MailLink`", "MailLinkLoader`", "MaTeX`", \
"MathematicalFunctionData`", "MathematicalFunctionDataLoader`", \
"MicrosoftTranslator`", "MicrosoftTranslatorFunctions`", \
"MicrosoftTranslatorLoad`", "MiscFuncs`", "Mixpanel`", \
"MixpanelFunctions`", "MixpanelLoad`", "MobileMessaging`", \
"MobileMessagingLoader`", "MoleculeViewer`", "MongoLink`", \
"MQTTLink`", "MSETools`", "MTools`", "MUnit`", "MUnitLoader`", \
"MXNetLink`", "MyProjects`", "NaturalLanguageProcessing`", \
"NaturalLanguageProcessingLoader`", "NDSolve`FEM`", "NETLink`", \
"NeuralFunctions`", "NeuralNetResource`", "NeuralNetworks`", \
"NotebookTabbing`", "NotebookToPackage`", "NumericArrayUtilities`", \
"OAuth`", "OAuthLoader`", "OAuthSigning`", "OldHelpBrowser`", \
"OpenCLLink`", "OpenLibrary`", "OpenLibraryFunctions`", \
"OpenLibraryLoad`", "OpenPHACTS`", "OpenPHACTSLoad`", \
"PackageDataPacletInstall`", "PacletManager`", "PaneFileBrowser`", \
"PLI`", "PLILoader`", "PredictiveInterface`", "PresenterTools`", \
"ProcessLink`", "ProcessLinkLoader`", "PubChem`", "PubChemLoad`", \
"PublicPacletServer`", "PubMed`", "PubMedLoad`", "Pushbullet`", \
"PushbulletAPIFunctions`", "PushbulletLoad`", "PyTools`", \
"QuantityUnits`", "QuantityUnitsLoader`", "Reddit`", \
"RedditFunctions`", "RedditLoad`", "ResizePane`", \
"ResourceSystemClient`", "ResourceSystemInternalTools`", \
"ResourceSystemInternalToolsLoader`", "RobotTools`", \
"RobotToolsLoader`", "RunKeeper`", "RunKeeperLoad`", \
"SearchBrowser`", "SeatGeek`", "SeatGeekLoad`", "SecureShellLink`", \
"SemanticImport`", "SemanticImportLoader`", "SETools`", \
"Sheepshead`", "SketchTemplate`", "SMTPLink`", "SMTPLinkLoader`", \
"SpellCorrect`", "SpellCorrectLoader`", "SpellingData`", \
"SpellingDataLoader`", "StandardOceanData`", \
"StandardOceanDataLoader`", "StoppingPowerData`", \
"StoppingPowerDataLoader`", "Streaming`", "StreamingLoader`", \
"StreamLink`", "StylesheetEdit`", "SurveyMonkey`", \
"SurveyMonkeyLoad`", "SymbolicMachineLearning`", \
"SymbolicMachineLearningLoader`", "SymbolObjects`", \
"SyntaxHighlighting`", "SystemInstall`", "SystemInstallLoader`", \
"SystemTest`", "SystemTools`", "Templating`", "Terminal`", \
"TestApp`", "TetGenLink`", "TextSearch`", "TextSearchLoader`", \
"TextTranslation`", "TextTranslationLoader`", "TINSLink`", \
"Transmogrify`", "TravelDirectionsClient`", \
"TravelDirectionsClientLoader`", "TriangleLink`", "Twilio`", \
"TwilioFunctions`", "TwilioLoad`", "TwilioSendMessage`", "Twitter`", \
"TwitterFunctions`", "TwitterLoad`", "TypeSystem`", \
"TypeSystemLoader`", "URLUtilities`", "UWTools`", "VernierLink`", \
"WebSearch`", "WebSearchLoader`", "WebUnit`", "WebUnit`Utilities`", \
"WebUnit`WebDriverAPI`", "Wikipedia`", "WikipediaData`", \
"WikipediaDataLoader`", "WikipediaFunctions`", "WikipediaLoad`", \
"WolframAlphaClient`", "WolframBlockchain`", \
"WolframBlockchainLoader`", "WolframScript`", "WordFrequency`", \
"WordFrequencyLoader`", "WSM`", "WSMLink`", "WSMLoader`", "Yelp`", \
"YelpFunctions`", "YelpLoad`", "ZeroMQLink`", "ZeroMQLinkLoader`"}
There is no foolproof way to do this. Packages may be installed in very different ways. The other answer talks about paclets. Here's something for non-paclet packages.
candidates = Catenate[
Function[path,
FileNameTake[#] <> "`" & /@
Select[FileNames[All, path], DirectoryQ]
] /@ $Path
];
Select[candidates, FindFile[#] =!= $Failed &]
This enumerates all directories within paths contained in $Path
. Then it appends a backtick to turn them into context names. If FindFile
can resolve a context name to a loadable file, it is kept. Otherwise, it is thrown out.
It does give false positives that are not packages, but to be fair, these false positives are in face loadable with <<name`
, even if they are not meant to.
It also misses packages which are loadable by <<name`subname`
.