OpenMaple/Python/API - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : OpenMaple/Python/API

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.

Overview

 To use the Maple API for Python, start by importing the library maple. This implicitly launches a Maple session.

 import maple

 • 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

maple.namespace Subpackage

 • The maple.namespace subpackage allows any Maple variable or function to be accessed with a simple prefix.

Classes

 • The following classes are automatically applied to Maple objects created in a session. All objects are instances of the parent class Expression.

Class Listing

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.

RealNumeric

 • 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.

ComplexNumeric

 • The ComplexNumeric class represents complex numbers.  Conceptually, a ComplexNumeric object contains two RealNumeric objects: its real part and its imaginary part.

Name

 • The Name class represents a Maple name. Name publicly inherits from Expression.

Indexable

 • 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.

RTable

 • 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.

Table

 • 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.

 See Also