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

maple.namespace Subpackage

Classes

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

ComplexNumeric

Expression

Indexable

List

Name

RealNumeric

RTable

Set

Table

 

 

 

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.

__abs__

__add__

__call__

__ceil__

__eq__

__floor__

__floordiv__

__ge__

__getitem__

__gt__

__hash__

__le__

__len__

__lt__

__mul__

__ne__

__neg__

__pow__

__radd__

__rfloordiv__

__rmod__

__rmul__

__round__

__rpow__

__rsub__

__rtruediv__

__sub__

__truediv__

__trunc__

eval

 

 

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.

conjugate

imag

real

 

Name

• 

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

__getattr__

assign

 

 

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.

__contains__

__iter__

__len__

 

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

Python