This project will help you to generate N length of OTP using Python.
Here I have used Fast2sms services for sending OTP to user.
Fast2sms:- https://www.fast2sms.com/dashboard/sms/bulk
Your api of Fast2sms:- https://www.fast2sms.com/dashboard/dev-api
For more help you can also refer: - https://docs.fast2sms.com/