OpenMaple Application Program Interface (API) for Python
Python Maple provides an interface between the Maple evaluation engine and a Python program. This is implemented using Python classes and Python interfaces. The classes allow Python programs to access the Maple evaluation engine. The interfaces allow the Maple evaluation engine to call Python functions.
To use the Maple API for Python, start by importing the library maple. This implicitly launches a Maple session.
To access Maple variables and predefined functions and commands, you can use the symbol or symbols function or import the maple.namespace interface:
The symbol function returns an Expression object.
The symbols function returns a tuple of Expression objects.
The namespace subpackage
The maple.namespace subpackage allows any Maple variable or function to be accessed with a simple prefix.
The following classes are automatically applied to Maple objects created in a session. All objects are instances of the parent class Expression.
The Expression class is the parent class of all the classes that represent Maple objects. Its member functions provide access to all the basic functions that can be performed on a Maple expression.
The RealNumeric class represents numeric object. Note that Maple integers and fractions are implicitly translated to Python integers and Fractions.fraction objects, so this class is only used for floating-point numbers.
The ComplexNumeric class represents complex numbers. Conceptually, a ComplexNumeric object contains two RealNumeric objects: its real part and its imaginary part.
The Name class represents a Maple name. Name publicly inherits from Expression.
The Indexable class is the parent class of all the classes that represent Maple collections. Its member functions provide access to the basic functions that can be performed on a collection, such as querying its size and testing for membership.
The RTable class represents an rtable. Datatype specific rtables are represented by sub-classes of RTable. These sub-classes have datatype specific functions. The RTable member functions perform operations applicable to any rtable.
The Table class represents a table. Data can be inserted and removed from the table and a table can be searched for a particular element.
Download Help Document