Is there any library to calculate the margin for multi-leg option positions?
You can calculate the margins using the Margin Calculator and also using the Basket Orders feature on Kite, you can learn more on Basket Orders here.
Thanks for the response, I am looking for some library to do it programmatically.