wolframclient.language package¶
Submodules¶
wolframclient.language.array module¶
- class wolframclient.language.array.PackedArray(array, type, shape=None)[source]¶
Bases:
NumericArray
wolframclient.language.decorators module¶
wolframclient.language.exceptions module¶
- exception wolframclient.language.exceptions.WolframLanguageException(payload, exec_info=None)[source]¶
Bases:
WLSerializable,ExceptionThe most generic exception raised by the Wolfram Client Library.
This class is
WLSerializableand will automatically serialize to a failure box when evaluated in Wolfram Desktop.
wolframclient.language.expression module¶
- class wolframclient.language.expression.WLFunction(head, *args, **opts)[source]¶
Bases:
WLExpressionMetaRepresent a Wolfram Language function with its head and arguments.
- args¶
- head¶
- class wolframclient.language.expression.WLInputExpression(input)[source]¶
Bases:
WLExpressionMetaRepresent a string input form expression.
- class wolframclient.language.expression.WLSymbol(name)[source]¶
Bases:
WLExpressionMetaRepresent a Wolfram Language symbol in Python.
- name¶
- class wolframclient.language.expression.WLSymbolFactory(name=None)[source]¶
Bases:
WLSymbolProvide a convenient way to build objects representing arbitrary Wolfram Language expressions through the use of attributes.
This class is conveniently instantiated at startup as
wl,GlobalandSystem. It should be instantiated only to represent many symbols belonging to the same specific context.Example:
>>> dev = WLSymbolFactory('Developer') >>> dev.PackedArrayQ Developer`PackedArrayQ
Alternative:
>>> wl.Developer.PackedArrayQ Developer`PackedArrayQ
- name¶
wolframclient.language.side_effects module¶
wolframclient.language.traceback module¶
Module contents¶
- wolframclient.language.Global = Global¶
A factory of
WLSymbolinstances havingGlobal`context.See
WLSymbolFactoryandWLSymbolFactoryfor more details.Represent a symbol in the Global context:
>>> Global.mySymbol Global`mySymbol
Represent a function call to a function:
>>> Global.myFunction('foo') Global`myFunction['foo']
- wolframclient.language.System = System¶
A factory of
WLSymbolinstances havingSystem`context.See
WLSymbolFactoryfor more details.Represent a symbol in the System context:
>>> System.ImageIdentify System`ImageIdentify
- wolframclient.language.wl¶
A factory of
WLSymbolinstances without any particular context.This instance of
WLSymbolFactoryis conveniently used by calling its attributes. The following code represents various Wolfram Language expressions:# Now wl.Now # Quantity[3, "Hours"] wl.Quantity(3, "Hours") # Select[PrimeQ, {1,2,3,4}] wl.Select(wl.PrimeQ, [1, 2, 3, 4])
Represent symbols in various contexts:
>>> wl.Developer.PackedArrayQ Developer`PackedArrayQ >>> wl.Global.f Global`f
Specify a context and a subcontext:
>>> wl.MyContext.MySubContext.SymbolName MyContext`MySubContext`SymbolName
- wolframclient.language.wlexpr¶
Represent Wolfram Language expressions with input form strings.
Convenient alias for
WLInputExpression.Represent an expression:
>>> wlexpr('Select[Range[10], EvenQ]') (Select[Range[10], EvenQ])
Represent a pure function that squares an input argument:
>>> wlexpr('# ^ 2 &' ) (# ^ 2 &)