Do we have margin calculator function in python library

Do we have a margin calculator function in Python library to calculate margins required for position before placing orders.

Meanwhile no we are not providing the margin calculator.